Sendmail sender rewrite: Difference between revisions
From Lolly's Wiki
Jump to navigationJump to search
(Die Seite wurde neu angelegt: „Kategorie:Sendmail ==Absender rewrite== In die .mc Datei: <pre> FEATURE(`genericstable')dnl GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain')dnl </pre> /etc/m…“) |
No edit summary |
||
Line 1: | Line 1: | ||
[[Kategorie:Sendmail]] | [[Kategorie:Sendmail]] | ||
= | =Sender rewrite= | ||
In die .mc Datei: | In die .mc Datei: | ||
<pre> | <pre> | ||
Line 7: | Line 7: | ||
</pre> | </pre> | ||
/etc/mail/genericsdomain | ==/etc/mail/genericsdomain== | ||
<pre> | <pre> | ||
src-domain.de | src-domain.de | ||
</pre> | </pre> | ||
==Testen der genericsdomain== | |||
<pre> | <pre> | ||
# sendmail -bt | # sendmail -bt | ||
Line 21: | Line 21: | ||
</pre> | </pre> | ||
/etc/mail/genericstable | ==/etc/mail/genericstable== | ||
<pre> | <pre> | ||
# localuser in any genericsdomain -> dst-user@dst-domain.de | # localuser in any genericsdomain -> dst-user@dst-domain.de | ||
Line 30: | Line 30: | ||
</pre> | </pre> | ||
Erzeugen der Übersetzungsdatenbank | ==Erzeugen der Übersetzungsdatenbank genericstable.db== | ||
<pre> | <pre> | ||
# makemap -f hash /etc/mail/genericstable.db < /etc/mail/genericstable | # makemap -f hash /etc/mail/genericstable.db < /etc/mail/genericstable | ||
</pre> | </pre> | ||
==Testen der genericstable.db== | |||
<pre> | <pre> | ||
# sendmail -bt -d60.1 | # sendmail -bt -d60.1 |
Revision as of 15:33, 23 May 2013
Sender rewrite
In die .mc Datei:
FEATURE(`genericstable')dnl GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain')dnl
/etc/mail/genericsdomain
src-domain.de
Testen der genericsdomain
# 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 genericstable.db
# makemap -f hash /etc/mail/genericstable.db < /etc/mail/genericstable
Testen der genericstable.db
# 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