[Postfixbuch-users] Postfix/Amavis/Dovecot zeigt merkwürdiges Verhalten

Hans- Peter Walther hp.walther at gmx.de
Di Feb 16 17:49:29 CET 2010


Hallo erstmal,
ich hab einen kleinen Mailserver aufgesetzt um

- per fetchmail POP- Postfächer einzusammeln
- mittels amavis die mails durch clamav und spamassassin zu leiten und
- mittels dovecot einen IMAP- server mit sieve- Unterstützung zu haben.

Soweit die Theorie. Wahrscheinlich hab ich hier beim Konfigurieren des Guten zuviel getan und nun seh ich nicht mehr durch. Hier mal ein typischer log- Auszug zum processing einer mail von ebay, zur besseren Übersicht die Zeilen nummeriert, <belibige_id> und <beliebiger_Absenderaccount> sind jeweils identisch:

(1) Feb 15 10:18:03 server postfix/smtpd[15180]: connect from localhost[127.0.0.1]
(2) Feb 15 10:18:03 server postfix/smtpd[15180]: 6BCD040200E: client=localhost[127.0.0.1]
(3) Feb 15 10:18:03 server postfix/cleanup[15183]: 6BCD040200E: message-id=<beliebige_id>
(4) Feb 15 10:18:03 server postfix/qmgr[24270]: 6BCD040200E: from=<beliebiger_Absenderaccount>, size=33758, nrcpt=1 (queue active)
(5) Feb 15 10:18:03 server postfix/smtpd[15180]: disconnect from localhost[127.0.0.1]
(6) Feb 15 10:18:09 server postfix/smtpd[15267]: connect from localhost[127.0.0.1]
(7) Feb 15 10:18:09 server postfix/smtpd[15267]: 2FF5940200F: client=localhost[127.0.0.1]
(8) Feb 15 10:18:09 server postfix/cleanup[15183]: 2FF5940200F: message-id=<beliebige_id>
(9) Feb 15 10:18:09 server postfix/qmgr[24270]: 2FF5940200F: from=<beliebiger_Absenderaccount>, size=34203, nrcpt=1 (queue active)
(10) Feb 15 10:18:09 server postfix/smtpd[15267]: disconnect from localhost[127.0.0.1]
(11) Feb 15 10:18:09 server amavis[20764]: (20764-16) Passed CLEAN, LOCAL [127.0.0.1] [Sen.der.I.P] <beliebiger_Absenderaccount> -> <user at localhost>, Message-ID: <beliebige_id>, mail_id: NH0rQCx+kscG, Hits: 2.375, size: 33755, queued_as: 2FF5940200F, dkim_id=eBay at reply.ebay.de, 5708 ms
(12) Feb 15 10:18:09 server postfix/smtp[15184]: 6BCD040200E: to=<user at localhost>, relay=127.0.0.1[127.0.0.1]:10024, delay=5.9, delays=0.16/0.03/0.01/5.7, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=20764-16, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 2FF5940200F)
(13) Feb 15 10:18:09 server postfix/qmgr[24270]: 6BCD040200E: removed
(14) Feb 15 10:18:09 server postfix/local[15269]: 2FF5940200F: to=<user at localhost>, relay=local, delay=0.24, delays=0.07/0.05/0/0.12, dsn=2.0.0, status=sent (delivered to command: /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot-postfix.conf -n ${EXTENSION})
(15) Feb 15 10:18:09 server postfix/qmgr[24270]: 2FF5940200F: removed

Mail angekommen, toll!
Das ist, wie schon oben geschrieben, ein typischer Ablauf.
Mein erster Stolperstein sind die Zeilen 5 und 6: Warum dieser disconnect? Für mich sieht es so aus, das ab Zeile 5 die gleiche mail erneut mit einer anderen queue-ID an Postfix übergeben wird (gleiche Prozeß- Nummer des qmgr). Allerdings stimmt die Größe nicht mehr überein, wahrscheinlich durch zusätzliche header. Ansonsten sind Zeile 1-5 identisch Zeile 6-10!

