[exim] Rewriting recipients only during SMTP (not sender add…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Thomas Dorsch
Date:  
À: exim-users
Sujet: [exim] Rewriting recipients only during SMTP (not sender addresses)
Hello all,

i 'm new to exim4 and this list. The reason why i 'm asking for help is
as follows:
I 've set up exim4 with ldap plus amavis and spamassassin to act as a
mailgate for our company.
The use of ldap is to verify recipients and local domains. Everything
works perfect for me, except that sender addresses are also rewritten
because of the "S" flag in my rewrite rules.
If i apply the "envelope to(T)" flag it seems to be ignored by the use
of the "S" flag. Without the "S" flag no rewriting is done during SMTP
processing, of course.

What can i do to prevent rewriting of the sender addresses ?

See my config below:

######## exim4.conf ###################################################

acl_smtp_rcpt = check_recipient
acl_smtp_data = check_message

domainlist local_domains = ${lookup ldap
{ldap:///dc=meta,dc=ewt,dc=de?ou?sub?ou=$domain}}

########################################################################
######## main ##########################################################

smtp_banner = "myMailHost"
qualify_recipient = 127.0.0.1
host_lookup = 0.0.0.0/0
never_users = root:daemon:bin
trusted_users = mail:amavis
ldap_version = 3
ldap_default_servers = 127.0.0.1
log_selector = +all

########################################################################
######## acl ###########################################################

begin acl

check_recipient:

accept hosts = :

deny local_parts = ^.*[@%!/|] : ^\\.

require verify = sender

deny message = host is listed in $dnslist_domain
log_message = $sender_host_address is listed at $dnslist_domain
($dnslist_value: $dnslist_text)
dnslists = relays.ordb.org:relays.bl.kundenserver.de:sbl.spamhaus.org

deny domains = !+local_domains
message = Unbekannte Domain ....
verify = recipient

accept condition = ${lookup ldap
{ldap:///dc=meta,dc=ewt,dc=de??sub?(|(mail=$local_part@$domain))} {yes}{no}}
accept condition = ${lookup ldap
{ldap:///dc=meta,dc=ewt,dc=de??sub?(|(mailLocalAddress=$local_part@$domain))}
{yes}{no}}
deny message = Unbekannter Empfaenger oder Konto deaktiviert ....

check_message:
accept


########################################################################
######## routers #######################################################

amavis_director:
driver = accept
retry_use_local_part
transport = amavis_smtp

########################################################################
######## transports ####################################################

begin transports

amavis_smtp:
driver = smtp
allow_localhost
hosts = 127.0.0.1
port = 10024

########################################################################
######## rewrite ####################################################

begin rewrite

\N^([^@]*)@(.*)                                 ${lc:$1}@$2     TS
\N^([^@]*)[^A-Za-z0-9"]([^@]*)@([^@]*)          $1$2@$3         TS





########################################################################
######## retry #########################################################

begin retry

*                      *           F,2h,15m; G,16h,2h,1.5; F,4d,8h



# End of Exim 4 configuration
begin routers


Any ideas or help would be great

Thanks in advance

Tom