postifx dovecot dns

Debian macht sich hervorragend als Web- und Mailserver. Schau auch in den " Tipps und Tricks"-Bereich.
Antworten
hermanthe
Beiträge: 3
Registriert: 16.01.2015 19:48:23

postifx dovecot dns

Beitrag von hermanthe » 16.01.2015 19:59:59

Guten Tag,

direkt zu Anfang: ich bin recht unerfahren was mail-server.konfiguration angeht und habe einfach mal auf meinen vserver zum Testen einen mail-server installiert und konfiguriert, einfach um es zu lernen. Mir war daher klar, dass es nicht direkt funktionieren wird. Allerdings finde ich den Fehler einfach nicht.

Installiert und konfiguriert ist wie gesagt mittlerweile alles, allerdings offensichtlich nicht richtig. Ich kann Mails zwar verschicken (landen zwar im Spam-Ordner aber es funktioniert) ich kann nur keine Mails empfangen. Ich lasse meinen Mailclient die Mails über imap abrufen.

Sende ich eine Mail von yahoo an meine @domain.de-Adresse, bekomme ich eine Failure Notice vom Mailor-Daemon@yahoo.com

Inhalt der Failure Mail von Yahoo

Code: Alles auswählen

(...)Recipient address rejected: User unknown in virtual alias table (...)
[/b]

Ich habe leider absolut keine Idee woran es liegen könnte. Es wirkt fast so, als würde mein Server nichts mit der Mail bzw. der Adresse anfangen können.. Anbei entsprechend die DNS-Einträge und config-files

main.conf

Code: Alles auswählen

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
#smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
#smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_cert_file = /etc/postfix/ssl/mailserver.crt
smtpd_tls_key_file = /etc/postfix/ssl/mailserver.key
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_tls_security_level = may

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = mail.domain.de
mydomain = domain.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mail.domain.de, vmd6804.contabo.host, localhost.contabo.host, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
disable_vrfy_command = yes


# Auth
smtpd_sasl_type=dovecot
smtpd_sasl_path=private/auth_dovecot
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
broken_sasl_auth_clients = yes

proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canon$

smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql-sender-login-maps.cf

smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch
        reject_unknown_sender_domain
smtpd_recipient_restrictions = permit_sasl_authenticated
        permit_mynetworks
        reject_unauth_destination


# Virtual mailboxes
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_base = /var/vmail/
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual-domains-maps.cf
virtual_mailbox_limit = 0
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_minimum_uid = 104
virtual_transport = virtual
local_transport = virtual
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
master.cf

Code: Alles auswählen

#
# 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
#smtp      inet  n       -       -       -       1       postscreen
#smtpd     pass  -       -       -       -       -       smtpd
#dnsblog   unix  -       -       -       -       0       dnsblog
#tlsproxy  unix  -       -       -       -       0       tlsproxy
#submission inet n       -       -       -       -       smtpd
#  -o syslog_name=postfix/submission
#  -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
smtps     inet  n       -       -       -       -       smtpd
#  -o syslog_name=postfix/smtps
  -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       -       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
relay     unix  -       -       -       -       -       smtp
#       -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

maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
#   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
#  mailbox_transport = lmtp:inet:localhost
#  virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# 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}

dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}
DNS-Einträge

Code: Alles auswählen

DNS-Eintrag   Typ   Daten
*.domain.de     A    ip.ip.ip.ip
mail.domain.de A    ip.ip.ip.ip
domain.de        A    ip.ip.ip.ip
www.domain.de A   ip.ip.ip.ip
domain.de       MX   mail.domain.de
Reverse-DNS

Code: Alles auswählen

ip.ip.ip.ip vmd6804.contabo.host (PTR)
Ich hoffe, ihr könnt mir helfen. Vielen Dank

PS: falls noch mehr Informationen benötigt werden, lasst es mich bitte wissen

Benutzeravatar
weshalb
Beiträge: 1265
Registriert: 16.05.2012 14:19:49

Re: postifx dovecot dns

Beitrag von weshalb » 17.01.2015 02:07:53

Guten Tag,

