Changeset 5420:a2e8f6fab8d3 for smtp.c

Show
Ignore:
Timestamp:
1969-12-31 16:00:00 (39 years ago)
Author:
Brendan Cully <brendan@…>
Branch:
HEAD
Message:

Test that envelope from or from is set before attempting SMTP delivery.
Closes #3079.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • smtp.c

    r5283 r5420  
    211211  CONNECTION *conn; 
    212212  ACCOUNT account; 
     213  const char* envfrom; 
     214  char buf[1024]; 
    213215  int ret = -1; 
    214   char buf[1024]; 
     216 
     217  /* it might be better to synthesize an envelope from from user and host 
     218   * but this condition is most likely arrived at accidentally */ 
     219  if (EnvFrom) 
     220    envfrom = EnvFrom->mailbox; 
     221  else if (from) 
     222    envfrom = from->mailbox; 
     223  else 
     224  { 
     225    mutt_error (_("No from address given")); 
     226    return -1; 
     227  } 
    215228 
    216229  if (smtp_fill_account (&account) < 0)