Posrfix+Mysql Virtuale Hosts Problem

Debian macht sich hervorragend als Web- und Mailserver. Schau auch in den " Tipps und Tricks"-Bereich.
Antworten
Andreas Diem
Beiträge: 23
Registriert: 18.09.2002 18:29:02
Wohnort: Neubau
Kontaktdaten:

Posrfix+Mysql Virtuale Hosts Problem

Beitrag von Andreas Diem » 26.09.2002 21:57:54

Hallo

Die ankommenden Mails werden nicht in die Virtuale_Mailbox abgelegt sonder beim Benutzer.

master.cf

Code: Alles auswählen

smtp	  inet	n	-	n	-	-	smtpd
   -o content_filter=amavis:

amavis    unix	-	n	n	-	10	pipe
   user=amavis argv=/usr/sbin/amavis ${sender} ${recipient}
localhost:10025 inet n	-	n	-	-	smtpd

maildrop  unix	-	n	n	-	-	pipe
   flags=R user=vmail argv=/usr/bin/maildrop -d ${recipient}

#628	  inet	n	-	-	-	-	qmqpd
pickup	  fifo	n	-	-	60	1	pickup
cleanup	  unix	n	-	n	-	0	cleanup
qmgr	  fifo	n	-	n	300	1	qmgr
#qmgr	  fifo	n	-	-	300	1	nqmgr
rewrite	  unix	-	-	-	-	-	trivial-rewrite
bounce	  unix	-	-	-	-	0	bounce
defer	  unix	-	-	-	-	0	bounce
flush	  unix	n	-	-	1000?	0	flush
smtp	  unix	-	-	-	-	-	smtp
showq     unix	n	-	-	-	-	showq
error     unix	-	-	-	-	-	error
local	  unix	-	n	n	-	-	local
virtual	  unix	-	n	n	-	-	virtual
lmtp	  unix	-	-	n	-	-	lmtp
main.cf

Code: Alles auswählen

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
setgid_group = postdrop
biff = no

inet_interfaces = all
# appending .domain is the MUA's job.
append_dot_mydomain = no
myhostname = andreas-diem.at
myorigin = /etc/mailname
relayhost = 
mynetworks = 127.0.0.0/8 213.133.102.103/24
mailbox_command = 
mailbox_size_limit = 0
recipient_delimiter = +
home_mailbox = Maildir/

mydestination = $myhostname, $transport_maps
alias_maps = mysql:/etc/postfix/mysql-aliases.cf
alias_database = mysql:/etc/postfix/mysql-aliases.cf
relocated_maps = mysql:/etc/postfix/mysql-relocated.cf
transpost_maps = mysql:/etc/postfix/mysql-transport.cf
virtual_maps = mysql:/etc/postfix/mysql-virtual.cf
local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname
virtual_mailbox_base = /
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf
virtual_uid_maps = mysql:/etc/postfix/mysql-virtual-uid.cf
virtual_gid_maps = mysql:/etc/postfix/mysql-virtual-gid.cf

smtpd_recipient_restrictions =	permit_mynetworks,
				permit_sasl_authenticated,
				reject_maps_rbl,
				check_relay_domains,
				permit
In der syslog wird keine Fehlermeldung angezeigt, nur ein warning:

Code: Alles auswählen

 debian postfix/smtpd[398]: warning: restriction `permit' after `check_relay_domains' is ignored
mfg
Andreas Diem
webmaster@andreas-diem.at

Benutzeravatar
feltel
Webmaster
Beiträge: 10368
Registriert: 20.12.2001 13:08:23
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: Leipzig, Germany
Kontaktdaten:

Beitrag von feltel » 27.09.2002 07:14:50

Du musst in den Transport-Maps (also in Deinem Fall in der MySQL-Transport-Tabelle) schon sagen, das er die Domain andreas-diem.at an den Virtuellen Transport übergeben soll. Bei mir (hab das gleiche Setup) sieht die Tabelle so aus:

Code: Alles auswählen

mysql> select * from postfix_transport;
+----+---------------------------+-------------+
| id | domain                    | destination |
+----+---------------------------+-------------+
|  1 | rahn-schulen.de           | virtual:    |
|  2 | lips-flugdienst.de        | virtual:    |
+----+---------------------------+-------------+

Andreas Diem
Beiträge: 23
Registriert: 18.09.2002 18:29:02
Wohnort: Neubau
Kontaktdaten:

Beitrag von Andreas Diem » 27.09.2002 16:46:03