direkt zu Anfang: ich bin recht unerfahren was mail-server.konfiguration angeht und habe einfach mal auf meinen vserver zum Testen einen mail-server installiert und konfiguriert, einfach um es zu lernen.
Bevor es dir andere sagen: Du traust dir da ganz schön etwas zu. Zum Testen würde ich mich an deiner Stelle erstmal in die Materie einlesen und versuchen, einen Mailserver zu verstehen. Warum arbeitest du nicht erstmal in einer virtuellen Maschine und relay'st deine Mails? Das bedeutet, dass du die Mails über einen Provider deiner Wahl verschickst und die Mails von diesem Provider mit soetwas wie fetchmail oder getmail abholst.

Einen Mailserver zu betreiben bedeutet Verantwortungsbewußtsein : Stichwort "offenes Relay".

rendegast
Beiträge: 15041
Registriert: 27.02.2006 16:50:33
Lizenz eigener Beiträge: MIT Lizenz

Re: postifx dovecot dns

Beitrag von rendegast » 17.01.2015 03:09:21

Inhalt der Failure Mail von Yahoo
Am DNS kann es dann ja nicht liegen, da die Mail ja bis zum mail-Server kam, von diesem aber abgelehnt wurde.
Was steht im log des postfix?

User unknown in virtual alias table (...)
...
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql-sender-login-maps.cf
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual-domains-maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
mfg rendegast
-----------------------
Viel Eifer, viel Irrtum; weniger Eifer, weniger Irrtum; kein Eifer, kein Irrtum.
(Lin Yutang "Moment in Peking")

hermanthe
Beiträge: 3
Registriert: 16.01.2015 19:48:23

Re: postifx dovecot dns

Beitrag von hermanthe » 17.01.2015 09:37:17

Danke für die Antworten.

Wie ich bereits erwähnt habe, werde ich den Server, sobald der Mailserver funktioniert, wieder komplett neu aufsetzen. Ich möchte es einfach nur einmal zum laufen bringen, mehr nicht.
Was steht im log des postfix
log

Code: Alles auswählen

Jan 17 09:24:04 vmd6804 dovecot: auth-worker(5843): mysql(localhost): Connected to database mail
Jan 17 09:24:05 vmd6804 dovecot: imap-login: Login: user=<mail@domain.de>, method=PLAIN, rip=88.150.31.122, lip=213.136.85.65, mpid=5845, TLS, session=<dTDyz9QMtwBYlh96>
Jan 17 09:24:11 vmd6804 dovecot: imap(mail@domain.de): Disconnected: Logged out in=240 out=1042
Jan 17 09:24:28 vmd6804 postfix/smtpd[5846]: connect from nm26-vm5.bullet.mail.ir2.yahoo.com[212.82.97.47]
Jan 17 09:24:29 vmd6804 postfix/trivial-rewrite[5849]: warning: do not list domain domain.de in BOTH virtual_alias_domains and virtual_mailbox_domains

Jan 17 09:24:29 vmd6804 postfix/smtpd[5846]: NOQUEUE: reject: RCPT from nm26-vm5.bullet.mail.ir2.yahoo.com[212.82.97.47]: 550 5.1.1 <mail@domain.de>: Recipient address rejected: User unknow$

Jan 17 09:24:29 vmd6804 postfix/smtpd[5846]: disconnect from nm26-vm5.bullet.mail.ir2.yahoo.com[212.82.97.47]
Jan 17 09:25:38 vmd6804 dovecot: auth-worker(5856): mysql(localhost): Connected to database mail
Jan 17 09:25:38 vmd6804 dovecot: imap-login: Login: user=<mail@domain.de>, method=PLAIN, rip=88.150.31.122, lip=213.136.85.65, mpid=5858, TLS, session=<4Z2H1dQMIwBYlh96>
Jan 17 09:25:43 vmd6804 dovecot: imap-login: Login: user=<mail@domain.de>, method=PLAIN, rip=88.150.31.122, lip=213.136.85.65, mpid=5860, TLS, session=<DYnL1dQMKQBYlh96>
Jan 17 09:25:44 vmd6804 dovecot: imap-login: Login: user=<mail@domain.de>, method=PLAIN, rip=88.150.31.122, lip=213.136.85.65, mpid=5862, TLS, session=<dmze1dQMKgBYlh96>
Jan 17 09:27:49 vmd6804 postfix/anvil[5848]: statistics: max connection rate 1/60s for (smtp:212.82.97.47) at Jan 17 09:24:28
Jan 17 09:27:49 vmd6804 postfix/anvil[5848]: statistics: max connection count 1 for (smtp:212.82.97.47) at Jan 17 09:24:28
Jan 17 09:27:49 vmd6804 postfix/anvil[5848]: statistics: max cache size 1 at Jan 17 09:24:28
Jan 17 09:28:00 vmd6804 dovecot: imap(mail@domain.de): Disconnected: Logged out in=271 out=1014
Jan 17 09:28:00 vmd6804 dovecot: imap(mail@domain.de): Disconnected: Logged out in=177 out=900
Jan 17 09:28:00 vmd6804 dovecot: imap(mail@domain.de): Disconnected: Logged out in=240 out=1042

