[Postfixbuch-users] @Aliasdomain -> @Domain

Thomas -Balu- Walter list+postfixbuch-users at b-a-l-u.de
Mo Nov 24 12:57:13 CET 2008


Hallo zusammen,

ich tue mich etwas schwer das Problem zu beschreiben, aber ich versuche
es mal:

Problematisch bei meiner Konfiguration sind "Alias-Domains". So nennen
wir Domains, bei denen alle Empfaenger zu einer anderen Domain umgeleitet
werden sollen. 

Die klassische Postfix-Zuordnung in der virtual_alias_table hierzu ist 
@barsch-und-scholle.de -> @barsch-scholle.de

Alle Empfaenger at barsch-und-scholle.de sollen so umgeleitet werden an
Empfaenger at barsch-scholle.de. 

Bei mir tritt jetzt ein Problem mit nicht existenten Adressen auf: 

Nov 24 12:19:35 taz postfix/smtpd[5428]: connect from roadrunner.bartels-schoene.de[87.249.96.21]
Nov 24 12:19:53 taz postfix/smtpd[5428]: 9112141F20BD: client=roadrunner.bartels-schoene.de[87.249.96.21]
Nov 24 12:20:05 taz postfix/cleanup[5539]: 9112141F20BD: message-id=<20081124111953.9112141F20BD at taz-mail.bartels-schoene.de>
Nov 24 12:20:05 taz postfix/qmgr[4355]: 9112141F20BD: from=<tw at b-a-l-u.de>, size=425, nrcpt=1 (queue active)
Nov 24 12:20:06 taz postfix/smtpd[5543]: connect from localhost[127.0.0.1]
Nov 24 12:20:06 taz postfix/smtpd[5543]: 2C68141F219E: client=localhost[127.0.0.1]
Nov 24 12:20:06 taz postfix/cleanup[5539]: 2C68141F219E: message-id=<20081124111953.9112141F20BD at taz-mail.bartels-schoene.de>
Nov 24 12:20:06 taz postfix/smtpd[5543]: disconnect from localhost[127.0.0.1]
Nov 24 12:20:06 taz postfix/qmgr[4355]: 2C68141F219E: from=<tw at b-a-l-u.de>, size=856, nrcpt=1 (queue active)
Nov 24 12:20:06 taz amavis[5301]: (05301-11) Passed CLEAN, [87.249.96.21] [87.249.96.21] <tw at b-a-l-u.de> -> <def at barsch-und-scholle.de>, Message-ID: <20081124111953.9112141F20BD at taz-mail.bartels-schoene.de>, mail_id: CCh3KfqqP2op, Hits: 2.899, size: 425, queued_as: 2C68141F219E, 446 ms
Nov 24 12:20:06 taz postfix/smtp[5540]: 9112141F20BD: to=<def at barsch-und-scholle.de>, relay=127.0.0.1[127.0.0.1]:10024, delay=23, delays=22/0.01/0/0.45, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=05301-11, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 2C68141F219E)
Nov 24 12:20:06 taz postfix/qmgr[4355]: 9112141F20BD: removed
Nov 24 12:20:06 taz deliver(def at barsch-scholle.de): msgid=<20081124111953.9112141F20BD at taz-mail.bartels-schoene.de>: saved mail to INBOX
Nov 24 12:20:06 taz postfix/pipe[5544]: 2C68141F219E: to=<def at barsch-scholle.de>, orig_to=<def at barsch-und-scholle.de>, relay=dovecot, delay=0.07, delays=0.01/0.01/0/0.05, dsn=2.0.0, status=sent (delivered via dovecot service)
Nov 24 12:20:06 taz postfix/qmgr[4355]: 2C68141F219E: removed
Nov 24 12:20:07 taz postfix/smtpd[5428]: disconnect from roadrunner.bartels-schoene.de[87.249.96.21]

Man sieht hier, dass die Mail an def at barsch-und-scholle.de angenommen, ins
amavis geschoben wird, dort wieder rauskommt, dann die Alias-Umwandlung in
def at barsch-scholle.de gemacht wird. Abschliessend wird die Mail dann per
dovecot in eine Mailbox geschrieben.

Leider geschieht der letzte Schritt, obwohl das Postfach nicht in der
"mailusers" (virtual_mailbox_maps) als moegliches Postfach existiert... 

Wo ist mein (offensichtlicher) Denkfehler?

     Balu

postconf -n; mysql-Abfragen wurden direkt eingefuegt und minimal kommentiert:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
inet_interfaces = 91.190.224.141, 127.0.0.1
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = taz.bartels-schoene.de, taz-mail.bartels-schoene.de, localhost.bartels-schoene.de, , localhost
myhostname = taz-mail.bartels-schoene.de
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
receive_override_options = no_address_mappings
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_recipient_restrictions = 
    permit_mynetworks, 
    permit_sasl_authenticated, 
    reject_unauth_destination, 
    check_recipient_access mysql:SELECT 'postfwd' FROM domains where postfwd=1 AND id IN (SELECT domain_id FROM `mailaliases` WHERE email="%s" OR email="@%d" UNION SELECT domain_id FROM mailusers WHERE email="%s")
    # liefert fuer Domains, die durch postfwd laufen sollen ein "postfwd" zurueck.
    # Die Abfrage holt sich die domain_id aus den Tabellen mailaliases und mailusers und fragt damit in domains, ob postfwd gewollt ist.
smtpd_restriction_classes = postfwd, postgrey
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = 
    mysql:SELECT destination FROM mailaliases WHERE email='%s', 
    mysql:SELECT email FROM mailusers WHERE email='%s' 
    # die zweite Abfrage mappt existierende Adressen auf sich selbst, um Catchalls zu umgehen
virtual_gid_maps = static:1001
virtual_mailbox_domains = mysql:SELECT 1 FROM domains WHERE name='%s' AND mail=1
virtual_mailbox_maps    = mysql:SELECT 1 FROM mailusers WHERE email='%s'
virtual_transport = dovecot
virtual_uid_maps = static:1001


Die master.cf entspricht dem Original bis auf die fuer dovecot und amavis
zusaetzlichen Eintraege.

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

smtp-amavis unix -      -       n       -       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_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
    -o local_header_rewrite_clients=




Mehr Informationen über die Mailingliste Postfixbuch-users