PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Postfix kann Mails nicht zustellen



Sevenger
06.11.07, 23:37
Ich versuche unter Debian Etch mit Fetchmail Mails abzuholen, die dann von Postfix an cyrus ausgeliefert werden sollen. Leider hakt es ordentlich im Gebälk und ich bräuchte mal ein paar Tipps, wo ich denn gucken muss, bzw. woran es hakt.

Erstmal zur Fehlermeldung:


fetchmail[2735]: Nachricht user@externe.domain.de:1 von 1 wird gelesen (627 Bytes) (Log-Meldung unvollständig)
fetchmail[2657]: SMTP-Fehler: 554 5.7.1 <localhost[127.0.0.1]>: Client host rejected: Access denied
fetchmail[2657]: kann noch nicht einmal an fetchmail senden!


Ich vermute mal, dass es nur an Postfix liegen kann, ich bin aber eher unbedarft auf dem Gebiet.
Meine etc/main.cf sieht so aus:


#
# general
#
mydomain = meinserver.linux.local
myorigin = $mydomain
mydestination = mysql:/etc/postfix/mysql-mydestination.cf
mynetworks = 127.0.0.0/8
relay_domains =
mailbox_transport = cyrus
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf
sender_canonical_maps = mysql:/etc/postfix/mysql-canonical.cf
alias_maps = $alias_database
#
# sasl auth
# for clients
#
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_delay_reject = yes
smtpd_helo_required = yes
disable_vrfy_command = yes
strict_rfc821_envelopes = yes
smtpd_sender_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
permit
smtpd_recipient_restrictions =
reject_invalid_hostname,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_sender_domain,
reject_unknown_recipient_domain,
reject_unauth_pipelining,
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination,
reject_rbl_client relays.ordb.org,
reject_rbl_client dnsbl.sorbs.net,
reject_rbl_client list.dsbl.org,
reject_rbl_client sbl-xbl.spamhaus.org,
reject_rbl_client bl.spamcop.net,
permit
smtpd_data_restrictions =
reject_unauth_pipelining,
permit
# SASL TLS
# for server
#
smtp_use_tls = yes
#
# SASL TLS
# for clients
#
smtpd_use_tls = yes
smtpd_sasl_local_domain =
smtpd_sasl_auth_only = yes
smtpd_tls_note_starttls_offer = yes
smtpd_tls_cert_file = /etc/ssl/certs/smtps.pem
smtpd_tls_key_file = /etc/ssl/certs/smtps.pem
smtpd_tls_CAfile = /etc/ssl/certs/smtps.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom


und die master.cf



#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# ================================================== ========================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ================================================== ========================
smtp inet n - n - - smtpd
#submission inet n - - - - smtpd
# -o smtpd_enforce_tls=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticate d,reject
smtps inet n - n - - smtpd
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticate d,reject
#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
smtp unix - - - - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - - - - smtp
-o fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - - - - showq
error 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}
cyrus unix - n n - - pipe
flags= user=cyrus argv=/usr/sbin/cyrdeliver -r ${sender} -m ${extension} ${user}


Könnt ihr mir irgendwie weiterhelfen?
Die Config hab ich mir übrigens nicht selber ausgedacht, sondern kommt von hier: http://wiki.hetzner.de/index.php/DebianMailserver3

Ich weiss einfach nicht weiter - Hilfe...bitte...

so long
Sevenger

Sevenger
07.11.07, 14:14
Hat keiner denn zumindest einen Tipp, woran es liegen könnte, oder eine Idee, wie ich das Problem so weit eingrenzen kann, das ich hier nicht mehr wie der Ochs' vorm Berg steh'?
Ist es denn aller Wahrscheinlichkeit nach überhaupt ein Postfix Problem?
Liegt möglicherweise an den "reject"-Elementen in der Konfig?

Hilfe...

so long
Sevenger

Krebstierchen
08.11.07, 18:02
Hi,
ich bin selber noch nicht der Profi auf diesem Gebiet, muss mich aber auch täglich mit einem sehr ähnlichen (fetchmail-postfix-amavisd-procmail-cyrus, Debian 4.0) Mailsystem rumschlagen. Ich gehe immer folgende Sachen durch, wenn bei mir was nicht funktioniert:

-Was gibt telnet zurück? ("telnet localhost(oder die IP) 25")
-Mail.log und Mail.err sowie syslog durchforsten...
-laufen alle Dämonen? Hier wären das ja postfix und cyrus...
-möglicherweise störende Konfigeinträge auskommentieren (hier wären das deine reject Einträge) und schauen ob sich was ändert, ich probiere da recht gerne herum, ich weiß nicht ob das bei dir möglich ist (Produktionssystem oder privat?)

Als Vergleich vll mal meine funktionierende postfix config...

main.cf:


myhostname = bla.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = PC63.bla.de, localhost.bla.de, localhost, bla.de
relayhost = post.strato.de
mynetworks = 127.0.0.0/8 192.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
content_filter = vscan:[127.0.0.1]:10024
mailbox_transport = procmail
inet_protocols =all
fallback_transport = cyrus


Die modifizierten Teile der master.cf:


