[postfix-users] Postfix und Nicht-Lokale Zustellung

Robert Schetterer robert at schetterer.org
Fr Nov 21 01:09:21 CET 2008


Heiko Wundram schrieb:
> Hallo!
> 
> Ich bin aktuell mit Postfix (2.5.5) ein bisschen am verzweifeln: Ich habe auf 
> einem Mail-Relay folgende Einstellungen laufen (kondensiert und Domainnamen 
> entfernt; nicht weil ich nicht will, dass jemand da xencon.net 
> reininterpretiert, sondern weil ich die main.cf aus einem Template erzeuge[n 
> lasse], was ich hier wiedergebe):
> 
> main.cf
> -------
> 
> myhostname = mail01.<domain>
> mydomain = <domain>
> mydestination = $myhostname, localhost.$mydomain, localhost
> local_recipient_maps = $alias_maps
> relay_domains = mysql:/etc/postfix/transport.cf,
>  mysql:/etc/postfix/transportpfadm.cf
> relayhost = [relay.<domain>]
> transport_maps = mysql:/etc/postfix/transport.cf,
>  mysql:/etc/postfix/transportpfadm.cf
> alias_maps = hash:/etc/mail/aliases
> alias_database = hash:/etc/mail/aliases
> 
> und noch ein paar milter-Einstellungen, die aber nicht weiter von belang sind 
> (vermute ich, da die Mails, an denen ich verzweifele, sehr wohl durch milter 
> komplett bearbeitet, aber dann nicht zugestellt werden, und der milter, der 
> zum Einsatz kommt, auch keine rcpts umschreibt).
> 
> In den MySQL-Tabellen, auf die oben verwiesen wird, sind Einträge in der Form:
> 
> <domain>     smtp:[<host>]:<port>
> 
> und so auch eben für die Hauptdomain des Servers, wobei der Eintrag dort:
> 
> <domain>     smtp:[mail00.<domain>]:25
> 
> ist. Die Maps klappen auch wunderbar; wenn mail01 eine Mail annimmt, die für 
> eine Domain auf mail00 bestimmt ist, wird die weitergeleitet (nachdem eben 
> die Policy-Geschichten des milters erfüllt wurden). Im Vorfeld wird noch eine 
> Address-Probe gemacht, ob der entsprechende Empfänger auch verfügbar ist (auf 
> dem host aus den transport_maps), und das klappt auch.
> 
> Jetzt zu dem Problem: Mails, die an die Maildomain mail01.xencon.net gesendet 
> werden (in dem Fall, der mich verzweifeln lässt, sind es lokal generierte 
> bounces, allerdings hat das ganze DoS-Potential, da von außen das selbe 
> passiert über address verification probes für lokal), werden wunderbar 
> angenommen, allerdings erfolgt nach Annahme keine weitere Zustellung der 
> Mail, sondern die Mails bleiben für immer und ewig als active in der Queue. 
> Die Maildomain mail01.<domain> ist in keiner der obigen Relay/Transport-Maps 
> spezifiziert.
> 
> Auf jeden Fall, aktuelle sehe ich das folgende:
> 
> mail01 heiko # mailq
> -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
> 62AE060301A*    1297 Wed Nov 19 23:30:17  double-bounce at mail01.xencon.net
>                                          postmaster at mail01.xencon.net
> 
> AF3AE6014C5*    1334 Wed Nov 19 23:32:49  double-bounce at mail01.xencon.net
>                                          postmaster at mail01.xencon.net
> 
> B3515603018*    1332 Wed Nov 19 23:33:35  double-bounce at mail01.xencon.net
>                                          postmaster at mail01.xencon.net
> 
> ...
> 
> Der qmgr gibt im mail log aus, dass er die Zustellung in Angriff nimmt, und 
> danach passiert nichts mehr (die Mails stehen jetzt seit gestern abend in 
> genau diesem Status).
> 
> Nach meinem Verständnis müsste der local delivery agent in Aktion treten (weil 
> die Zieldomain zu mydestination gehört), und dieser entsprechend in der 
> alias-Tabelle nach postmaster suchen, welches auf root gemappt ist, und 
> dieses wiederum auf "admin at xencon.net":
> 
> /etc/mail/aliases
> -----------------
> 
> # Basic system aliases -- these MUST be present.
> MAILER-DAEMON:      postmaster
> postmaster:         root
> ...
> root:               admin at xencon.net
> 
> Anscheinend wird aber der local delivery agent nie gestartet.
> 
> Da das ganze kein Problem ist, wenn ich in local_recipient_maps eine 
> passwd-Abfrage einbaue, stellt sich für mich die Frage, was so anders ist, 
> wenn ich als einzige lokale Ziele die Alias-Namen erlaube (die, da bin ich 
> sicher, keine Schleifen enthalten, wie oben erkennbar; die Sender-Adresse 
> wird nicht geprüft, auch wenn für double-bounce kein Alias-Eintrag vorhanden 
> ist).
> 
> Wenn ich debug_peer_level hochdrehe, sehe ich auch soweit nichts spannendes, 
> nur, dass er anscheinend den Recipient in keiner Map findet, ihn aber korrekt 
> als lokal einstuft:
> 
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: < localhost[127.0.0.1]: RCPT TO: 
> <postmaster at mail01.xencon.net>
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: extract_addr: input: 
> <postmaster at mail01.xencon.net>
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: smtpd_check_addr: 
> addr=postmaster at mail01.xencon.net
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: send attr request = rewrite
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: send attr rule = local
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: send attr address = 
> postmaster at mail01.xencon.net
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: private/rewrite socket: wanted 
> attribute: flags
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute name: flags
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute value: 0
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: private/rewrite socket: wanted 
> attribute: address
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute name: address
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute value: 
> postmaster at mail01.xencon.net
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: private/rewrite socket: wanted 
> attribute: (list terminator)
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute name: (end)
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: rewrite_clnt: local: 
> postmaster at mail01.xencon.net -> postmaster at mail01.xencon.net
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: send attr request = resolve
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: send attr sender =
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: send attr address = 
> postmaster at mail01.xencon.net
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: private/rewrite socket: wanted 
> attribute: flags
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute name: flags
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute value: 0
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: private/rewrite socket: wanted 
> attribute: transport
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute name: transport
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute value: local
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: private/rewrite socket: wanted 
> attribute: nexthop
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute name: nexthop
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute value: 
> mail01.xencon.net
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: private/rewrite socket: wanted 
> attribute: recipient
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute name: recipient
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute value: 
> postmaster at mail01.xencon.net
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: private/rewrite socket: wanted 
> attribute: flags
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute name: flags
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute value: 256
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: private/rewrite socket: wanted 
> attribute: (list terminator)
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute name: (end)
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: resolve_clnt: `' -> 
> `postmaster at mail01.xencon.net' -> transp=`local' host=`mail01.xencon.net' 
> rcpt=`postmaster at mail01.xencon.net' flags= class=local
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: ctable_locate: install entry key 
> postmaster at mail01.xencon.net
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: extract_addr: in: 
> <postmaster at mail01.xencon.net>, result: postmaster at mail01.xencon.net
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: send attr request = rewrite
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: send attr rule = local
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: send attr address = double-bounce
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: private/rewrite socket: wanted 
> attribute: flags
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute name: flags
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute value: 0
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: private/rewrite socket: wanted 
> attribute: address
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute name: address
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: input attribute value: 
> double-bounce at mail01.xencon.net
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: private/rewrite socket: wanted 
> attribute: (list terminator)
> ...
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: >>> CHECKING RECIPIENT MAPS <<<
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: ctable_locate: leave existing 
> entry key postmaster at mail01.xencon.net
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: maps_find: 
> recipient_canonical_maps: postmaster at mail01.xencon.net: not found
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: maps_find: 
> recipient_canonical_maps: postmaster: not found
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: maps_find: 
> recipient_canonical_maps: @mail01.xencon.net: not found
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: mail_addr_find: 
> postmaster at mail01.xencon.net -> (not found)
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: maps_find: canonical_maps: 
> postmaster at mail01.xencon.net: not found
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: maps_find: canonical_maps: 
> postmaster: not found
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: maps_find: canonical_maps: 
> @mail01.xencon.net: not found
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: mail_addr_find: 
> postmaster at mail01.xencon.net -> (not found)
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: maps_find: virtual_alias_maps: 
> postmaster at mail01.xencon.net: not found
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: maps_find: virtual_alias_maps: 
> postmaster: not found
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: maps_find: virtual_alias_maps: 
> @mail01.xencon.net: not found
> Nov 20 19:43:43 mail01 postfix/smtpd[6958]: mail_addr_find: 
> postmaster at mail01.xencon.net -> (not found)
> ...
> Milter-Kram
> ...
> Nov 20 19:43:47 mail01 postfix/qmgr[6954]: 4D12060043D: 
> from=<heiko at xencon.net>, size=390, nrcpt=1 (queue active)
> 
> Und ab da ist Schluss.
> 
> Die Mail bleibt jetzt im active-Zustand.
> 
> Hat irgendjemand einen sinnvollen Hinweis, was ich hier falsch mache?
> 
> Danke schon mal für die Hilfe!
> 

Hallo Heiko,

irgendwie sehr verwirrend
was macht der server, ist das ein reines Mail relay
sowas wie ein backup mx der dann ueber transport
die mails an einen anderen server weiterleiten soll
und bevor er das tut per recipient verify
auf dem anderen server ueberpruefen soll ob die mail adresse da existiert?

spar dir doch erstmal milter und mysql und nimm erstmal hash maps her

zb so

relay_recipient_maps = hash:/etc/postfix/relay_recipient_map
@deine.domain OK

relay_domains =  hash:/etc/postfix/relay_domains
deine.domain OK

transport_maps = hash:/etc/postfix/transport
deine.domain smtp:die.ip.des.anderen.mail

dann noch ein reciept verify einbauen
( das hat aber auch nachteile ist nicht unbedingt zu empfehlen )
das kann man sich eigentlich sparen
wenn man in relay_recipient_maps
keinen catch all verwendet sondern gleich die exisitierenden
Mailadressen einpflegt

ansonsten hab ich noch nicht wirklich verstanden
was du da eigentlich realisieren willst

-- 
Best Regards

MfG Robert Schetterer

Germany/Munich/Bavaria


More information about the postfix-users mailing list