Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
postfix, mysql and local maps
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
salam
Apprentice
Apprentice


Joined: 29 Sep 2005
Posts: 227

PostPosted: Tue Sep 25, 2007 5:18 pm    Post subject: postfix, mysql and local maps Reply with quote

Hello,

Any idea how to force postfix to read user information for local recipients from mysql and not use unix:passwd.byname?
For virtual domains, all works ok, but local always tries to read from passwd file and completely ignores mysql.

Example:
user Bob has e-mail bob.smith@domain.com (domain.com is a local one)
he also has shell access, indentified only as "Bob" in passwd file
as postfix reads local users from passwd, i get a result "unknown user", though 'users' table in mysql contains email bob.smith@domain.com, homedir /home/bob maildir /home/bob/.maildir

Does exist something, that will disallow postfix to look into passwd file and correctly select from mysql?

One solution is to add bob.smith bob@domain.com to alias table, but this will also replace "To:" header in mail, so i don't like it very much
Back to top
View user's profile Send private message
Stever
Apprentice
Apprentice


Joined: 01 Mar 2005
Posts: 151
Location: North Carolina

PostPosted: Tue Sep 25, 2007 5:54 pm    Post subject: Reply with quote

http://www.postfix.org/postconf.5.html#local_recipient_maps
Back to top
View user's profile Send private message
Stever
Apprentice
Apprentice


Joined: 01 Mar 2005
Posts: 151
Location: North Carolina

PostPosted: Tue Sep 25, 2007 6:04 pm    Post subject: Reply with quote

Sorry, posted the wrong link. This is probably what you are looking for:

http://www.postfix.org/LOCAL_RECIPIENT_README.html

Quote:
Problem: you don't use the default Postfix local(8) delivery agent for domains matching $mydestination, $inet_interfaces, or $proxy_interfaces. For example, you redefined the "local_transport" setting in main.cf.

Solution: your local_recipient_maps setting needs to specify a database that lists all the known user names or addresses for that delivery agent. For example, if you deliver users in $mydestination etc. domains via the virtual(8) delivery agent, specify:

/etc/postfix/main.cf
mydestination = $myhostname localhost.$mydomain localhost ...
local_transport = virtual
local_recipient_maps = $virtual_mailbox_maps

Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Tue Sep 25, 2007 10:37 pm    Post subject: Reply with quote

Isn't the easiest solution to to change your local domain to virtual. Generally I set host.domain.com to mydestination and myorigin because those must be local IIRC. Then you can assign domain.com to be virtual without making Postfix act funny.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum