818 |
exit (1); |
exit (1); |
819 |
} |
} |
820 |
} |
} |
821 |
|
|
822 |
|
void |
823 |
|
mh_annotate (message_t msg, char *field, char *text, int date) |
824 |
|
{ |
825 |
|
header_t hdr; |
826 |
|
attribute_t attr; |
827 |
|
|
828 |
|
if (message_get_header (msg, &hdr)) |
829 |
|
return; |
830 |
|
|
831 |
|
if (date) |
832 |
|
{ |
833 |
|
time_t t; |
834 |
|
struct tm *tm; |
835 |
|
char datebuf[80]; |
836 |
|
t = time (NULL); |
837 |
|
tm = localtime (&t); |
838 |
|
strftime (datebuf, sizeof datebuf, "%a, %d %b %Y %H:%M:%S %Z", tm); |
839 |
|
|
840 |
|
header_set_value (hdr, field, datebuf, 0); |
841 |
|
} |
842 |
|
|
843 |
|
if (text) |
844 |
|
header_set_value (hdr, field, text, 0); |
845 |
|
message_get_attribute (msg, &attr); |
846 |
|
attribute_set_modified (attr); |
847 |
|
} |
848 |
|
|