Amahi f14 Outgoing mail via Gmail wiki problems

lackskill
Posts: 2
Joined: Thu Oct 27, 2011 1:18 pm

Amahi f14 Outgoing mail via Gmail wiki problems

Postby lackskill » 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:

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​
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:

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"
When I would run:

Code: Select all

postmap hash:/etc/postfix/sasl_passwd
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:

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
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:

Code: Select all

chown postfix /etc/postfix
And that allowed the postmap hash command to run.

After that everything worked and I was able to send mail properly.

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Amahi f14 Outgoing mail via Gmail wiki problems

Postby bigfoot65 » Thu Oct 27, 2011 4:28 pm

Thanks for the update. I have made the changes in the wiki. The chown postfix /etc/postifx command should have not been necessary. I am curious as to why it was needed.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

lackskill
Posts: 2
Joined: Thu Oct 27, 2011 1:18 pm

Re: Amahi f14 Outgoing mail via Gmail wiki problems

Postby lackskill » Thu Oct 27, 2011 4:39 pm

Thanks for the update. I have made the changes in the wiki. The chown postfix /etc/postifx command should have not been necessary. I am curious as to why it was needed.
Glad to help. :)

I don't have anything resembling an explanation for the chown postfix problem. It was owned by root and I was logged in as root so I'm not sure why it wouldn't otherwise execute. I wouldn't even know where to dig to find out why, but I'm happy to with some direction, if it's even possible.

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Amahi f14 Outgoing mail via Gmail wiki problems

Postby bigfoot65 » Thu Oct 27, 2011 4:44 pm

I just tested the wiki and it works as documented, so not sure why you needed the extra step. Note that copying things from the wiki sometimes does yield hidden characters and that could have caused a step to not execute correctly. I pasted in Notepad first to make sure there was nothing hidden, then the terminal window.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

Who is online

Users browsing this forum: No registered users and 29 guests