| Linode Forum https://forum.linode.com/ |
|
| Postfix as secondary mail server (relay issue..) https://forum.linode.com/viewtopic.php?f=11&t=5161 |
Page 1 of 1 |
| Author: | techman [ Sat Feb 06, 2010 1:39 pm ] |
| Post subject: | Postfix as secondary mail server (relay issue..) |
Alright, so I've got postfix + courier working as a primary server (using MySQL to handle the virtual domains and users).. I followed the (amazing) guide in the linode library.. But now, I've setup my domain to work with google apps, and so I've configured the relay_host option in postfix to "forward" all mail to google. Problem is that gmail wants authentication: Quote: postfix/smtp[27974]: 9628ACA5B: to=<andrew@domain.com>, relay=smtp.gmail.com[74.125.113.109]:25, delay=0.18, delays=0.01/0.01/0.12/0.04, dsn=5.7.0, status=bounced (host smtp.gmail.com[74.125.113.109] said: 530 5.7.0 Must issue a STARTTLS command first. 21sm2893506vws.9 (in reply to MAIL FROM command))
everything online points that I need to enable "smtp_sasl_password_maps", except all the examples use the hash files (a simple plain text document...). I'd rather continue using MySQL for this... Just setting it to the: "smtp_sasl_password_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf" didn't seem to work soooo any ideas? |
|
| Author: | Vance [ Sat Feb 06, 2010 8:46 pm ] |
| Post subject: | |
I'd suggest trying the plain-text approach with "smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd" first. If that works, you know client SASL is functional. Then it's just a matter of figuring out the right way of getting Postfix to pull the credentials from MySQL correctly (sorry, don't know anything about that). |
|
| Author: | techman [ Sun Feb 07, 2010 4:08 pm ] |
| Post subject: | |
Vance wrote: I'd suggest trying the plain-text approach with "smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd" first. If that works, you know client SASL is functional. Then it's just a matter of figuring out the right way of getting Postfix to pull the credentials from MySQL correctly (sorry, don't know anything about that).
well you were right about that.. it didn't work with the plain text approach... BUT i did manage to fix it after awhile... but still nothing on getting it into a MySQL database |
|
| Author: | techman [ Sun Feb 07, 2010 5:33 pm ] |
| Post subject: | |
alright, I figured it out... so for the benefit of others: ASSUMING everything works with sasl_password as plain_text (or using the hash approach)... ie. "smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd". Also, I'm assuming you've setup MySQL and saslauthd for use with postfix (see the email guide in linode library) For MySQL: in main.cf: Quote: smtp_sasl_password_maps = mysql:/etc/postfix/mysql-sasl_passwd.cf mysql-sasl_passwd.cf: Quote: user = mail_admin
password = mysql_password_for_mail_admin dbname = mail query = SELECT CONCAT(user,':',AES_DECRYPT(pass,'encryption_key')) FROM sasl_passwd WHERE relay_host = '%s'; hosts = 127.0.0.1 I used AES_ENCRYPT/AES_DECRYPT in order to have SOME level of encryption on the passwords.. I plan on writing a more detailed version on my mini blog in the next few days.. but hopefully others who have the same problem may find this useful.. |
|
| Author: | Vance [ Sun Feb 07, 2010 10:39 pm ] |
| Post subject: | |
Great, glad you got it working! |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|