Postfix as secondary mail server (relay issue..)
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:
> postfix/smtp[27974]: 9628ACA5B: to=<
everything online points that I need to enable "smtpsaslpassword_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: "smtpsaslpasswordmaps = proxy:mysql:/etc/postfix/mysql-virtualmailboxes.cf" didn't seem to work
soooo any ideas?
4 Replies
plain-text approach
@Vance:
I'd suggest trying the
with "smtpsaslpasswordmaps = hash:/etc/postfix/saslpasswd" 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). plain-text approach
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
ASSUMING everything works with saslpassword as plaintext (or using the hash approach)… ie. "smtpsaslpasswordmaps = hash:/etc/postfix/saslpasswd". 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:
> smtpsaslpasswordmaps = mysql:/etc/postfix/mysql-saslpasswd.cf
mysql-saslpasswd.cf:
> user = mail
admin
password = mysqlpasswordformailadmin
dbname = mail
query = SELECT CONCAT(user,':',AESDECRYPT(pass,'encryptionkey')) FROM saslpasswd WHERE relayhost = '%s';
hosts = 127.0.0.1
I used AESENCRYPT/AESDECRYPT 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..