Sendmail sender rewrite
From Lolly's Wiki
Absender rewrite
In die .mc Datei:
FEATURE(`genericstable')dnl GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain')dnl
/etc/mail/genericsdomain:
src-domain.de
Check:
# sendmail -bt ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> > $=G src-domain.de >
/etc/mail/genericstable:
# localuser in any genericsdomain -> dst-user@dst-domain.de localuser dst-user@dst-domain.de # any other user @src-domain.de -> default-user@dst-domain.de @src-domain.de default-user@dst-domain.de
Erzeugen der Übersetzungsdatenbank:
# makemap -f hash /etc/mail/genericstable.db < /etc/mail/genericstable
Check:
# sendmail -bt -d60.1 ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> > /tryflags hs > /try esmtp localuser@src-domain.de Trying header sender address localuser@src-domain.de for mailer esmtp canonify input: localuser @ src-domain . de Canonify2 input: localuser < @ src-domain . de > map_lookup(host, src-domain.de) => NOT FOUND (68) Canonify2 returns: localuser < @ src-domain . de . > canonify returns: localuser < @ src-domain . de . > 1 input: localuser < @ src-domain . de . > 1 returns: localuser < @ src-domain . de . > HdrFromSMTP input: localuser < @ src-domain . de . > PseudoToReal input: localuser < @ src-domain . de . > PseudoToReal returns: localuser < @ src-domain . de . > MasqSMTP input: localuser < @ src-domain . de . > MasqSMTP returns: localuser < @ src-domain . de . > MasqHdr input: localuser < @ src-domain . de . > map_lookup(generics, localuser@src-domain.de) => NOT FOUND (0) map_lookup(generics, @src-domain.de) => NOT FOUND (0) map_lookup(generics, localuser) => dst-user@dst-domain.de (0) canonify input: dst-user @ dst-domain . de Canonify2 input: dst-user < @ dst-domain . de > map_lookup(host, dst-domain.de) => NOT FOUND (68) Canonify2 returns: dst-user < @ dst-domain . de > canonify returns: dst-user < @ dst-domain . de > MasqHdr returns: dst-user < @ dst-domain . de > HdrFromSMTP returns: dst-user < @ dst-domain . de > final input: dst-user < @ dst-domain . de > final returns: dst-user @ dst-domain . de Rcode = 0, addr = dst-user@dst-domain.de
Und beliebige user@src-domain.de:
# sendmail -bt -d60.1 ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> > /tryflags hs > /try esmtp anyuser@src-domain.de Trying header sender address anyuser@src-domain.de for mailer esmtp canonify input: anyuser @ src-domain . de Canonify2 input: anyuser < @ src-domain . de > map_lookup(host, src-domain.de) => NOT FOUND (68) Canonify2 returns: anyuser < @ src-domain . de . > canonify returns: anyuser < @ src-domain . de . > 1 input: anyuser < @ src-domain . de . > 1 returns: anyuser < @ src-domain . de . > HdrFromSMTP input: anyuser < @ src-domain . de . > PseudoToReal input: anyuser < @ src-domain . de . > PseudoToReal returns: anyuser < @ src-domain . de . > MasqSMTP input: anyuser < @ src-domain . de . > MasqSMTP returns: anyuser < @ src-domain . de . > MasqHdr input: anyuser < @ src-domain . de . > map_lookup(generics, anyuser@src-domain.de) => NOT FOUND (0) map_lookup(generics, @src-domain.de) => default-user@dst-domain.de (0) canonify input: default-user @ dst-domain . de Canonify2 input: default-user < @ dst-domain . de > map_lookup(host, dst-domain.de) => NOT FOUND (68) Canonify2 returns: default-user < @ dst-domain . de > canonify returns: default-user < @ dst-domain . de > MasqHdr returns: default-user < @ dst-domain . de > HdrFromSMTP returns: default-user < @ dst-domain . de > final input: default-user < @ dst-domain . de > final returns: default-user @ dst-domain . de Rcode = 0, addr = default-user@dst-domain.de