Here's what should be some useful ACLs to break down elements of the 
 From header into the name part, email part, and domain part.

I'm planning to post these on the Wiki as examples. Perhaps someone 
would check and optimize the regex befor I post it. I'm not the best at 
regex.

# Extract the name part of the from address ("Name Part" 
<[EMAIL PROTECTED]>)
# into $acl_c_from_name_part returning [Name Part]

warn    set acl_c_from_name_part = 
${sg{$h_From:}{\N^["]?(.*?)\s?["]?\s?<.*$\N}{\$1}}

# Extract the email part of the from address ("Name Part" 
<[EMAIL PROTECTED]>)
# into $acl_c_from_email_part returning [EMAIL PROTECTED]

warn    set acl_c_from_email_part = 
${lc:${sg{$h_From:}{\N^.*<(.*)>$\N}{\$1}}}

# Extract the email domain part of the from address ("Name Part" 
<[EMAIL PROTECTED]>)
# into $acl_c_from_domain_part returning [address.com]

warn    set acl_c_from_domain_part = 
${sg{$acl_c_from_email_part}{\N^.*@(.*)$\N}{\$1}}


-- 
## List details at http://www.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/

Reply via email to