/[mailutils]/mailutils/mh/send.c
ViewVC logotype

Diff of /mailutils/mh/send.c

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

revision 1.5 by gray, Thu Feb 13 16:37:24 2003 UTC revision 1.6 by gray, Fri Feb 14 16:11:33 2003 UTC
# Line 340  create_message_id (header_t hdr) Line 340  create_message_id (header_t hdr)
340    free (p);    free (p);
341  }  }
342    
343    static char *
344    get_sender_personal ()
345    {
346      char *s = mh_global_profile_get ("signature", getenv ("SIGNATURE"));
347      if (!s)
348        {
349          struct passwd *pw = getpwuid (getuid ());
350          if (pw && pw->pw_gecos[0])
351            {
352              char *p = strchr (pw->pw_gecos, ',');
353              if (p)
354                *p = 0;
355              s = pw->pw_gecos;
356            }
357        }
358      return s;
359    }
360    
361  int  int
362  _action_send (void *item, void *data)  _action_send (void *item, void *data)
363  {  {
# Line 364  _action_send (void *item, void *data) Line 382  _action_send (void *item, void *data)
382          {          {
383            char *from;            char *from;
384            char *email = mu_get_user_email (NULL);            char *email = mu_get_user_email (NULL);
385            struct passwd *pw = getpwuid (getuid ());            char *pers = get_sender_personal ();
386            if (pw && pw->pw_gecos[0])            if (pers)
387              {              {
388                char *p = strchr (pw->pw_gecos, ',');                asprintf (&from, "\"%s\" <%s>", pers, email);
               if (p)  
                 *p = 0;  
               asprintf (&from, "\"%s\" <%s>", pw->pw_gecos, email);  
389                free (email);                free (email);
390              }              }
391            else            else

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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