Changeset 3589:aea452bf2f86 for alias.c

Show
Ignore:
Timestamp:
2004-02-01 09:10:43 (5 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Turn alternates, lists, and subscribe into regular expression lists.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • alias.c

    r3441 r3589  
    530530  /* NULL address is assumed to be the user. */ 
    531531  if (!addr) 
    532     return 1; 
     532  { 
     533    dprint (5, (debugfile, "mail_addr_is_user: yes, NULL address\n")); 
     534    return 1; 
     535  } 
    533536  if (!addr->mailbox) 
     537  { 
     538    dprint (5, (debugfile, "mail_addr_is_user: no, no mailbox\n")); 
    534539    return 0; 
     540  } 
    535541 
    536542  if (ascii_strcasecmp (addr->mailbox, Username) == 0) 
    537     return 1; 
     543  { 
     544    dprint (5, (debugfile, "mail_addr_is_user: yes, %s = %s\n", addr->mailbox, Username)); 
     545    return 1; 
     546  } 
    538547  if (string_is_address(addr->mailbox, Username, Hostname)) 
    539     return 1; 
     548  { 
     549    dprint (5, (debugfile, "mail_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, Username, Hostname)); 
     550    return 1; 
     551  } 
    540552  if (string_is_address(addr->mailbox, Username, mutt_fqdn(0))) 
    541     return 1; 
     553  { 
     554    dprint (5, (debugfile, "mail_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, Username, mutt_fqdn (0))); 
     555    return 1; 
     556  } 
    542557  if (string_is_address(addr->mailbox, Username, mutt_fqdn(1))) 
    543     return 1; 
     558  { 
     559    dprint (5, (debugfile, "mail_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, Username, mutt_fqdn (1))); 
     560    return 1; 
     561  } 
    544562 
    545563  if (From && !ascii_strcasecmp (From->mailbox, addr->mailbox)) 
    546     return 1; 
    547  
    548   if (Alternates.pattern && 
    549       regexec (Alternates.rx, addr->mailbox, 0, NULL, 0) == 0) 
    550     return 1; 
    551    
     564  { 
     565    dprint (5, (debugfile, "mail_addr_is_user: yes, %s = %s\n", addr->mailbox, From->mailbox)); 
     566    return 1; 
     567  } 
     568 
     569  if (mutt_match_rx_list (addr->mailbox, Alternates)) 
     570  { 
     571    dprint (5, (debugfile, "mail_addr_is_user: yes, %s matched by alternates.\n", addr->mailbox)); 
     572    return 1; 
     573  } 
     574   
     575  dprint (5, (debugfile, "mail_addr_is_user: no, all failed.\n")); 
    552576  return 0; 
    553577}