vscan unix - - - - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
127.0.0.1:10025 inet n - - - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-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
cyrus unix - n n - - pipe
# flags=R user=cyrus argv=/usr/sbin/cyrdeliver -e -m $(extension) $(user)
user=cyrus argv=/usr/sbin/cyrdeliver -e -r ${sender} -m ${user} ${user}
procmail unix - n n - - pipe
flags=R user=cyrus argv=/usr/bin/procmail -o SENDER=${sender} -m USER=${user} EXTENSION=${extension}

Sieht etwas einfacher aus als deine :) Ich weiß nicht ob dir das nun hilft, mal schauen...

Liebe Grüße, Steffi

bla!zilla
08.11.07, 19:18
Poste mal die Ausgabe von netstat -tulpen und den Inhalt von /var/log/mail, /var/log/mail.info und /var/log/mail.err

Sevenger
09.11.07, 09:27
Danke schon mal für Eure Hilfe, die Logs werde ich heute Nachmittag posten.
Ich habe einen Versandt einer Mail über Telnet getestet, das schlug jedoch fehl. Vielleicht liegt hier ja der Fehler.

SMTP per Telnet ansprechen geht.
HELO localhost geht auch.
Jedoch wenn ich dann MAIL FROM: test@netz.de oder irgendeine andere Adresse, bekomme ich die Meldung "501 5.1.7 Bad sender address syntax".
Das sollte wohl nicht sein und könnte das Problem sein, oder?

so long
Sevenger

Sevenger
11.11.07, 21:44
Ich hoffe die Log geben nen Hinweis. Ich sehe daraus nur, dass es nicht geht, leider nicht warum... :(

netstat -tulpen


Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address Foreign Address State Benutzer Inode PID/Program name
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 0 6616 2511/cyrmaster
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 0 6629 2511/cyrmaster
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 106 6160 2375/mysqld
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 0 7152 2652/smbd
tcp 0 0 0.0.0.0:52652 0.0.0.0:* LISTEN 101 7267 2711/rpc.statd
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 0 6622 2511/cyrmaster
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 0 6609 2511/cyrmaster
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 0 5629 2049/portmap
tcp 0 0 127.0.0.1:2000 0.0.0.0:* LISTEN 0 6642 2511/cyrmaster
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 0 6744 2599/master
tcp 0 0 0.0.0.0:113 0.0.0.0:* LISTEN 0 6492 2520/inetd
tcp 0 0 0.0.0.0:119 0.0.0.0:* LISTEN 0 6635 2511/cyrmaster
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 0 6741 2599/master
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 0 7151 2652/smbd
tcp6 0 0 :::993 :::* LISTEN 0 6614 2511/cyrmaster
tcp6 0 0 :::995 :::* LISTEN 0 6627 2511/cyrmaster
tcp6 0 0 :::110 :::* LISTEN 0 6620 2511/cyrmaster
tcp6 0 0 :::143 :::* LISTEN 0 6607 2511/cyrmaster
tcp6 0 0 :::80 :::* LISTEN 0 7378 2759/apache2
tcp6 0 0 :::22 :::* LISTEN 0 7185 2679/sshd
tcp6 0 0 :::119 :::* LISTEN 0 6633 2511/cyrmaster
udp 0 0 0.0.0.0:32768 0.0.0.0:* 101 7258 2711/rpc.statd
udp 0 0 192.168.0.9:137 0.0.0.0:* 0 6898 2614/nmbd
udp 0 0 0.0.0.0:137 0.0.0.0:* 0 6895 2614/nmbd
udp 0 0 192.168.0.9:138 0.0.0.0:* 0 6899 2614/nmbd
udp 0 0 0.0.0.0:138 0.0.0.0:* 0 6896 2614/nmbd
udp 0 0 0.0.0.0:68 0.0.0.0:* 0 5658 2621/dhclient3
udp 0 0 0.0.0.0:111 0.0.0.0:* 0 5624 2049/portmap
udp 0 0 192.168.0.9:123 0.0.0.0:* 0 7288 2727/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 0 7287 2727/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 0 7283 2727/ntpd
udp 0 0 0.0.0.0:767 0.0.0.0:* 0 7249 2711/rpc.statd
udp6 0 0 fe80::2e0:81ff:fe77:123 :::* 0 7286 2727/ntpd
udp6 0 0 ::1:123 :::* 0 7285 2727/ntpd
udp6 0 0 :::123 :::* 0 7284 2727/ntpd


var/log/mail.err


Nov 7 18:23:54 central-station fetchmail[2741]: Nachricht account@mail.sevengersdomain.de:1 von 1 wird gelesen (628 Bytes) (Log-Meldung unvollständig)
Nov 7 18:23:54 meinserver fetchmail[2741]: SMTP-Fehler: 554 5.7.1 <localhost[127.0.0.1]>: Client host rejected: Access denied
Nov 7 18:23:54 meinserver fetchmail[2741]: kann noch nicht einmal an fetchmail senden!


Danke.

Sevenger

GagaPeter
11.11.07, 22:33
Solltest du im moment keine Passwort Authentifizierung nutzen, fehlt hier deine Absender-IP. Kenn mich damit aber auch noch nicht so aus.


mynetworks

MFG

bla!zilla
12.11.07, 08:06
Fetchmail liefert über localhost aus, und 127.0.0.0/8 steht in der $mynetworks drin. Eine der folgenden Punkte wird dafür verantwortlich sein. Alternativ mal das Debugging hochdrehen.

smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_sender, reject_unknown_sender_domain