Commit 1b7d1a92 1b7d1a926ae9395aadd180fe7d6f715f9a074217 by Sergey Poznyakoff

Implemented

1 parent 559e294d
...@@ -25,7 +25,41 @@ ...@@ -25,7 +25,41 @@
25 int 25 int
26 mail_followup (int argc, char **argv) 26 mail_followup (int argc, char **argv)
27 { 27 {
28 fprintf (ofile, "Function not implemented in %s line %d\n", 28 message_t msg;
29 __FILE__, __LINE__); 29 header_t hdr;
30 return 1; 30 char *to = NULL, *subj = NULL;
31 char *str;
32 int i, num, *msglist;
33 char *savefile = NULL;
34
35 num = util_expand_msglist (argc, argv, &msglist);
36
37 if (mailbox_get_message(mbox, cursor, &msg))
38 {
39 fprintf(ofile, "%d: can't get message\n", cursor);
40 free(msglist);
41 return 1;
42 }
43
44 /* Create subject value */
45 message_get_header(msg, &hdr);
46 header_aget_value(hdr, MU_HEADER_SUBJECT, &str);
47 util_strcat(&subj, "Re: ");
48 util_strcat(&subj, str);
49 free(str);
50
51 /* Generate "to" list */
52 to = util_get_sender(cursor, 0);
53
54 /* Add authors of the subsequent messages to the to list
55 (or should it be cc?)*/
56 for (i = 1; i < num; i++)
57 util_strcat(&to, util_get_sender(msglist[i], 0));
58
59 free(msglist);
60
61 fprintf(ofile, "To: %s\n", to);
62 fprintf(ofile, "Subject: %s\n\n", subj);
63
64 return mail_send0(to, NULL, NULL, subj, isupper(argv[0][0]));
31 } 65 }
......