Die Transport-Maps ist richtig gesätzt, und die Users auch (glaube ich).

Code: Alles auswählen

mysql> select * from transport;
+----+-----------------+-------------+
| id | domain          | destination |
+----+-----------------+-------------+
|  1 | andreas-diem.at | virtual:    |
+----+-----------------+-------------+

Code: Alles auswählen

mysql> select * from users;
+----+------------+----------------------------+-------+--------------+------+------+-----------+--------------------------------------------------+-------+---------+
| id | username   | email                      | clear | name         | uid  | gid  | homedir   | maildir                                          | quota | postfix |
+----+------------+----------------------------+-------+--------------+------+------+-----------+--------------------------------------------------+-------+---------+
|  1 | ad         | ad@andreas-diem.at         | xxx | Andreas Diem | 5001 | 5001 | /home/ad/ | /var/postfix/virtual/andreas-diem.at/ad/         |       | Y       |
|  2 | postmaster | postmaster@andreas-diem.at | xxx | Andreas Diem | 5002 | 5002 | /         | /var/postfix/virtual/andreas-diem.at/postmaster/ |       | Y       |
|  3 | webmaster  | webmaster@andreas-diem.at  | xxx | Andreas Diem | 5003 | 5003 | /         | /var/postfix/virtual/andreas-diem.at/webmaster/  |       | Y       |
+----+------------+----------------------------+-------+--------------+------+------+-----------+--------------------------------------------------+-------+---------+
mfg
Andreas Diem
webmaster@andreas-diem.at

Benutzeravatar
feltel
Webmaster
Beiträge: 10368
Registriert: 20.12.2001 13:08:23
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: Leipzig, Germany
Kontaktdaten:

Beitrag von feltel » 27.09.2002 17:00:08

Da hast Du vielleicht was überlesen. Aus dem was in homedir und maildir steht bastelt sich Postfix den Speicherort der Mails. Und da es nen Pfad "/home/ad/ /var/postfix/virtual/andreas-diem.at/ad/" sicherlich nicht gibt versucht Postfix das anders zuzustellen. Ich hab bei mir in dieser Tabelle z.B. ff. stehen:

homedir: /var/mail
maildir: rahn-schulen.de/feltel/

Weiterhin müssen diese Verzeichnisse den UIDs/GIDs gehören, die Du in der Tabelle drinstehen hast.

Andreas Diem
Beiträge: 23
Registriert: 18.09.2002 18:29:02
Wohnort: Neubau
Kontaktdaten:

Beitrag von Andreas Diem » 27.09.2002 17:31:06

Hab nun
Homedir: /var/postfix/virtual
Maildir: andreas-diem.at/ad/
eingestellt, leider kein Erfolg.

Code: Alles auswählen

Die Benutzerrecht solten reichtig sein. 
drwxrwxr-x    5 postfix  postfix      4096 Sep 26 22:57 postfix
drwxrwxr-x    5 postfix  postfix      4096 Sep 26 22:57 virtual
drwxrwxr-x    5 postfix  postfix      4096 Sep 26 22:57 andreas-diem.at

drwxrwx---    3 5001     5001         4096 Sep 26 17:32 ad
drwxrwx---    3 5002     5002         4096 Sep 26 17:32 postmaster
drwxrwx---    5 5003     5003         4096 Sep 26 22:57 webmaster
mfg
Andreas Diem
webmaster@andreas-diem.at

Andreas Diem
Beiträge: 23
Registriert: 18.09.2002 18:29:02
Wohnort: Neubau
Kontaktdaten:

Beitrag von Andreas Diem » 27.09.2002 17:38:53

Vielicht helfen die logfile einträge

Code: Alles auswählen

