[Postfixbuch-users] Postfix mit partieller mysql
Andreas Meyer
anmeyer at anup.de
Di Sep 17 15:21:11 CEST 2013
Kai Fürstenberg <kai_postfix at fuerstenberg.ws> wrote:
> bist du sicher, dass er das nicht auswertet, ober bekommt er einfach nur
> nicht das richtige Ergebnis? Woran machst du das fest? An einem "postmap
> -q"?
>
> > user = test
> > password = test
> > hosts = localhost
> > dbname = mailtest
> > table = mailbox
> > select_field = CONCAT(username,'@',maildir)
> > where_field = username
> > additional_conditions = and active = '1'
> > query = SELECT CONCAT(username,'@',domain) FROM mailbox WHERE username='%s' AND active = '1';
>
> Du solltest dich entscheiden, welche Abfragemethode du verwenden
> möchtest: die "query"-Methode, oder die "table-select-where-add"-Methode.
>
> Ich persönlich bevorzuge die "query"-Methode und lasse die Felder
> "table", "select_field", "where_field" und "additional_conditions"
> einfach weg.
ok, ich habe das nach deiner Methode mal umgeändert. Ich bin nicht so
der SQL-Experte. Und bin erstaunt, das gesagte Domain jetzt beliefert
wird. Die Tabelle wird also ausgewertet. Das war offenbar ein
goldrichtiger Tip.
> > Auch die virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
> > wird nicht beachtet.
>
> Und woran machst du das fest? Wenn das schlicht nicht beachtet würde,
> wäre die Fehlermeldung "relay access denied" und nicht "User unknown",
> denn dann würde die Domain in der Konfig nicht existieren und dein
> Postfix sich für diese nicht interessieren.
...
> Das Problem ist zunächst mal, dass du bisher noch nicht einmal eine
> vollständige Konfiguration à la "postconf -n" gepostet hast. Und wir
> bekommen nur einzelne Log-Zeilen vorgesetzt, aus denen nichts
> ersichtlich ist.
>
> Bitte sende postconf -n (komplett) und ein vollständiges Log (von
> "connect" bis "disconnect"), bitte unverfälscht, wenn möglich. Wenn da
> tatsächlich nichts interessanteres drin steht, darf es auch schon mal
> ein "verbose"-log sein.
# postconf -n # sind sensible daten und manche virtuellen domains habe
# ich geschwärtzt
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
biff = no
body_checks = regexp:/etc/postfix/body_checks_regexp, pcre:/etc/postfix/body_checks_pcre
bounce_queue_lifetime = 1d
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
disable_dns_lookups = no
disable_mime_output_conversion = no
disable_vrfy_command = yes
header_checks = regexp:/etc/postfix/header_checks_regexp,
html_directory = /usr/share/doc/packages/postfix/html
inet_protocols = all
mail_owner = postfix
mail_spool_directory = /var/mail
mailbox_size_limit = 524288000
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_exceptions = root
maximal_queue_lifetime = 3d
message_size_limit = 524288000
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, listen.bitcorner.eu
mydomain = bitcorner.eu
myhostname = mail.bitcorner.eu
mynetworks = 213.239.207.165, 127.0.0.1/32
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix/README_FILES
recipient_bcc_maps = hash:/etc/postfix/archiv
sample_directory = /usr/share/doc/packages/postfix/samples
sender_bcc_maps = hash:/etc/postfix/archiv
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/certs/cacert.pem
smtp_tls_cert_file = /etc/postfix/certs/hostcert.pem
smtp_tls_key_file = /etc/postfix/certs/hostkey.pem
smtp_tls_loglevel = 1
smtp_tls_note_starttls_offer = yes
smtp_tls_session_cache_database = btree:/var/run/smtp_tls_session_cache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP
smtpd_client_restrictions =
smtpd_discard_ehlo_keywords = silent-discard, etrn
smtpd_etrn_restrictions = reject
smtpd_helo_required = no
smtpd_helo_restrictions =
smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/access_sender, permit_mynetworks, permit_sasl_authenticated, reject_invalid_helo_hostname, reject_unlisted_recipient, reject_unknown_sender_domain, check_sender_access pcre:/etc/postfix/umlaute.pcre, check_recipient_access pcre:/etc/postfix/umlaute.pcre, reject_unauth_destination, reject_rbl_client bl.spamcop.net, reject_rbl_client zen.spamhaus.org, check_client_access cidr:/etc/postfix/client.cidr, check_policy_service inet:127.0.0.1:10023
smtpd_restriction_classes = local_only
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = anup.de
smtpd_sasl_security_options = noanonymous
smtpd_sender_login_maps = hash:/etc/postfix/sasl_needed
smtpd_tls_CAfile = /etc/postfix/certs/cacert.pem
smtpd_tls_ask_ccert = yes
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/postfix/certs/hostcert.pem
smtpd_tls_key_file = /etc/postfix/certs/hostkey.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_req_ccert = no
smtpd_tls_session_cache_database = btree:/var/run/smtpd_tls_session_cache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
soft_bounce = yes
strict_8bitmime = no
strict_rfc821_envelopes = no
tls_random_source = dev:/dev/urandom
unknown_address_reject_code = 550
unknown_local_recipient_reject_code = 550
virtual_alias_domains = hash:/etc/postfix/virtual
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf, hash:/etc/postfix/virtualaliases
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/spool/vhosts
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf, anup.de aaaa.de aaaa.eu bitcorner.de cccc.de
virtual_mailbox_limit = 524288000
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf,
virtual_minimum_uid = 100
virtual_transport = dovecot
virtual_uid_maps = static:5000
Jetzt kommt das nächste Problem. Bei der Definition
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf,
anup.de aaaa.de aaaa.eu bitcorner.de cccc.de
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf,
# hash:/etc/postfix/mailboxes
wird die anup.de nicht mehr gefunden.
Sep 17 15:02:27 delta postfix/smtpd[13048]: connect from dovecot.org[193.210.130.67]
Sep 17 15:02:27 delta postfix/smtpd[13048]: NOQUEUE: reject: RCPT from dovecot.org[193.210.130.67]: 450 4.1.1 <anmeyer at anup.de>: Recipient address rejected: User unknown in virtual mailbox table; from=<dovecot-bounces at dovecot.org> to=<anmeyer at anup.de> proto=ESMTP helo=<dovecot.org>
Sep 17 15:02:27 delta postfix/smtpd[13048]: disconnect from dovecot.org[193.210.130.67]
Sep 17 15:02:38 delta postfix/smtpd[13048]: connect from delta.bitcorner.eu[213.239.207.165]
Sep 17 15:02:38 delta postfix/smtpd[13048]: NOQUEUE: reject: RCPT from delta.bitcorner.eu[213.239.207.165]: 450 4.1.1 <anmeyer at anup.de>: Recipient address rejected: User unknown in virtual mailbox table; from=<monit at delta> to=<anmeyer at anup.de> proto=SMTP helo=<delta>
Sep 17 15:02:38 delta postfix/smtpd[13048]: lost connection after RCPT from delta.bitcorner.eu[213.239.207.165]
Sep 17 15:02:38 delta postfix/smtpd[13048]: disconnect from delta.bitcorner.eu[213.239.207.165]
Sep 17 15:03:22 delta postfix/smtpd[13048]: connect from p54B302E4.dip0.t-ipconnect.de[84.179.2.228]
Sep 17 15:03:22 delta postfix/smtpd[13048]: setting up TLS connection from p54B302E4.dip0.t-ipconnect.de[84.179.2.228]
Sep 17 15:03:23 delta postfix/smtpd[13048]: TLS connection established from p54B302E4.dip0.t-ipconnect.de[84.179.2.228]: TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)
Sep 17 15:03:24 delta postfix/smtpd[13048]: NOQUEUE: client=p54B302E4.dip0.t-ipconnect.de[84.179.2.228], sasl_method=CRAM-MD5, sasl_username=anmeyer at anup.de
Sep 17 15:03:25 delta postfix/smtpd[13058]: connect from localhost[127.0.0.1]
Sep 17 15:03:25 delta postfix/smtpd[13058]: 37BC81B3033E: client=localhost[127.0.0.1]
Sep 17 15:03:25 delta postfix/cleanup[13059]: 37BC81B3033E: message-id=<20130917150320.4b901e70 at itxnew.bitcorner.intern>
Sep 17 15:03:25 delta postfix/smtpd[13058]: disconnect from localhost[127.0.0.1]
Sep 17 15:03:25 delta postfix/qmgr[12989]: 37BC81B3033E: from=<anmeyer at anup.de>, size=569, nrcpt=1 (queue active)
Sep 17 15:03:25 delta postfix/smtpd[13048]: disconnect from p54B302E4.dip0.t-ipconnect.de[84.179.2.228]
Sep 17 15:03:25 delta postfix/pipe[13060]: 37BC81B3033E: to=<harry at testdomain.test>, relay=dovecot, delay=0.42, delays=0.07/0.01/0/0.33, dsn=2.0.0, status=sent (delivered via dovecot service)
Sep 17 15:03:25 delta postfix/qmgr[12989]: 37BC81B3033E: removed
Besagte harry at testdomain.test, die in der MySQL-Tabelle steht, wird eingeliefert,
die anderen virtuellen Domainen werden nicht mehr gefunden, obwohl ich dachte,
es gäbe einen fallthrough mit
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf,
anup.de aaaa.de aaaa.eu bitcorner.de cccc.de
Andreas
Mehr Informationen über die Mailingliste Postfixbuch-users