<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7036.0">
<TITLE>postfix cyrus-imapd und die lokalen benutzerkonten</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<BR>
<P><FONT SIZE=2 FACE="Arial">Hallo,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">nachdem ich von einem Mitglied dieser Liste darauf aufmerksam gemacht worden bin, das sie in deutsch</FONT>
<BR><FONT SIZE=2 FACE="Arial">ist, schreibe ich hier nun nocheinmal mein Problemchen in Deutscher Fassung :-)</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Meine Problemstellung war es, alle Emaildomains inkl. aller ihrer Konten Virtuell in eine DB zu legen.</FONT>
<BR><FONT SIZE=2 FACE="Arial">Dies habe ich mittels dem Webcyradm HowTo von Luc De Louw auch realisieren können.</FONT>
</P>
<P><A HREF="http://www.tldp.org/HOWTO/Postfix-Cyrus-Web-cyradm-HOWTO/"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">http://www.tldp.org/HOWTO/Postfix-Cyrus-Web-cyradm-HOWTO/</FONT></U></A>
</P>
<BR>
<P><FONT SIZE=2 FACE="Arial">Der Server läuft korrekt und alles was ich zum anlegen von Domains/Mailkonten benötige sind ein</FONT>
<BR><FONT SIZE=2 FACE="Arial">paar mysql INSERT Abfragen. :)</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Hier meine Konfigurationen:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">$postconf -n</FONT>
<BR><FONT SIZE=2 FACE="Arial">alias_database = hash:/etc/aliases</FONT>
<BR><FONT SIZE=2 FACE="Arial">alias_maps = hash:/etc/aliases</FONT>
<BR><FONT SIZE=2 FACE="Arial">broken_sasl_auth_clients = yes</FONT>
<BR><FONT SIZE=2 FACE="Arial">command_directory = /usr/sbin</FONT>
<BR><FONT SIZE=2 FACE="Arial">config_directory = /etc/postfix</FONT>
<BR><FONT SIZE=2 FACE="Arial">daemon_directory = /usr/libexec/postfix</FONT>
<BR><FONT SIZE=2 FACE="Arial">debug_peer_level = 2</FONT>
<BR><FONT SIZE=2 FACE="Arial">html_directory = no</FONT>
<BR><FONT SIZE=2 FACE="Arial">inet_interfaces = all</FONT>
<BR><FONT SIZE=2 FACE="Arial">mail_owner = postfix</FONT>
<BR><FONT SIZE=2 FACE="Arial">mailbox_size_limit = 256000000</FONT>
<BR><FONT SIZE=2 FACE="Arial">mailbox_transport = cyrus</FONT>
<BR><FONT SIZE=2 FACE="Arial">mailq_path = /usr/bin/mailq.postfix</FONT>
<BR><FONT SIZE=2 FACE="Arial">manpage_directory = /usr/share/man</FONT>
<BR><FONT SIZE=2 FACE="Arial">message_size_limit = 40480000</FONT>
<BR><FONT SIZE=2 FACE="Arial">mime_header_checks = pcre:/etc/postfix/body_checks</FONT>
<BR><FONT SIZE=2 FACE="Arial">mydestination = localhost.$mydomain, localhost.localdomain, $myhostname, $mydomain, mysql:/etc/postfix/mysql-mydestination.cf</FONT></P>
<P><FONT SIZE=2 FACE="Arial">mydomain = snitch.de</FONT>
<BR><FONT SIZE=2 FACE="Arial">myhostname = mailrelay.snitch.de</FONT>
<BR><FONT SIZE=2 FACE="Arial">newaliases_path = /usr/bin/newaliases.postfix</FONT>
<BR><FONT SIZE=2 FACE="Arial">queue_directory = /var/spool/postfix</FONT>
<BR><FONT SIZE=2 FACE="Arial">readme_directory = /usr/share/doc/postfix-2.1.5/README_FILES</FONT>
<BR><FONT SIZE=2 FACE="Arial">sample_directory = /usr/share/doc/postfix-2.1.5/samples</FONT>
<BR><FONT SIZE=2 FACE="Arial">sender_canonical_maps = mysql:/etc/postfix/mysql-canonical.cf</FONT>
<BR><FONT SIZE=2 FACE="Arial">sendmail_path = /usr/sbin/sendmail.postfix</FONT>
<BR><FONT SIZE=2 FACE="Arial">setgid_group = postdrop</FONT>
<BR><FONT SIZE=2 FACE="Arial">smtp_tls_note_starttls_offer = yes</FONT>
<BR><FONT SIZE=2 FACE="Arial">smtp_use_tls = yes</FONT>
<BR><FONT SIZE=2 FACE="Arial">smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)</FONT>
<BR><FONT SIZE=2 FACE="Arial">smtpd_helo_required = yes</FONT>
<BR><FONT SIZE=2 FACE="Arial">smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_invalid_hostname, reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, reject_rbl_client dnsbl.ahbl.org, reject_rbl_client query.bondedsender.org, reject_rbl_client cbl.abuseat.org, reject_rbl_client sbl.csma.biz, reject_rbl_client unconfirmed.dsbl.org, reject_rbl_client zombie.dnsbl.sorbs.net, reject_rbl_client relays.ordb.org, reject_rbl_client opm.blitzed.org, reject_rbl_client list.dsbl.org, reject_rbl_client sbl.spamhaus.org, permit</FONT></P>
<P><FONT SIZE=2 FACE="Arial">smtpd_sasl_auth_enable = yes</FONT>
<BR><FONT SIZE=2 FACE="Arial">smtpd_sasl_local_domain =</FONT>
<BR><FONT SIZE=2 FACE="Arial">smtpd_sasl_security_options = noanonymous</FONT>
<BR><FONT SIZE=2 FACE="Arial">smtpd_tls_CAfile = /etc/postfix/ssl/smtpd.pem</FONT>
<BR><FONT SIZE=2 FACE="Arial">smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.pem</FONT>
<BR><FONT SIZE=2 FACE="Arial">smtpd_tls_key_file = /etc/postfix/ssl/smtpd.pem</FONT>
<BR><FONT SIZE=2 FACE="Arial">smtpd_tls_loglevel = 1</FONT>
<BR><FONT SIZE=2 FACE="Arial">smtpd_tls_received_header = yes</FONT>
<BR><FONT SIZE=2 FACE="Arial">smtpd_tls_session_cache_timeout = 3600s</FONT>
<BR><FONT SIZE=2 FACE="Arial">smtpd_use_tls = yes</FONT>
<BR><FONT SIZE=2 FACE="Arial">tls_random_source = dev:/dev/urandom</FONT>
<BR><FONT SIZE=2 FACE="Arial">unknown_local_recipient_reject_code = 450</FONT>
<BR><FONT SIZE=2 FACE="Arial">virtual_alias_maps = hash:/etc/postfix/virtual, mysql:/etc/postfix/mysql-virtual.cf</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">$less mysql-mydestination.cf</FONT>
<BR><FONT SIZE=2 FACE="Arial"># mysql config file for local domain (like sendmail's sendmail.cw) lookups on postfix</FONT>
<BR><FONT SIZE=2 FACE="Arial"># comments are ok.</FONT>
<BR><FONT SIZE=2 FACE="Arial">#</FONT>
<BR><FONT SIZE=2 FACE="Arial"># the user name and password to log into the mysql server</FONT>
<BR><FONT SIZE=2 FACE="Arial">hosts = localhost</FONT>
<BR><FONT SIZE=2 FACE="Arial">user = *****</FONT>
<BR><FONT SIZE=2 FACE="Arial">password = *******</FONT>
<BR><FONT SIZE=2 FACE="Arial"># the database name on the servers</FONT>
<BR><FONT SIZE=2 FACE="Arial">dbname = system_database</FONT>
<BR><FONT SIZE=2 FACE="Arial"># the table name</FONT>
<BR><FONT SIZE=2 FACE="Arial">table = mail_domain</FONT>
<BR><FONT SIZE=2 FACE="Arial">#</FONT>
<BR><FONT SIZE=2 FACE="Arial">select_field = domain_name</FONT>
<BR><FONT SIZE=2 FACE="Arial">where_field = domain_name</FONT>
<BR><FONT SIZE=2 FACE="Arial">#</FONT>
<BR><FONT SIZE=2 FACE="Arial">additional_conditions = and status = '1'</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">$less mysql-virtual.cf</FONT>
<BR><FONT SIZE=2 FACE="Arial">#</FONT>
<BR><FONT SIZE=2 FACE="Arial"># mysql config file for alias lookups on postfix</FONT>
<BR><FONT SIZE=2 FACE="Arial"># comments are ok.</FONT>
<BR><FONT SIZE=2 FACE="Arial">#</FONT>
<BR><FONT SIZE=2 FACE="Arial"># the user name and password to log into the mysql server</FONT>
<BR><FONT SIZE=2 FACE="Arial">hosts = localhost</FONT>
<BR><FONT SIZE=2 FACE="Arial">user = ****</FONT>
<BR><FONT SIZE=2 FACE="Arial">password = ****</FONT>
<BR><FONT SIZE=2 FACE="Arial"># the database name on the servers</FONT>
<BR><FONT SIZE=2 FACE="Arial">dbname = system_database</FONT>
<BR><FONT SIZE=2 FACE="Arial"># the table name</FONT>
<BR><FONT SIZE=2 FACE="Arial">table = mail_virtual</FONT>
<BR><FONT SIZE=2 FACE="Arial">#</FONT>
<BR><FONT SIZE=2 FACE="Arial">select_field = dest</FONT>
<BR><FONT SIZE=2 FACE="Arial">where_field = alias</FONT>
<BR><FONT SIZE=2 FACE="Arial">additional_conditions = and status = '1'</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">$less mysql-canonical.cf</FONT>
<BR><FONT SIZE=2 FACE="Arial"># mysql config file for canonical lookups on postfix</FONT>
<BR><FONT SIZE=2 FACE="Arial"># comments are ok.</FONT>
<BR><FONT SIZE=2 FACE="Arial">#</FONT>
<BR><FONT SIZE=2 FACE="Arial"># the user name and password to log into the mysql server</FONT>
<BR><FONT SIZE=2 FACE="Arial">hosts = localhost</FONT>
<BR><FONT SIZE=2 FACE="Arial">user = ***</FONT>
<BR><FONT SIZE=2 FACE="Arial">password = ***</FONT>
<BR><FONT SIZE=2 FACE="Arial"># the database name on the servers</FONT>
<BR><FONT SIZE=2 FACE="Arial">dbname = system_database</FONT>
<BR><FONT SIZE=2 FACE="Arial"># the table name</FONT>
<BR><FONT SIZE=2 FACE="Arial">table = mail_virtual</FONT>
<BR><FONT SIZE=2 FACE="Arial">#</FONT>
<BR><FONT SIZE=2 FACE="Arial">select_field = alias</FONT>
<BR><FONT SIZE=2 FACE="Arial">where_field = username</FONT>
<BR><FONT SIZE=2 FACE="Arial"># Return the first match only</FONT>
<BR><FONT SIZE=2 FACE="Arial">additional_conditions = and status = '1' limit 1</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Arial">Nun zu meinem Problem...</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Ich war es gewohnt das LogWatch, welches täglich per cron ausgeführt wird zu lesen, um sshd zugriffe etc. mit zu bekommen.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Diese mails habe ich immer als root mit mutt gelesen. Beim Nachsehen habe ich gesehen das die Mailboxdatei welche mutt</FONT>
<BR><FONT SIZE=2 FACE="Arial">zeigt in /var/spool/mail zu finden sind. Dort liegen der root und der snitch.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Fakt ist, das ich dieses Logwatch nicht mehr bekomme seit dem 02.02.2005!</FONT>
<BR><FONT SIZE=2 FACE="Arial">Bei meiner Fehlersuche habe ich per telnet versucht eine E-Mail von snitch@localhost an snitch@localhost zu senden.</FONT>
<BR><FONT SIZE=2 FACE="Arial">Etwa so:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">$ telnet localhost 25</FONT>
<BR><FONT SIZE=2 FACE="Arial">EHLO localhost</FONT>
<BR><FONT SIZE=2 FACE="Arial">…</FONT>
<BR><FONT SIZE=2 FACE="Arial">mail from: snitch@localhost</FONT>
<BR><FONT SIZE=2 FACE="Arial">rcpt to: snitch@localhost</FONT>
<BR><FONT SIZE=2 FACE="Arial">data</FONT>
<BR><FONT SIZE=2 FACE="Arial">subject: testmail</FONT>
<BR><FONT SIZE=2 FACE="Arial">testmail</FONT>
<BR><FONT SIZE=2 FACE="Arial">.</FONT>
<BR><FONT SIZE=2 FACE="Arial">quit</FONT>
<BR><FONT SIZE=2 FACE="Arial">…</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Im log steht dann das er die Mailbox für den User snitch nicht finden kann!</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Feb 16 19:20:40 localhost lmtpunix[30331]: accepted connection</FONT>
<BR><FONT SIZE=2 FACE="Arial">Feb 16 19:20:40 localhost lmtpunix[30331]: lmtp connection preauth'd as postman</FONT>
<BR><FONT SIZE=2 FACE="Arial">Feb 16 19:20:40 localhost lmtpunix[30331]: verify_user(user.snitch) failed: Mailbox does not exist</FONT>
<BR><FONT SIZE=2 FACE="Arial">Feb 16 19:20:40 localhost postfix/pipe[30329]: C9FF8508326: to=<snitch@snitch.de>, orig_to=<snitch@localhost.snitch.de>, relay=cyrus, delay=0, status=bounced (data format error. Command output: snitch: Mailbox does not exist )</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Feb 16 19:20:40 localhost postfix/qmgr[30316]: C9FF8508326: removed</FONT>
<BR><FONT SIZE=2 FACE="Arial">Feb 16 19:20:42 localhost postfix/smtpd[30320]: disconnect from localhost[127.0.0.1]</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Die Domain snitch.de existiert in der Mysql Datenbank und es ist auch ein Konto vorhanden mit der adresse snitch@snitch.de.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Da die Konten Virtuell sind und der postfix die adresse snitch@snitch.de eigentlich so verwaltet snitch@mailrelay.snitch.de, habe ich</FONT></P>
<P><FONT SIZE=2 FACE="Arial">dann versucht eine email an diesen user zu senden:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">$ telnet localhost 25</FONT>
<BR><FONT SIZE=2 FACE="Arial">Trying 127.0.0.1...</FONT>
<BR><FONT SIZE=2 FACE="Arial">Connected to localhost.localdomain (127.0.0.1).</FONT>
<BR><FONT SIZE=2 FACE="Arial">Escape character is '^]'.</FONT>
<BR><FONT SIZE=2 FACE="Arial">220 mailrelay.snitch.de ESMTP Postfix (2.1.5)</FONT>
<BR><FONT SIZE=2 FACE="Arial">ehlo localhost</FONT>
<BR><FONT SIZE=2 FACE="Arial">250-mailrelay.snitch.de</FONT>
<BR><FONT SIZE=2 FACE="Arial">250-PIPELINING</FONT>
<BR><FONT SIZE=2 FACE="Arial">250-SIZE 40480000</FONT>
<BR><FONT SIZE=2 FACE="Arial">250-VRFY</FONT>
<BR><FONT SIZE=2 FACE="Arial">250-ETRN</FONT>
<BR><FONT SIZE=2 FACE="Arial">250-STARTTLS</FONT>
<BR><FONT SIZE=2 FACE="Arial">250-AUTH LOGIN PLAIN</FONT>
<BR><FONT SIZE=2 FACE="Arial">250-AUTH=LOGIN PLAIN</FONT>
<BR><FONT SIZE=2 FACE="Arial">250 8BITMIME</FONT>
<BR><FONT SIZE=2 FACE="Arial">mail from: snitch0001@mailrelay.snitch.de</FONT>
<BR><FONT SIZE=2 FACE="Arial">250 Ok</FONT>
<BR><FONT SIZE=2 FACE="Arial">rcpt to: snitch0001@mailrelay.snitch.de</FONT>
<BR><FONT SIZE=2 FACE="Arial">450 <snitch0001@mailrelay.snitch.de>: Recipient address rejected: User unknown in local recipient table</FONT>
<BR><FONT SIZE=2 FACE="Arial">rcpt to: snitch@snitch.de</FONT>
<BR><FONT SIZE=2 FACE="Arial">250 Ok</FONT>
<BR><FONT SIZE=2 FACE="Arial">data</FONT>
<BR><FONT SIZE=2 FACE="Arial">354 End data with <CR><LF>.<CR><LF></FONT>
<BR><FONT SIZE=2 FACE="Arial">test</FONT>
<BR><FONT SIZE=2 FACE="Arial">.</FONT>
<BR><FONT SIZE=2 FACE="Arial">250 Ok: queued as CD0DE508320</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">hier das log dazu:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Feb 16 19:37:40 localhost postfix/smtpd[30383]: connect from localhost[127.0.0.1]</FONT>
<BR><FONT SIZE=2 FACE="Arial">Feb 16 19:38:06 localhost postfix/smtpd[30383]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 450 <snitch0001@mailrelay.snitch.de>: Recipient address rejected: User unknown in local recipient table; from=<snitch0001@mailrelay.snitch.de> to=<snitch0001@mailrelay.snitch.de> proto=ESMTP helo=<localhost></FONT></P>
<P><FONT SIZE=2 FACE="Arial">Feb 16 19:38:20 localhost postfix/smtpd[30383]: CD0DE508320: client=localhost[127.0.0.1]</FONT>
<BR><FONT SIZE=2 FACE="Arial">Feb 16 19:38:24 localhost postfix/cleanup[30387]: CD0DE508320: message-id=<20050216183757.CD0DE508320@mailrelay.snitch.de></FONT></P>
<P><FONT SIZE=2 FACE="Arial">Feb 16 19:38:24 localhost postfix/qmgr[30316]: CD0DE508320: from=<snitch@snitch.de>, size=344, nrcpt=1 (queue active)</FONT>
<BR><FONT SIZE=2 FACE="Arial">Feb 16 19:38:24 localhost lmtpunix[30380]: accepted connection</FONT>
<BR><FONT SIZE=2 FACE="Arial">Feb 16 19:38:24 localhost lmtpunix[30380]: lmtp connection preauth'd as postman</FONT>
<BR><FONT SIZE=2 FACE="Arial">Feb 16 19:38:24 localhost master[30393]: about to exec /usr/lib/cyrus-imapd/lmtpd</FONT>
<BR><FONT SIZE=2 FACE="Arial">Feb 16 19:38:24 localhost lmtpunix[30393]: executed</FONT>
<BR><FONT SIZE=2 FACE="Arial">Feb 16 19:38:24 localhost lmtpunix[30380]: duplicate_check: <20050216183757.CD0DE508320@mailrelay.snitch.de> user.snitch0001 0</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Feb 16 19:38:24 localhost lmtpunix[30380]: mystore: starting txn 2147483806</FONT>
<BR><FONT SIZE=2 FACE="Arial">Feb 16 19:38:24 localhost lmtpunix[30380]: mystore: committing txn 2147483806</FONT>
<BR><FONT SIZE=2 FACE="Arial">Feb 16 19:38:24 localhost lmtpunix[30380]: duplicate_mark: <20050216183757.CD0DE508320@mailrelay.snitch.de> user.snitch0001 1108579104 12</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Feb 16 19:38:24 localhost postfix/pipe[30391]: CD0DE508320: to=<snitch0001@mailrelay.snitch.de>, orig_to=<snitch@snitch.de>, relay=cyrus, delay=27, status=sent (mailrelay.snitch.de)</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Letzendlich wäre es am besten, wenn ich die Virtuellen Mailkonten auch den Lokalen Usern zuordnen könnte, wie in diesem Falle für snitch, welcher</FONT></P>
<P><FONT SIZE=2 FACE="Arial">ein lokales Konto hat auf dem System und eine Domain in der mysql DB für den Mailserver.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Und die root Mails müssen weiterhin irgendwo ankommen, von mir aus auch bei einem der virtuellen Konten wie z.B. snitch@snitch.de.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Ich hoffe ich habe nichts zu sehr verkompliziert. Bin für jeden Tipp dankbar. Gruß und schönen Abend.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Marcel Hartmann</FONT>
</P>
</BODY>
</HTML>