50 |
{ NULL } |
{ NULL } |
51 |
}; |
}; |
52 |
|
|
|
static char datebuf[80]; |
|
53 |
static int inplace; /* Annotate the message in place */ |
static int inplace; /* Annotate the message in place */ |
54 |
static char *anno_date; /* Annotation date */ |
static int anno_date = 1; /* Add date to the annotation */ |
55 |
static char *component; /* header field */ |
static char *component; /* header field */ |
56 |
static char *anno_text; /* header field value */ |
static char *anno_text; /* header field value */ |
57 |
|
|
74 |
break; |
break; |
75 |
|
|
76 |
case ARG_DATE: |
case ARG_DATE: |
77 |
anno_date = datebuf; |
anno_date = is_true (arg); |
78 |
break; |
break; |
79 |
|
|
80 |
case ARG_NODATE: |
case ARG_NODATE: |
81 |
anno_date = NULL; |
anno_date = 0; |
82 |
break; |
break; |
83 |
|
|
84 |
case ARG_COMPONENT: |
case ARG_COMPONENT: |
98 |
void |
void |
99 |
anno (mailbox_t mbox, message_t msg, size_t num, void *data) |
anno (mailbox_t mbox, message_t msg, size_t num, void *data) |
100 |
{ |
{ |
101 |
header_t hdr; |
mh_annotate (msg, component, anno_text, anno_date); |
|
attribute_t attr; |
|
|
|
|
|
if (message_get_header (msg, &hdr)) |
|
|
return; |
|
|
|
|
|
if (anno_date) |
|
|
header_set_value (hdr, component, anno_date, 0); |
|
|
header_set_value (hdr, component, anno_text, 0); |
|
|
|
|
|
message_get_attribute (msg, &attr); |
|
|
attribute_set_modified (attr); |
|
102 |
} |
} |
103 |
|
|
104 |
int |
int |
108 |
int index; |
int index; |
109 |
mailbox_t mbox; |
mailbox_t mbox; |
110 |
mh_msgset_t msgset; |
mh_msgset_t msgset; |
|
time_t t; |
|
|
struct tm *tm; |
|
111 |
|
|
112 |
mu_init_nls (); |
mu_init_nls (); |
113 |
|
|
|
t = time (NULL); |
|
|
tm = localtime (&t); |
|
|
strftime (datebuf, sizeof datebuf, "%a, %d %b %Y %H:%M:%S %Z", tm); |
|
|
|
|
114 |
mh_argp_parse (argc, argv, options, mh_option, args_doc, doc, |
mh_argp_parse (argc, argv, options, mh_option, args_doc, doc, |
115 |
opt_handler, NULL, &index); |
opt_handler, NULL, &index); |
116 |
|
|