Postfix with Mysql virtual users

10 posts / 0 new
Last post
#1 Tue, 10/16/2007 - 01:13
Bluenox

Postfix with Mysql virtual users

Hi,

I would like to have the following configuration: postfix with mysql user authentication and mail configuration (users, aliases, quota,...) stored in Mysql.

I installed virtualmin on Ubuntu 7.04. Postfix and mysql are running. But I'm not sure I can enable the mysql user auth. without breaking the virtualmin add mail user function. I only found this post about the same problem: http://www.virtualmin.com/forums/developers/postfix--mysql-user-auth.html

Anyway, I would like to be sure that the users of the hosted domains will not experience changes, especially about the login used: "user@domain.com".

I entend to follow these howtos: http://flurdy.com/docs/postfix/ and http://www.howtoforge.com/virtual_postfix_mysql_quota_courier_ubuntu_edg... But will it break the virtualmin mail management system ?

I guess there's is no problem to achieve the postfix/mysql configuration. And the authentification will run without problem. But will I be able to add users throught the virtualmin server administration ? On the other hand, If it's not safe to use postfix/mysql with virtualmin, what should I configure to get the "user@domain.com" as pop3 login?

Thanks for your help. Eric

Tue, 10/16/2007 - 09:19
twm

I am looking for an answer to this as well. I followed the same tutorials and would like to use mysql for my postfix configs...

Tue, 10/16/2007 - 13:36
Bluenox

Hi,

thanks for your followup.
So, if I configure postfix to use mysql authentication and storage, it works but not with virtualmin.

This is quite useless if I have to handle all the mail administration away from the virtual server configuration...
Is there any other way to work with virtualmin templates and still have user@domain.com authentication with mysql storage ?

Tue, 10/16/2007 - 14:18 (Reply to #3)
Joe
Joe's picture

Sorry guys, we don't support users stored in MySQL. We just don't think it's a very good idea at this time, frankly.

If you must use database-backed users, LDAP does work well and has good tools support, and reasonable performance (no database type of user is as fast as local user storage in passwd/shadow, except on a very large scale--like several thousand users). While MySQL tools support is improving, it's still got a long way to go before it is as comprehensive or mature as the tools for LDAP (and local users). Standardization is also nearly non-existent at this stage and everyone implements things a little differently...so there need to be tons of configurable options...all of those are options that you can get wrong, and make your life harder.

What are you trying to accomplish that makes MySQL a better choice than local users or LDAP users? If it's just to get @ in usernames, PLEASE stop right now! The problem of @ in usernames is completely orthogonal to where you store your users--they are in no way related.

Virtualmin fully supports user@domain.com usernames with Postfix. You just have to turn it on in the Server Template(s) ("Mail for domain section", option is labeled "Format for usernames that include domain") and set the Module Configuration in the "Defaults for new domains" section option labeled "Include domain name in usernames?" to "Always" and the "Domain name style in username" to "Full domain name".

Please don't make your system vastly more complex, slower, more resource intensive, and harder to maintain, just so you can say the users are in MySQL! ;-)

--

Check out the forum guidelines!

Wed, 10/17/2007 - 00:28
Bluenox

Hi Joe,

Thanks for the reply. And I totally get your point.
There is absolutely no obligation to use Mysql, but my previous system was like that (anyway I'm open to change, and why not LDAP).

So I will update the template server to stick with the "user@domain.com" schema and everything will be fine.

Fri, 10/19/2007 - 18:54
joeles

Joe, I too am moving over a lot of existing users and would prefer to maintain user@domain.com format for email usernames if possible. I followed the instructions above and everything works for checking mail, but I'm only able to send mail by using the user-domain.com version of the username. Is this expected behavior or am I missing some configuration somewhere?

Sat, 10/20/2007 - 15:02 (Reply to #6)
Joe
Joe's picture

Howdy joeles,

saslauthd is fighting you. It doesn't like user@domain.tld usernames either, but you can force it to allow them by adding -r to the configuration for it. How you do that depends on your OS. On Red Hat based systems, it's the "FLAGS" field in /etc/sysconfig/saslauthd. On Debian and Ubuntu it's in /etc/defaults/saslauthd, but it's either OPTIONS or PARAMS (yeah, they can't seem to make up their mind on Debian/Ubuntu).

--

Check out the forum guidelines!

Sat, 10/20/2007 - 18:53 (Reply to #7)
joeles

Thanks, Joe. That did the trick.

Thu, 11/01/2007 - 08:24
deg

Hi,

I found this thread and managed to install my email perfectly because of it, thanks!

I have one probably silly question left however, is it possible to change already existing pop3 logins? I have quite a few people with logins like <name.domain> or even just <name> from earlier trials *coughs* and i want to change them all to <name@domain.tld> Is this possible without deleting them?

cheers,
Deg

Tue, 11/06/2007 - 06:45
deg

Nobody who can help me with this?

Topic locked