Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: google app email
PostPosted: Fri Jul 10, 2015 12:32 am 
Offline
Newbie

Joined: Thu Jul 09, 2015 11:49 pm
Posts: 3
I am not expert, but I have set up web servers. I have not set up an email server. Linode documentation and experience made it straight forward to set up a web server in CentOS 7. I am using Concrete5 for my CMS and decided to try google business apps. So, I registered my business email address with Google. During registration, I gave Google access to my godaddy account and they edited my MX entries.

In my server /etc/postfix/main.cf, I added relayhost = smtp-relay.gmail.com:25 and ran systemctl start postfix.service.

Back in admin.google.com/ Apps>Google Apps>Settings for Gmail > Advanced settings, I added both my IP4 and IP6 server addresses to the SMTP relay service setting.

It worked fine when I sent test emails through Concrete5, but not for email notifications when a form was filled and submitted. The log said that the email failed due to my IP not being registered with my Google apps account.

I tried many things. It turns out that the problem was the sender. The working test emails were sent with a concrete5-noreply sender, while the failing form notifications were sent with the web site admin email. I changed the web site admin email to match the Google app registration address, and it has worked.

It is not ideal to have my site admin email be the same as the google app registration, particularly as I add more domains. However, it gives me time to figure out how to edit my server configuration to work with my personal email. And, over the next year I can also learn more about setting up a free email server with decent spam filtering.

Any suggestions about editing my configuration are welcome.

The lesson I want to pass on is that if you use Google apps for email, it seems that you need to have your web site admin email address match the account registered with Google, at least if you want your web site to send any email notifications.


Top
   
 Post subject: Re: google app email
PostPosted: Fri Jul 10, 2015 3:55 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Just because you use Gmail for receiving mail doesn't mean you need to use it for sending mail. You could remove the relayhost configuration setting and just have Postfix directly deliver mail to its destination. You would want to set inet_interfaces = loopback-only so that Postfix would not accept mail from outside.

If you have reasons for relaying through Gmail, It's possible that's just the way it works, using your source IP address and forcing the From e-mail address to match the one you have registered. Have you set your smtp_sasl_password_maps in Postfix to use your username and password when sending mail? That might (or might not) change Gmail's behavior. (I don't use Google e-mail so this is mostly guesswork.)


Top
   
 Post subject: Re: google app email
PostPosted: Fri Jul 10, 2015 7:02 pm 
Offline
Newbie

Joined: Thu Jul 09, 2015 11:49 pm
Posts: 3
Sending mail is the biggest reason why I am using google apps. I can use one of several accounts to receive email.

The only steps I took to set up sending email from my web server are outlined above.

Thank you kindly Vance for providing a couple of suggestions that will save hours of searching and possibly a year of subscription fees. Sending out limited emails and not receiving any on a web server seems much simpler than configuring an incoming email server. I have to travel later this month and google is working. If I get chance to try Postfix alone, I will let you all know.


Top
   
 Post subject: Re: google app email
PostPosted: Sat Jul 11, 2015 1:51 pm 
Offline
Newbie

Joined: Thu Jul 09, 2015 11:49 pm
Posts: 3
By commenting out relayhost and making inet_interfaces = loopback_only, I was able to make a send only server that works with my web pages. If I was smart enough to think of it earlier, I might have avoided signing up for google apps.

Now I have the choice of continuing to use google or doing this on my own. There are advantages and disadvantages either way.

I did not try setting smtp_sasl_password_maps. I'm not sure about sending a password for an sender account that is not registered with the apps. It might work to register the web site administrator and sender with the app account at google. Either that or I can have one administrator email for sender and admin for all of my sites and route emails to separate folders. That is all organizational preference. At least it is now working.


Top
   
 Post subject: Re: google app email
PostPosted: Sat Jul 11, 2015 9:46 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Glad it's working for you. It's not necessarily a waste of money to have Google receive e-mail for your domain, but as you noted this depends on your needs and preferences.

The way relayhost and smtp_sasl_password_maps works is identical to sending mail using a client like Thunderbird, Evolution, or Mutt. So if a particular Google configuration supports using your own mail client, it should also work with Postfix. (Subject to any of the same restrictions, e.g., From address.)


Top
   
 Post subject: Re: google app email
PostPosted: Tue Jul 28, 2015 2:48 pm 
Offline
Senior Member

Joined: Fri Jul 03, 2009 2:31 am
Posts: 54
ICQ: 897607
If you want to send outgoing via google apps I don't think you really need a full postfix relay, although I suppose there are some advantages to it (e.g. queuing up messages if google is unreachable for some reason). All you really need is a simple relay like ssmtp or nullmailer.

Just be aware of google app sending limits if you do use google SMTP for outgoing.

Using your own email server is (obviously) possible, but getting harder and harder as big providers put more controls into place to cut down spammers. You'll probably find you need to do more and more maintenance work over time. Thus, it might also be worth your time and money to check out some of the transactional email services like mailgun.com, sendgrid.com, and mandrill.com.


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


Who is online

Users browsing this forum: No registered users and 1 guest


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