How to setup mysql and saslauthd with postfix (CentOS 5.3)
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to setup mysql and saslauthd with postfix (CentOS 5.3)
I've been trying to setup a mail server which uses Postfix and authenticates against a mysql database. I've had no luck, and was wondering if anyone knows of a recent tutorial which could help me.
I think the main area that I am having troubles with is installing postfix/saslauthd since none of the tutorials cover that, and I do everything else right. I followed http://www.howtoforge.com/virtual-us...ysql-centos5.1 and I could telnet localhost smtp and ehlo localhost gave me expected output, but I just couldn't authenticate.
-Brandon
Last edited by Guardian-Mage; 04-20-2009 at 05:49 AM.
I just did it without encrypted mysql passwords and it works now.
But I'll try what you suggested too
That is highly insecure, i suspect you have the wrong value set for crypt= that is why the failure occurs. Tune that value to the type of encryption you are using for the password field.
These are the options
Code:
crypt (plain)
The method to encrypt the user's password:
0 (or "plain") = No encryption. Passwords stored in plaintext.
HIGHLY DISCOURAGED.
1 (or "Y") = Use crypt(3) function.
2 (or "mysql") = Use MySQL PASSWORD() function. It is possible
that the encryption function used by PAM-MySQL
is different from that of the MySQL server, as
PAM-MySQL uses the function defined in MySQL's
C-client API instead of using PASSWORD() SQL function
in the query.
3 (or "md5") = Use plain hex MD5.
4 (or "sha1") = Use plain hex SHA1.
Ok, I did what you said and it works now. However, my format was the username is user@domain.tld and it didn't work. When i changed it to user it works. How can I add the domain to the username?
I tried that with this situation but had no luck. Any ideas?
(I'm still waiting for the email to go through, not sure if it will work)
Also, exert from my mail logs
Code:
Apr 20 15:16:41 cl-t112-271cl postfix/trivial-rewrite[9875]: warning: do not list domain sabotix.com in BOTH mydestination and virtual_mailbox_domains
mysql-virtual_domains.cf
Code:
user = mysql_user
password = mysql_pass
dbname = mail
query = SELECT domain AS virtual FROM domains WHERE domain='%s'
hosts = 127.0.0.1
mysql-virtual_mailboxes.cf
Code:
user = mail_admin
password = 36upuYacHuCUw57e9Ewazej5
dbname = mail
query = SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email='%s'
hosts = 127.0.0.1
Just received my emails 10 minutes after they were sent. Anyway I can make it faster?
Last edited by Guardian-Mage; 04-20-2009 at 03:22 PM.
I want all my users to be virtual users, and you just said I can't have a virtual domain the same as my local destination. Does that mean I can have the user user@sabotix.com virtual, but just remove the virtual domain listing for it?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.