Nach Zeile 10 wird die mail an amavis übergeben und in Zeile 11 teilt amavisd-new mit, das die mail auf spam geprüft wurde.
Aus Zeile 12 werd ich überhaupt nicht schlau. So wie ichs verstehe: Die mail, die als erstes ins System kam (nicht auf spam geprüft) mit der queue-ID 6BCD040200E wird vom smtp in die Auslieferungs- queue als mail mit der anderen queue- ID (2FF5940200F) gestellt. Dabei geht die eigentliche mail mit dieser ID (von amavis überprüft) flöten.

Zeile 13 enfernt die mail (ist schon in der queue), Zeile 14 -> an dovecot übergeben, Zeile 15 -> der Rest wird entfernt.
Irgendwas ist jedenfalls hier faul, die ausgelieferte mail hat zwar einen Eintrag "X-virus-scanned" von amavis, aber der Eintrag 

add_header all X-Spamassassin geprüft

in der local.cf wird ebenso ignoriert wie alle anderen mail- Veränderungen, die spamassassin eigentlich vornehmen müßte. Und das egal, ob ich die entsprechenden Zeilen in /etc/amavis/conf.d/15- -content_filter_mode auskommentiere oder nicht. Nun weiß ich wirklich nicht mehr weiter. Ich dene aber, das postfix hier der erste Anlaufpunkt ist. Vielleicht kann mir jemand auf die Sprünge helfen. 

postconf -n:

alias_maps = hash:/etc/aliases
allow_percent_hack = no
append_at_myorigin = no
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = amavisfeed:[127.0.0.1]:10024
home_mailbox = Maildir/
luser_relay = peter
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot-postfix.conf -n ${EXTENSION}
mailbox_size_limit = 0
mydestination = diverse, domains, localhost
myhostname = servername
mynetworks = 127.0.0.0/8 192.168.0.0/24
recipient_delimiter = +
relayhost = ein.relay.host
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth
smtp_sasl_security_options = noanonymous
smtp_use_tls = yes
smtpd_recipient_restrictions = reject_unknown_sender_domain reject_unknown_recipient_domain reject_unauth_pipelining permit_mynetworks permit_sasl_authenticated reject_unauth_destination permit_inet_interfaces
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_tls_auth_only = yes
smtpd_tls_mandatory_ciphers = medium, high
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_received_header = yes
soft_bounce = no
swap_bangpath = no
tls_random_source = dev:/dev/urandom
trigger_timeout = 15s

master.cf (ist eigentlich Original außer den Einträgen für den content-filter):

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
#submission inet n       -       -       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
amavisfeed unix    -       -       n       -       2     smtp 
	-o smtp_data_done_timeout=1200
	-o smtp_send_xforward_command=yes
     	-o disable_dns_lookups=yes
127.0.0.1:10025 inet n    -       n       -       -     smtpd
     -o content_filter=
     -o local_recipient_maps=
     -o relay_recipient_maps=
     -o smtpd_delay_reject=no
     -o smtpd_restriction_classes=
     -o smtpd_client_restrictions=
     -o smtpd_helo_restrictions=
     -o smtpd_sender_restrictions=
     -o smtpd_recipient_restrictions=permit_mynetworks,reject
     -o smtpd_data_restrictions=reject_unauth_pipelining
     -o smtpd_end_of_data_restrictions=
     -o mynetworks=127.0.0.0/8
     -o smtpd_error_sleep_time=0
     -o smtpd_soft_error_limit=1001
     -o smtpd_hard_error_limit=1000
     -o smtpd_client_connection_count_limit=0
     -o smtpd_client_connection_rate_limit=0
     -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters
     -o local_header_rewrite_clients=
#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
	-o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix	-	n	n	-	2	pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}


Puh, so ne lange mail hab ich schon ewig nicht mehr geschrieben. Wer noch was an infos braucht, schreiben, ich liefere nach.
mfg
Walther



Mehr Informationen über die Mailingliste Postfixbuch-users