staging.inyokaproject.org

Fehlersuche bei Postfix / dovecot

Status: Gelöst | Ubuntu-Version: Xubuntu 20.04 (Focal Fossa)
Antworten |

glaskugel

Anmeldungsdatum:
8. Juli 2010

Beiträge: 3849

Es geht um einen PC, der nicht bei mir steht, wo ich aber mithelfe. Es gibt da vermutlich einen kleiner aber entscheidenden Fehler bei der Mailserverkonfiguration, denn:

Nov  3 16:42:43 server postfix/pickup[3493]: F3791C38895E: uid=1001 from=<ec>
Nov  3 16:42:44 server postfix/cleanup[4950]: F3791C38895E: message-id=<20201103154243.GA4828@server.local.xxxx.eu.org>
Nov  3 16:42:44 server postfix/qmgr[3495]: F3791C38895E: from=<ec@server.local.xxxx.eu.org>, size=429, nrcpt=1 (queue active)
Nov  3 16:42:44 server postfix/error[4952]: F3791C38895E: to=<ec@server.local.xxxx.eu.org>, relay=none, delay=0.02, delays=0.01/0/0/0, dsn=5.0.0, status=bounced (server.local.xxxx.eu.org)
Nov  3 16:42:44 server postfix/cleanup[4950]: 026C3C38895C: message-id=<20201103154244.026C3C38895C@server.local.xxxx.eu.org>
Nov  3 16:42:44 server postfix/bounce[4953]: F3791C38895E: sender non-delivery notification: 026C3C38895C
Nov  3 16:42:44 server postfix/qmgr[3495]: 026C3C38895C: from=<>, size=2349, nrcpt=1 (queue active)
Nov  3 16:42:44 server postfix/qmgr[3495]: F3791C38895E: removed
Nov  3 16:42:44 server postfix/error[4952]: 026C3C38895C: to=<ec@server.local.xxxx.eu.org>, relay=none, delay=0, delays=0/0/0/0, dsn=5.0.0, status=bounced (server.local.xxxx.eu.org)
Nov  3 16:42:44 server postfix/qmgr[3495]: 026C3C38895C: removed

Also da steht removed, ich frage mich nur wohin und davor aber status=bounced und sender non-delivery notification

Fragt man mit mutt ab, dann gibt es keine Mails, dazu Konfigurationsdetails später.

Ich vermute irgendein Problem, das ganz wo anders ist und an das man nicht so schnell denkt. Eine fast idente Konfiguration auf meinem PC funktioniert problemlos

hostname --fqdn
server.local.xxxx.eu.org

Der echte Damainname wurde durch Suchen und Ersetzen mit xxxx überschrieben, dh Tippfehler kann es beim Domainnamen keinen irgendwo geben.

postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
content_filter = smtp-amavis:[127.0.0.1]:10024
default_transport = error
home_mailbox = Maildir/
inet_interfaces = loopback-only
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot.conf -m "${EXTENSION}"
mailbox_size_limit = 0
message_size_limit = 0
mydestination = server, localhost.localdomain, localhost
myhostname = server.local.xxxx.eu.org
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
readme_directory = no
recipient_delimiter = +
relay_transport = error
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/dovecot/dovecot.pem
smtpd_tls_key_file = /etc/dovecot/private/dovecot.pem
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_mandatory_protocols = SSLv3, TLserver1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom

Bei den Konfigurationsdateien habe ich die #-Kommentare herausgefiltert, damit es lesbarer wird.

Diese master.cf funktioniert schon so seit einigen Distris, jedenfalls auch unter 19.10 und 20.o4

/etc/postfix/master.cf
smtp       inet  n       -       y       -       -       smtpd
pickup     unix  n       -       y       60      1       pickup
    -o content_filter=
    -o receive_override_options=no_header_body_checks
cleanup    unix  n       -       y       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
tlsmgr     unix  -       -       y       1000?   1       tlsmgr
rewrite    unix  -       -       y       -       -       trivial-rewrite
bounce     unix  -       -       y       -       0       bounce
defer      unix  -       -       y       -       0       bounce
trace      unix  -       -       y       -       0       bounce
verify     unix  -       -       y       -       1       verify
flush      unix  n       -       y       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp       unix  -       -       y       -       -       smtp
relay      unix  -       -       y       -       -       smtp
showq      unix  n       -       y       -       -       showq
error      unix  -       -       y       -       -       error
retry      unix  -       -       y       -       -       error
discard    unix  -       -       y       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp       unix  -       -       y       -       -       lmtp
anvil      unix  -       -       y       -       1       anvil
scache     unix  -       -       y       -       1       scache
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
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}
smtp-amavis unix -       -       y       -       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   -       y       -       -       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_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

Ebenso funktioniert die main.cf seit langer Zeit:

/etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file = /etc/dovecot/dovecot.pem
smtpd_tls_key_file = /etc/dovecot/private/dovecot.pem
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = server.local.xxxx.eu.org
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = server, localhost.localdomain, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
message_size_limit = 0 
recipient_delimiter = +
inet_interfaces = loopback-only
default_transport = error
relay_transport = error
content_filter=smtp-amavis:[127.0.0.1]:10024
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_authenticated_header = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sender_restrictions = reject_unknown_sender_domain
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot.conf -m "${EXTENSION}"
smtp_use_tls = yes
smtpd_tls_received_header = yes
smtpd_tls_mandatory_protocols = SSLv3, TLserver1
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_auth_only = yes
tls_random_source = dev:/dev/urandom

Bei Dovecot wurde auf Maildir umgestellt.

/etc/dovecot/conf.d/10-mail.conf 
mail_location = maildir:~/Maildir
namespace inbox {
  inbox = yes
}
mail_privileged_group = mail
protocol !indexer-worker {
}

Amavis ist so konfiguriert:

/etc/amavis/conf.d/15-content_filter_mode
use strict;
@bypass_virus_checks_maps = (
   \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
@bypass_spam_checks_maps = (
   \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);
1;  # ensure a defined return

/etc/amavis/conf.d/original_15-av_scanners ist default, sollte IMHO egal sein, dann wird eben ein Backup-Scanner verwendet.

Damit mutt Maildir verwendet, wurde im Home-Verzeichnis des Users folgende muttrc angelegt:

~/.muttrc 
set mbox_type=Maildir
set folder="~/Maildir"
set mask="!^\\.[^.]"
set mbox="~/Maildir"
set record="+.Sent"
set postponed="+.Drafts"
set spoolfile="~/Maildir"

Beim Versenden mit mutt kommt keine Fehlermeldung.

Was läuft da schief? Weitere Ausgaben gerne, die Antwort kann aber dauern, muss immer alles vorher am Telefon besprechen und mir dann ein Webmail senden lassen.

glaskugel

(Themenstarter)

Anmeldungsdatum:
8. Juli 2010

Beiträge: 3849

Scheint an der Konfiguration bei der Postfix-Installation zu liegen. Bei dem PC sv, den ich installiert habe, wurden AFAIR einfach alle Voreinstellungen abgewinkt.

mydestination = $myhostname, sv.local.xxxx.eu.org, localhost.local.xxxx.eu.org, localhost

Neim anderen PC namens server mit den Problemen gab Postfix oben ja folgendes aus:

mydestination = server, localhost.localdomain, localhost

Nach Aufruf von "dpkg-reconfigure postfix" und Angabe des FQDN server.local.xxxx.eu.org bei 2 Eingabefeldern, also auch dort wo man localhost vorgeschlagen findet, scheint es, dass nun alles problemlos funktioniert.

Antworten |