hermanthe
Beiträge: 3
Registriert: 16.01.2015 19:48:23

Re: postifx dovecot dns

Beitrag von hermanthe » 17.01.2015 10:00:20

habe die Zeile auskommentiert, jetzt funktioniert es. Mal schauen wo der Fehler genau liegt. Danke erst mal!

Code: Alles auswählen

virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual-alias-maps.cf

Benutzeravatar
HZB
Beiträge: 486
Registriert: 22.10.2003 11:52:15
Wohnort: Wien

Re: postifx dovecot dns

Beitrag von HZB » 26.01.2015 18:08:57

Code: Alles auswählen

User unknown in virtual alias table
Den User an den Du gesendet hast gibt es nicht. Zumindest nicht in der virtual alias table ....

kirschsahne
Beiträge: 5
Registriert: 19.01.2015 12:21:52

Re: postifx dovecot dns

Beitrag von kirschsahne » 26.01.2015 21:19:37

Warum hast du hier?
hermanthe hat geschrieben: myorigin = /etc/mailname
Defaultwert ist das hier:
myorigin (default: $myhostname)

Aber man kann den auch auf den Domainname setzen:
Example:
myorigin = $mydomain

Ausserdem sehe ich folgendes in deiner Logfile:

Code: Alles auswählen

warning: do not list domain domain.de in BOTH virtual_alias_domains and virtual_mailbox_domains

r4pt0r
Beiträge: 1237
Registriert: 30.04.2007 13:32:44
Lizenz eigener Beiträge: MIT Lizenz

Re: postifx dovecot dns

Beitrag von r4pt0r » 27.01.2015 08:52:29

myorigin=/etc/mailname ist IIRC default im postfix debian-paket und wird bei der interaktiven konfiguration nach der installation des deb-pakets angelegt. ändern auf "localhost, <FQDN>" schadet aber nicht, dann hat man die Werte direkt im blick...

Ursache dürfte aber sein dass alias_maps; alias_database UND virtual_alias_maps gesetzt sind. Das funktioniert wenn überhaupt nur mit kleinen Umwegen um lokale und virtuelle nutzer an getrennten Stellen mit aliasen zu versorgen - macht aber so nicht wirklich sinn...

Wenn ein dovecot als MDA läuft sollte postfix ohnehin als das konfiguriert sein was es ist - ein lokales relay zu dovecot. Abfrage der Benutzerkonten erfolgt dann von postfix an dovecot per SASL und user/logins werden von dovecot verwaltet. Das erspart die doppelte konfiguration und verkleinert die angriffsfläche. Dovecot hat ne wunderbar einfach einzurochtende SASL-Schnittstelle zu postfix (verglichen zu der cyrus-SASL Katastrophe...)
Postfix ordnet dann per relay_maps und transport_maps die virtuellen user dovecot zu; lokale user werden per mydomain und local_recipient_map aussortiert.

Das sollte erstmal genug lesestoff für die nächsten Tage liefern - und auch wenns schon gesagt wurde: ein Mailserver als "Versuchsobjekt" gehört nicht in freie Wildbahn! Sowas gehört erstmal ins lokale Netz und "ordentlich kaputtgetestet". Insebsondere das lesen (und verstehen!!) der Logdateien ist essentiell! Damit hättest du auf den aktuellen Fehler auch selbst schon kommen können. Postfix (und auch dovecot) sind sehr mitteilungsfreudig und liefern sehr ausführliche Fehlermeldungen. Da sind andere Dienste deutlich obskurer in ihren Fehlertexten...

Antworten