[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Postfix+mysql delivery problem.



I've come to my end, after a few days of bashing around with postfix, I
come to the conclusion that what I want to do can't really be done.

Heres the senario.


I have a database, which stores only 'username' in mysql, which I would
like postfix to query for, if it exists then deliver to
/home/$user/Maildir.

Now this is fine if theres a system user as well (delivery method local:).
As soon as I change it to virtual:, it requires the full email address in
mysql, and I can't change it.

The domain part is irrelivent, as user@domain1.com and user@domain2.com
are the same anyway, I basically just want postfix to store the 'system'
users in mysql.

The relivant parts of my config are as follows;

[-snip-]

setgid_group = postdrop

require_home_directory = no

myhostname = dreams.isx.com.au
mydestination = $myhostname, localhost.isx.com.au, isx.com.au
home_mailbox = Maildir/

alias_maps = mysql:/etc/postfix/mysql-aliases.cf

transport_maps = mysql:/etc/postfix/transport.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_uid_maps = static:1000
virtual_gid_maps = static:1000
virtual_mailbox_base = /home
virtual_mailbox_limit = 33554432

local_recipient_maps  = $alias_maps $virtual_mailbox_maps
unix:passwd.byname
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
virtual_maps = hash:/etc/postfix/virtual

mynetworks = 127.0.0.1/8, hash:/var/lib/pop-before-smtp/hosts

content_filter = smtp-amavis:[127.0.0.1]:10024

smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/access_recipient, check_sender_access hash:/etc/postfix/access, permit_mynetworks, reject_unauth_destination, reject_invalid_hostname, reject_unknown_recipient_domain, reject_unauth_pipelining, reject_non_fqdn_sender, reject_unknown_sender_domain, reject_non_fqdn_recipient, reject_unknown_recipient_domain

[-/snip-]

and from mysql,

mysql> select * from transport;
+-------------------+-----------+
| domain            | transport |
+-------------------+-----------+
| dreams.isx.com.au | virtual:  | <-- changing to local works 99% how I'd
				  like it, but still requires a
				  /etc/passwd user

And this is my user line, (when set to local:), which works great.

5558 Query       select "Maildir/" from user_info where username = 'brad'

Does anybody have any ideas on what I could have done wrong?


I really can't modify the database at all to change to a username@domain
format, and theres more than 1 domain that users have access to, so this
really doesn't suit anyway.

Any help would be really appreciated.

Regards,

------------------------------------
Brad Lay (brad.lay@staff.isx.com.au)
System Administrator

P) +61 7 3855 2233
H) http://www.isx.com.au
------------------------------------



Reply to: