Postfix möchte Systemuser - Ich aber MySQL - Wie?

Postfix, QMail, Sendmail, Dovecot, Cyrus, Courier, Anti-Spam
epms
Posts: 3
Joined: 2008-04-30 09:26
 

Postfix möchte Systemuser - Ich aber MySQL - Wie?

Post by epms »

Hallo Zusammen,
ich habe ein Problem mit Postfix. Mein Postfix sucht die User immer nur im System, es müssen also Systemuser sein.
Ich möchte meine User aber über eine MySQL Tabelle verwalten. Wie sage ich das Postfix? Mir geht es jetzt erstmal nur für den Empfang von Mails. (Das versenden kommt danach)

In welcher Datei muss ich Postfix das sagen?

Wenn ich den User im System anlege kann die Mail zugestellt werden. Wenn ich den User nicht im System habe steht im log folgendes:

Code: Select all

Apr 29 13:51:03 openSUSE-103-64-LAMP postfix/local[30542]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Apr 29 13:51:04 openSUSE-103-64-LAMP postfix/local[30542]: 8C3772534019: to=<michael@domain.de>, relay=local, delay=0.71, delays=0.61/0.02/0/0.07, dsn=5.1.1, status=bounced (unknown user: "michael")
In meiner main.cf habe ich folgendes stehen

Code: Select all

 virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:1001
#hier geben wir das Verzeichnis an in dem wir die emails ablegen wollen
virtual_mailbox_base = /srv/email
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 512000000
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 1001
virtual_transport = virtual
virtual_uid_maps = static:1001
In der mysql_virtual_alias_maps.cf steht folgendes

Code: Select all

user = postfix
password = EPMS1FCKLpostfix
#hosts = 127.0.0.1
hosts = localhost
dbname = postfix
#table = mailbox
#select_field = maildir
#where_field = username
query = SELECT maildir FROM mailbox WHERE username='%s' AND active = 1
Momentan weiss ich nicht weiter. Wo könnte mein Fehler liegen?
Für Hilfe, danke im voraus.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11185
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix möchte Systemuser - Ich aber MySQL - Wie?

Post by Joe User »

PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
epms
Posts: 3
Joined: 2008-04-30 09:26
 

Re: Postfix möchte Systemuser - Ich aber MySQL - Wie?

Post by epms »

Danke für die Links. Ich habe jetzt in alias_maps folgendes eingetragen

Code: Select all

alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
Leider funktioniert das noch immer nicht
Wenn ich dem User jetzt eine Mail schicke kommen folgende Meldungen im Log

Code: Select all

Apr 30 13:44:56 openSUSE-103-64-LAMP postfix/smtpd[792]: connect from wa-out-1112.google.com[209.85.146.178]
Apr 30 13:44:56 openSUSE-103-64-LAMP postfix/trivial-rewrite[795]: warning: do not list domain epmsmail.de in BOTH mydestination and virtual_mailbox_domains
Apr 30 13:44:56 openSUSE-103-64-LAMP postfix/smtpd[792]: CA18D2534019: client=wa-out-1112.google.com[209.85.146.178]
Apr 30 13:44:57 openSUSE-103-64-LAMP postfix/cleanup[799]: CA18D2534019: message-id=<7ffce1ba0804300444l5334c718r22eb65d787227aff@mail.gmail.com>
Apr 30 13:44:57 openSUSE-103-64-LAMP postfix/qmgr[684]: CA18D2534019: from=<email@gmail.com>, size=1748, nrcpt=1 (queue active)
Apr 30 13:44:57 openSUSE-103-64-LAMP postfix/trivial-rewrite[795]: warning: do not list domain domain.de in BOTH mydestination and virtual_mailbox_domains
Apr 30 13:44:57 openSUSE-103-64-LAMP postfix/local[801]: CA18D2534019: to=<michael@domain.de>, relay=local, delay=0.71, delays=0.6/0.02/0/0.09, dsn=5.1.1, status=bounced (unknown user: "michael")
Apr 30 13:44:57 openSUSE-103-64-LAMP postfix/cleanup[799]: 50DA8253401C: message-id=<20080430114457.50DA8253401C@openSUSE-103-64-LAMP.your-server.de>
Apr 30 13:44:57 openSUSE-103-64-LAMP postfix/bounce[803]: CA18D2534019: sender non-delivery notification: 50DA8253401C
Apr 30 13:44:57 openSUSE-103-64-LAMP postfix/qmgr[684]: 50DA8253401C: from=<>, size=3673, nrcpt=1 (queue active)
Apr 30 13:44:57 openSUSE-103-64-LAMP postfix/qmgr[684]: CA18D2534019: removed
Apr 30 13:44:58 openSUSE-103-64-LAMP postfix/smtp[805]: 50DA8253401C: to=<email@gmail.com>, relay=gmail-smtp-in.l.google.com[72.14.221.27]:25, delay=1.4, delays=0.05/0.02/0.04/1.3, dsn=2.0.0, status=sent (250 2.0.0 OK 1209555898 l19si353299fgb.9)
Apr 30 13:44:58 openSUSE-103-64-LAMP postfix/qmgr[684]: 50DA8253401C: removed
Apr 30 13:45:27 openSUSE-103-64-LAMP postfix/smtpd[792]: disconnect from wa-out-1112.google.com[209.85.146.178]
Das tolle ist, dass es schonmal funktioniert hat. Damals hat der Versand von Mails nicht geklappt. Durch mein rumstellen funktioniert der Empfang jetzt leider auch nicht mehr.... verzweifle langsam... :(
User avatar
Joe User
Project Manager
Project Manager
Posts: 11185
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix möchte Systemuser - Ich aber MySQL - Wie?

Post by Joe User »

Code: Select all

(unknown user: "michael")
Deine Usertabelle enthält den User nicht...
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
epms
Posts: 3
Joined: 2008-04-30 09:26
 

Re: Postfix möchte Systemuser - Ich aber MySQL - Wie?

Post by epms »

Ich habe jetzt nochmal alles runtergeschmissen und neu installiert. Nun funktioniert der Empfang von Nachrichten mit Usern aus der MySQL Tabelle. Allerdings der Versand noch nicht. Das aber ein neues Thema.