34 |
|
|
35 |
compose_init (&env); |
compose_init (&env); |
36 |
if (msgset_parse (argc, argv, &msglist)) |
if (msgset_parse (argc, argv, &msglist)) |
37 |
return 1; |
return 1; |
38 |
|
|
39 |
if (mailbox_get_message(mbox, cursor, &msg)) |
if (mailbox_get_message (mbox, cursor, &msg)) |
40 |
{ |
{ |
41 |
util_error("%d: can't get message", cursor); |
util_error ("%d: can't get message", cursor); |
42 |
msgset_free (msglist); |
msgset_free (msglist); |
43 |
return 1; |
return 1; |
44 |
} |
} |
45 |
|
|
46 |
/* Create subject value */ |
/* Create subject value */ |
47 |
message_get_header(msg, &hdr); |
message_get_header (msg, &hdr); |
48 |
if (header_aget_value(hdr, MU_HEADER_SUBJECT, &str) == 0) |
if (header_aget_value (hdr, MU_HEADER_SUBJECT, &str) == 0) |
49 |
{ |
{ |
50 |
char *p = NULL; |
char *p = NULL; |
51 |
|
|
52 |
if (strncasecmp (str, "Re:", 3)) |
if (strncasecmp (str, "Re:", 3)) |
53 |
util_strcat (&p, "Re: "); |
util_strcat (&p, "Re: "); |
54 |
util_strcat (&p, str); |
util_strcat (&p, str); |
62 |
COMPOSE_SINGLE_LINE); |
COMPOSE_SINGLE_LINE); |
63 |
|
|
64 |
/* Add authors of the subsequent messages to the to list |
/* Add authors of the subsequent messages to the to list |
65 |
(or should it be cc?)*/ |
(or should it be cc?) */ |
66 |
for (mp = msglist; mp; mp = mp->next) |
for (mp = msglist; mp; mp = mp->next) |
67 |
compose_header_set (&env, MU_HEADER_TO, |
compose_header_set (&env, MU_HEADER_TO, |
68 |
util_get_sender(mp->msg_part[0], 0), |
util_get_sender (mp->msg_part[0], 0), |
69 |
COMPOSE_SINGLE_LINE); |
COMPOSE_SINGLE_LINE); |
70 |
|
|
71 |
msgset_free(msglist); |
msgset_free (msglist); |
72 |
|
|
73 |
fprintf (ofile, "To: %s\n", |
fprintf (ofile, "To: %s\n", compose_header_get (&env, MU_HEADER_TO, "")); |
|
compose_header_get (&env, MU_HEADER_TO, "")); |
|
74 |
fprintf (ofile, "Subject: %s\n\n", |
fprintf (ofile, "Subject: %s\n\n", |
75 |
compose_header_get (&env, MU_HEADER_SUBJECT, "")); |
compose_header_get (&env, MU_HEADER_SUBJECT, "")); |
76 |
|
|
77 |
status = mail_send0(&env, isupper(argv[0][0])); |
status = mail_send0 (&env, isupper (argv[0][0])); |
78 |
compose_destroy (&env); |
compose_destroy (&env); |
79 |
return status; |
return status; |
80 |
} |
} |