/[mailutils]/mailutils/mail/followup.c
ViewVC logotype

Diff of /mailutils/mail/followup.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by gray, Thu Sep 26 14:19:00 2002 UTC revision 1.12 by gray, Thu Oct 3 14:32:47 2002 UTC
# Line 34  mail_followup (int argc, char **argv) Line 34  mail_followup (int argc, char **argv)
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);
# Line 62  mail_followup (int argc, char **argv) Line 62  mail_followup (int argc, char **argv)
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  }  }

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26