Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Feb 06, 2010 1:39 pm 
Offline
Senior Newbie

Joined: Sat Feb 06, 2010 1:33 pm
Posts: 9
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?


Top
   
 Post subject:
PostPosted: Sat Feb 06, 2010 8:46 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
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).


Top
   
 Post subject:
PostPosted: Sun Feb 07, 2010 4:08 pm 
Offline
Senior Newbie

Joined: Sat Feb 06, 2010 1:33 pm
Posts: 9
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 :(


Top
   
 Post subject:
PostPosted: Sun Feb 07, 2010 5:33 pm 
Offline
Senior Newbie

Joined: Sat Feb 06, 2010 1:33 pm
Posts: 9
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..


Top
   
 Post subject:
PostPosted: Sun Feb 07, 2010 10:39 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Great, glad you got it working!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group