/[mailutils]/mailutils/mail.local/script.c
ViewVC logotype

Diff of /mailutils/mail.local/script.c

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

revision 1.7 by gray, Mon Nov 4 17:36:52 2002 UTC revision 1.8 by gray, Wed Nov 20 12:33:30 2002 UTC
# Line 34  prog_mda (struct mda_data *data) Line 34  prog_mda (struct mda_data *data)
34    char *x_argv[2];    char *x_argv[2];
35    guimb_param_t param;    guimb_param_t param;
36    mailbox_t mbox;    mailbox_t mbox;
37            stream_t stream = NULL;
38      
39    x_argv[0] = "mail.local";    x_argv[0] = "mail.local";
40    x_argv[1] = NULL;    x_argv[1] = NULL;
41    
42    fflush (data->fp);    message_get_stream (data->msg, &stream);
43      stream_flush (stream);
44    if (mailbox_create (&mbox, data->tempfile)    if (mailbox_create (&mbox, data->tempfile)
45        || mailbox_open (mbox, MU_STREAM_RDWR) != 0)        || mailbox_open (mbox, MU_STREAM_RDWR) != 0)
46      {      {
# Line 97  mda_catch_body (void *data, mailbox_t mb Line 99  mda_catch_body (void *data, mailbox_t mb
99    struct mda_data *md = data;    struct mda_data *md = data;
100    message_t mesg = NULL;    message_t mesg = NULL;
101    attribute_t attr = NULL;    attribute_t attr = NULL;
   FILE *fp = md->fp;  
102    
103    if (access (md->progfile, R_OK))    if (access (md->progfile, R_OK))
104      {      {
# Line 115  mda_catch_body (void *data, mailbox_t mb Line 116  mda_catch_body (void *data, mailbox_t mb
116    if (attribute_is_deleted (attr))    if (attribute_is_deleted (attr))
117      return SCM_BOOL_F;      return SCM_BOOL_F;
118    
   if (message_is_modified (mesg))  
     {  
       char *tname;  
       int fd = mu_tempfile (NULL, &tname);  
       mailbox_t tmp;  
         
       close (fd);  
       if (mailbox_create (&tmp, tname) == 0  
           && mailbox_open (tmp, MU_STREAM_RDWR) == 0)  
         {  
           mailbox_append_message (tmp, mesg);  
           mailbox_close (tmp);  
           mailbox_destroy (&tmp);  
   
           fp = fopen (tname, "r");  
         }  
       unlink (tname);  
     }  
   
119    mda_switch_to_user (NULL);    mda_switch_to_user (NULL);
120    mda (fp, md->argv[0]);    mda (md->msg, md->argv[0]);
   if (fp != md->fp)  
     fclose (fp);  
121    return SCM_BOOL_F;    return SCM_BOOL_F;
122  }  }
123    

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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