[Postfixbuch-users] Mails werden nicht angenommen

Patrick Ben Koetter p at state-of-mind.de
Mi Apr 2 20:11:08 CEST 2008


* Stoffel Armin <postfixbuch-users at listi.jpberlin.de>:
> Patrick Ben Koetter schrieb:
> 
> >* Stoffel Armin <postfixbuch-users at listi.jpberlin.de>:
> >  
> >
> >>Ich bin an postfix mit mysql dran. leider nimmt es keine E-mail 
> >>entgegen. Im Mysql Log file sehe ich:
> >>
> >>SELECT maildir FROM users WHERE email='domain.ch' and postfix= 'Y'
> >>
> >>Wieso kommt der domain name und nicht die email als where clausel eingefügt?
> >>Wo kann ich das anpassen?
> >>    
> >>
> >
> >In Deiner Konfiguration.
> >Wenn Du Hilfe dabei benötigst, dann poste sie in diese Liste. Für
> >Postfix-Parameter bitte nur "postconf -n". Die MySQL-Abfrage-Konfigurationen
> >einfach separat posten.
> >
> >p at rick
> >
> >
> >  
> >
> 
> Hallo hier die daten:
> Postconf -n
> 
> alias_maps = proxy:mysql:/etc/postfix/aliases.mysql
> biff = no
> broken_sasl_auth_clients = yes
> canonical_maps = hash:/etc/postfix/canonical
> command_directory = /usr/sbin
> config_directory = /etc/postfix
> daemon_directory = /usr/lib/postfix
> debug_peer_level = 2
> defer_transports =
> disable_dns_lookups = no
> disable_mime_output_conversion = no
> html_directory = /usr/share/doc/packages/postfix/html
> inet_interfaces = all
> inet_protocols = all
> local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname
> mail_owner = postfix
> mail_spool_directory = /var/mail
> mailbox_command =
> mailbox_size_limit = 0
> mailbox_transport =
> mailq_path = /usr/bin/mailq
> manpage_directory = /usr/share/man
> masquerade_classes = envelope_sender, header_sender, header_recipient
> masquerade_domains =
> masquerade_exceptions = root
> message_size_limit = 10240000
> mydestination = $myhostname, $transport_maps
> myhostname = ewriedbach.ch
> mynetworks_style = subnet
> newaliases_path = /usr/bin/newaliases

> proxy_read_maps = proxy:mysql:/etc/postfix/recipient.mysql        

Wieso läßt Du nicht den default für $proxy_read_maps?

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_canonical_maps
  $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks

Hast Du das auf einmal geändert oder sukzessive weggenommen, getestet,
weggenommen etc.?


> proxy:mysql:/etc/postfix/client.mysql        
> proxy:mysql:/etc/postfix/sender.mysql        
> proxy:mysql:/etc/postfix/aliases.mysql        
> proxy:mysql:/etc/postfix/relocated.mysql        
> proxy:mysql:/etc/postfix/transport.mysql        
> proxy:mysql:/etc/postfix/virtual.mysql        
> proxy:mysql:/etc/postfix/virtual-maps.mysql        
> proxy:mysql:/etc/postfix/virtual-uid.mysql        
> proxy:mysql:/etc/postfix/virtual-gid.mysql
> queue_directory = /var/spool/postfix
> readme_directory = /usr/share/doc/packages/postfix/README_FILES
> relayhost =
> relocated_maps = proxy:mysql:/etc/postfix/relocated.mysql
> sample_directory = /usr/share/doc/packages/postfix/samples
> sender_canonical_maps = hash:/etc/postfix/sender_canonical
> sendmail_path = /usr/sbin/sendmail
> setgid_group = maildrop
> smtp_sasl_auth_enable = no
> smtp_use_tls = no
> smtpd_client_restrictions = 
> permit_sasl_authenticated,permit_mynetworks,     \  check_client_access 

Was macht der "\" da drin? War der in der postconf-Ausgabe?


> proxy:mysql:/etc/postfix/client.mysql
> smtpd_helo_required = no
> smtpd_helo_restrictions =
> smtpd_recipient_restrictions = permit_mynetworks, 
> permit_sasl_authenticated, \  check_recipient_access 
> proxy:mysql:/etc/postfix/recipient.mysql,     \  
> reject_unauth_destination, permit
> smtpd_sasl_auth_enable = yes
> smtpd_sasl_authenticated_header = yes
> smtpd_sasl_local_domain =
> smtpd_sasl_security_options = noanonymous
> smtpd_sender_restrictions = check_sender_access 
> proxy:mysql:/etc/postfix/sender.mysql, \        

Sehe ich das richtig? Du führst eine Tabelle mit envelope-sender-Namen, die
senden dürfen wenn sie in einer SMTP-Session angegeben werden? So wie
Dictionary Attacken ablaufen ist Dein Server damit quasi ein Open Relay.

> reject_non_fqdn_sender,reject_unknown_sender_domain
> smtpd_tls_received_header = yes
> smtpd_use_tls = no
> strict_8bitmime = no
> strict_rfc821_envelopes = no
> transport_maps = proxy:mysql:/etc/postfix/transport.mysql
> unknown_local_recipient_reject_code = 550
> virtual_alias_domains = hash:/etc/postfix/virtual
> virtual_alias_maps = hash:/etc/postfix/virtual
> virtual_gid_maps = proxy:mysql:/etc/postfix/virtual-gid.mysql

Wenn das Ergebnis einer virtual_gid_maps-Abfragen immer denselben $GID
zurückliefern würde, kannst Du genauso das hier schreiben (GID == 2000):

virtual_gid_maps = static:2000

> virtual_mailbox_base = /var/spool/vmail
> virtual_mailbox_maps = proxy:mysql:/etc/postfix/virtual-maps.mysql
> virtual_uid_maps = proxy:mysql:/etc/postfix/virtual-uid.mysql

Für virtual_uid_maps siehe virtual_gid_maps.


> 
> recipient.mysql:
> user = user
> password = xxxxxx
> dbname = mail
> table = access
> select_field = access
> where_field = source
> additional_conditions = and type = 'recipient'
> hosts = 127.0.0.1

Also Deine MySQL-Notation ist von pre 2.2. Mittlerweile gibt es Postfix 2.5
und ich rate Dir das ganze einfacher zu gestalten. Hier ein Beispiel:

# recipient.mysql
hosts = localhost
user = user
password = xxxxxx
dbname = mail
query = SELECT access FROM access WHERE source = '%s' AND type = 'recipient'

Das ganze bitte dann OHNE Postfix mit dem postmap-Kommando testen:

$ postmap -q 'recipient at ewriedbach.ch' mysql:/etc/postfix/recipient.mysql
<ANTWORT>

Die Abfrage nach dem exakten Suchbegriff (kein Substring) sollte Dir das
gewünschte Ergebnis liefern. Wenn nicht, dann mußt Du an der Abfrage arbeiten.

Wenn Deine Abfragen das richtige Ergebnis liefern und es immer noch nicht tut,
dann melde Dich einfach wieder.

p at rick



-- 
Postfix - Einrichtung, Betrieb und Wartung
<http://www.postfix-buch.com>
saslfinger (debugging SMTP AUTH):
<http://postfix.state-of-mind.de/patrick.koetter/saslfinger/>



Mehr Informationen über die Mailingliste Postfixbuch-users