Sep 27 17:33:43 debian postfix/smtpd[667]: connect from at07i01-dial-007.nextranet.at[195.170.76.7]
Sep 27 17:33:43 debian postfix/smtpd[667]: E55F9236E91: client=at07i01-dial-007.nextranet.at[195.170.76.7]
Sep 27 17:33:46 debian postfix/smtpd[667]: warning: restriction `permit' after `check_relay_domains' is ignored
Sep 27 17:33:49 debian postfix/smtpd[667]: 86B21236E91: client=at07i01-dial-007.nextranet.at[195.170.76.7]
Sep 27 17:33:50 debian postfix/smtpd[667]: warning: restriction `permit' after `check_relay_domains' is ignored
Sep 27 17:33:50 debian postfix/cleanup[668]: 86B21236E91: message-id=<20020927153349.86B21236E91@andreas-diem.at>
Sep 27 17:33:50 debian postfix/qmgr[664]: 86B21236E91: from=<diem@nextra.at>, size=458, nrcpt=1 (queue active)
Sep 27 17:33:50 debian postfix/smtpd[680]: connect from localhost[127.0.0.1]
Sep 27 17:33:50 debian postfix/smtpd[680]: E358D236E92: client=localhost[127.0.0.1]
Sep 27 17:33:50 debian postfix/cleanup[668]: E358D236E92: message-id=<20020927153349.86B21236E91@andreas-diem.at>
Sep 27 17:33:50 debian postfix/qmgr[664]: E358D236E92: from=<diem@nextra.at>, size=678, nrcpt=1 (queue active)
Sep 27 17:33:50 debian postfix/pipe[675]: 86B21236E91: to=<ad@andreas-diem.at>, relay=amavis, delay=1, status=sent (andreas-diem.at)
Sep 27 17:33:50 debian postfix/smtpd[680]: disconnect from localhost[127.0.0.1]
Sep 27 17:33:50 debian postfix/local[684]: E358D236E92: to=<ad@andreas-diem.at>, relay=local, delay=0, status=sent (maildir)
Sep 27 17:33:51 debian postfix/smtpd[667]: disconnect from at07i01-dial-007.nextranet.at[195.170.76.7]
Sep 27 17:35:42 debian postfix/smtpd[690]: connect from at07i01-dial-007.nextranet.at[195.170.76.7]
Sep 27 17:35:42 debian postfix/smtpd[690]: 90216236E91: client=at07i01-dial-007.nextranet.at[195.170.76.7]
Sep 27 17:35:43 debian postfix/smtpd[690]: warning: restriction `permit' after `check_relay_domains' is ignored
Sep 27 17:35:45 debian postfix/smtpd[690]: E3856236E91: client=at07i01-dial-007.nextranet.at[195.170.76.7]
Sep 27 17:35:46 debian postfix/smtpd[690]: warning: restriction `permit' after `check_relay_domains' is ignored
Sep 27 17:35:46 debian postfix/cleanup[691]: E3856236E91: message-id=<20020927153545.E3856236E91@andreas-diem.at>
Sep 27 17:35:46 debian postfix/qmgr[664]: E3856236E91: from=<diem@nextra.at>, size=474, nrcpt=1 (queue active)
Sep 27 17:35:46 debian postfix/smtpd[701]: connect from localhost[127.0.0.1]
Sep 27 17:35:46 debian postfix/smtpd[701]: F34D7236E92: client=localhost[127.0.0.1]
Sep 27 17:35:47 debian postfix/cleanup[691]: F34D7236E92: message-id=<20020927153545.E3856236E91@andreas-diem.at>
Sep 27 17:35:47 debian postfix/pipe[696]: E3856236E91: to=<postmaster@andreas-diem.at>, relay=amavis, delay=2, status=sent (andreas-diem.at)
Sep 27 17:35:47 debian postfix/smtpd[701]: disconnect from localhost[127.0.0.1]
Sep 27 17:35:47 debian postfix/qmgr[664]: F34D7236E92: from=<diem@nextra.at>, size=702, nrcpt=1 (queue active)
Sep 27 17:35:47 debian postfix/local[705]: warning: required alias not found: postmaster
Sep 27 17:35:47 debian postfix/local[705]: F34D7236E92: to=<postmaster@andreas-diem.at>, relay=local, delay=1, status=sent (discarded)
Sep 27 17:35:47 debian postfix/smtpd[690]: disconnect from at07i01-dial-007.nextranet.at[195.170.76.7]
mfg
Andreas Diem
webmaster@andreas-diem.at

Andreas Diem
Beiträge: 23
Registriert: 18.09.2002 18:29:02
Wohnort: Neubau
Kontaktdaten:

Beitrag von Andreas Diem » 27.09.2002 19:58:53

:D Habs gefunden.

Es hat ein Eintrag in der main.cf gefählt

Code: Alles auswählen

local_transport = virtual
mfg
Andreas Diem
webmaster@andreas-diem.at

Benutzeravatar
feltel
Webmaster
Beiträge: 10368
Registriert: 20.12.2001 13:08:23
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: Leipzig, Germany
Kontaktdaten:

Beitrag von feltel » 28.09.2002 14:27:20

Jetzt wo du es sagst, fällts mir auch auf. 8O

Antworten