Postfix / Dovecot - aliases funktionieren nicht
LS
l.schilling.mz at posteo.de
So Feb 9 16:07:03 CET 2025
Guten Tag,
Guten Tag zusammen,
ich habe gestern den Mailserver unseres Vereins neu aufgesetzt, eine
Konstruktion aus
Uuntu 24.0.4
Postfix version 3.8.6 (on the old server it was 3.4.13)
Dovecot 2.3.21
MySQL Ver 15.1 Distrib 10.11.8-MariaDB
Postfixadmin
In der alten Umgebung (Ubuntu 20) hat alles funktioniert, in der neuen
Umgebung (Ubuntu 24) funktioniert eine Sache nicht, obwohl ich dachte, ich
hätte alle Parameter richtig angepasst.
Der Mailserver "my.mail.server" verwaltet z.B. die Domäne „my.domain“.
Mail-User and -Aliases sind in einer MySQL-Datenbank hinterlegt. Postfix
holt sich dort die Daten und reicht sie mit Hilfe von Dovecot zur
gewünschten Zieladresse weiter. Das funktioniert einwandfrei, solange es
sich um einen User mit Mailbox auf dem Server handelt:
Query SELECT concat('/vmail/', maildir) as home,
concat('maildir:/vmail/', maildir) as mail, 1000 AS uid, 1009 AS gid,
CONCAT('*:messages=10000:bytes=', quota) as quota_rule FROM mailbox WHERE
username = 'some.user at my.domain' AND active = '1'
postfix/lmtp[7636]: CD77E81A0F: to=<some.user at my.domain>,
relay=127.0.0.1[127.0.0.1]:24, delay=0.33, delays=0.31/0.01/0.01/0,
dsn=2.0.0, status=sent (250 2.0.0 <some.user at my.domain>
5sHdOex9p2fVHQAA7jBDhg Saved)
Wenn es sich aber um ein Alias (Weiterleitung lokal oder extern) handelt,
klappt das nicht:
Query SELECT concat('/vmail/', maildir) as home,
concat('maildir:/vmail/', maildir) as mail, 1000 AS uid, 1009 AS gid,
CONCAT('*:messages=10000:bytes=', quota) as quota_rule FROM mailbox WHERE
username = 'some.alias at my.domain' AND active = '1'
postfix/lmtp[7324]: 3EA9481A40: to=<some.alias at my.domain>,
relay=127.0.0.1[127.0.0.1]:24, delay=1.3, delays=1.2/0.01/0.01/0.02,
dsn=5.1.1, status=bounced (host 127.0.0.1[127.0.0.1] said: 550 5.1.1
<some.alias at my.domain> User doesn't exist: some.alias at my.domain (in reply to
RCPT TO command)
Postfix versucht offenbar, die Mail lokal direkt zuzustellen, obwohl es sich
um ein Alias handelt. Ich verstehe die Ursache leider überhaupt nicht,
begreife also auch nicht, ob Postfix oder Dovecot den Fehler verursacht.
dovecot -n
# Pigeonhole version 0.5.21 (f6cd4b8e)
# OS: Linux 6.8.0-52-generic x86_64 Ubuntu 24.04.1 LTS
# Hostname: my.mail.server
auth_mechanisms = plain login
auth_verbose = yes
disable_plaintext_auth = no
listen = *
log_path = /var/log/dovecot.log
mail_location = maildir:~/Maildir
mail_privileged_group = mail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags
copy include variables body enotify environment mailbox date index ihave
duplicate mime foreverypart extracttext
namespace inbox {
inbox = yes
location =
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix = INBOX/
separator = /
}
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
plugin {
sieve = /vmail/%d/%n/.dovecot.sieve
sieve_dir = ~/sieve
sieve_global_dir = /home/sieve/
sieve_global_path = /home/sieve/globalfilter.sieve
}
protocols = " imap lmtp sieve pop3 submission sieve"
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0666
user = postfix
}
}
service lmtp {
inet_listener lmtp {
address = 127.0.0.1
port = 24
}
}
service managesieve-login {
inet_listener sieve {
port = 4190
}
inet_listener sieve_deprecated {
port = 2000
}
}
service submission-login {
inet_listener submission {
port = 589
}
}
ssl_cert = </etc/letsencrypt/live/mail.kaestrich.de/fullchain.pem
ssl_client_ca_dir = /etc/ssl/certs
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
userdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
verbose_proctitle = yes
protocol lmtp {
mail_plugins = " sieve"
}
dovecot-sql.conf
driver = mysql
connect = host=/var/run/mysqld/mysqld.sock dbname=postfixadmin
user=postfixadmin password=[password]
password_query = SELECT username as user, password, concat('/vmail/',
maildir) as userdb_home, concat('maildir:/vmail/', maildir) as userdb_mail,
1000 as userdb_uid, 1009 as userdb_gid FROM mailbox WHERE username = '%Lu'
AND active = '1'
main.cf
[...]
mydestination = $myhostname, localhost.$mydomain, localhost
relay_domains = proxy:mysql:/etc/postfix/mysql-relay_domains_maps.cf
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_alias_maps.cf,
regexp:/etc/postfix/virtual_regexp,
hash:/etc/postfix/virtual
[...]
Vielen Dank für Hilfe!
Lothar
-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: <https://listen.jpberlin.de/pipermail/dovecot/attachments/20250209/36429399/attachment.htm>
Mehr Informationen über die Mailingliste Dovecot