Amahi f14 Outgoing mail via Gmail wiki problems
Posted: Thu Oct 27, 2011 1:38 pm
I wasn't sure where to put this so I hope someone can put this where it needs to be, if necessary.
I apologize in advance. I'm still a bit of a noob, especially with things like postfix and ssl.
I've spent my day so far following the directions on the Outgoing mail via gmail wiki and I ran into a couple snags that I was eventually able to work around. I'm hoping this will save someone else some trouble... Everything below was run as root.
First, at the following step:
for some reason copying the text and pasting into nano had what I assume to be some sort of invalid hidden character as I kept getting a variation of the error:
When I would run:
Initially all of the pasted text would show up in the error, but then I started looking at the file's syntax and noticed that there weren't spaces before the config entries, except in the pasted text, so I deleted all of the leading spaces and put spaces between the config parameter and '=' where there weren't. Doing this got me to the truncated error above. Eventually I completely retyped all of the config manually. Here is my version if anyone is interested:
This once again changed the error to a permissions related error (sorry didn't get it copied), and I found mention of needing to chown postfix the "config" directory here in the comments. So I ran:
And that allowed the postmap hash command to run.
After that everything worked and I was able to send mail properly.
I apologize in advance. I'm still a bit of a noob, especially with things like postfix and ssl.
I've spent my day so far following the directions on the Outgoing mail via gmail wiki and I ran into a couple snags that I was eventually able to work around. I'm hoping this will save someone else some trouble... Everything below was run as root.
First, at the following step:
Code: Select all
Add the following to the bottom of the file /etc/postfix/main.cf. You do not need to change anything else in it, as the last setting for any option is the one that is saved.
Text
#### Gmail SSL SMTP Relay
relayhost = [smtp.gmail.com]:587
#auth
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
#tls
smtp_use_tls = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_note_starttls_offer = yes
tls_random_source = dev:/dev/urandom
smtp_tls_scert_verifydepth = 5
smtp_tls_key_file=/etc/pki/tls/gmail_relay/server.key
smtp_tls_cert_file=/etc/pki/tls/gmail_relay/server.pem
smtpd_tls_ask_ccert = yes
smtpd_tls_req_ccert =no
smtp_tls_enforce_peername = no
Code: Select all
[root@amahi-server etc]# postmap hash:/etc/postfix/sasl_passwd
postmap: fatal: /etc/postfix/main.cf, line 679: missing '=' after attribute name: "??????# Gmail SSL SMTP Relay"
Code: Select all
postmap hash:/etc/postfix/sasl_passwd
Code: Select all
#### Gmail SSL SMTP Relay
relayhost = [smtp.gmail.com]:587
#auth
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
#tls
smtp_use_tls = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_note_starttls_offer = yes
tls_random_source = dev:/dev/urandom
smtp_tls_scert_verifydepth = 5
smtp_tls_key_file=/etc/pki/tls/gmail_relay/server.key
smtp_tls_cert_file=/etc/pki/tls/gmail_relay/server.pem
smtpd_tls_ask_ccert = yes
smtpd_tls_req_ccert = no
smtpd_tls_enforce_peername = no
Code: Select all
chown postfix /etc/postfix
After that everything worked and I was able to send mail properly.