• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Configure Ubuntu Server & WordPress To Use Google Apps Gmail

By Abhishek Ghosh February 25, 2015 2:20 am Updated on February 25, 2015

Configure Ubuntu Server & WordPress To Use Google Apps Gmail

Advertisement

Here is How To Configure Ubuntu Server & WordPress To Use Google Apps Gmail for Domains. There are two ways – using plugin and server side configuration. We have talked about SMTP before. We have explained that there is associated reputation of Domain Name Mail Server. You can use this link to signup for Google Apps and use Gmail for domains. If you are from India, you can use our Partner Voucher code number AFEMP9X9C37FJX to get off for the first year. You can cancel your account at anytime. As we have said, there are two ways, first we’ll go for the server configuration. Google Apps Gmail here means Gmail for Domains.

 

Configure Ubuntu Server To Use Google Apps Gmail

 

First, after signup / with existing Gmail Account, you need to visit this webpage of Google for Unlocking Captcha. Your DNS records should be complete and MX record must be present. You will need to use application specific password if you have enabled 2-factor authentication.

For relaying mails using Postfix, you need to install these :

Advertisement

---

Vim
1
apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules

There are four configuration files :

Vim
1
2
3
4
/etc/postfix/main.cf
/etc/postfix/sasl_passwd
/etc/postfix/tls_policy
/etc/postfix/master.cf

Check this location for SSL cert :

Vim
1
cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem

Should give you this kind of output :

Configure Ubuntu Server & WordPress To Use Google Apps Gmail

You do not have to purchase SSL certificate. This is server’s CA one. We want to put it here :

Vim
1
/etc/postfix/cacert.pem

We can use unix pipe :

Vim
1
cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem

First we will open the main.cf file :

Vim
1
nano /etc/postfix/main.cf

Basic configuration should go like this :

Vim
1
2
3
4
5
6
7
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy

We are providing you another optional configuration part of the file :

Vim
1
2
3
4
5
6
7
#smtpd_tls_auth_only = yes
smtpd_tls_key_file = /etc/postfix/newkey.pem
smtpd_tls_cert_file = /etc/postfix/newcert.pem
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

The above usually people do not say to avoid a bit few extra steps. Search our website with SSL certificate and you will find how to generate newkey.pem – these are used when OpenSSL support compiled with the package.

Then we will open the tls_policy file :

Vim
1
nano /etc/postfix/tls_policy

This should have :

Vim
1
[smtp.gmail.com]:587 encrypt

Now the last one :

Vim
1
nano /etc/postfix/sasl_passwd

This should be edited rightly :

Vim
1
[smtp.gmail.com]:587    admin@thecustomizewindows.com:PASSWORD

Change admin@thecustomizewindows.com:PASSWORD with yours one. Run these commands :

Vim
1
2
3
sudo chmod 400 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/tls_policy

That /etc/postfix/master.cf needs to have an uncommented line :

Vim
1
smtps     inet  n       -       n       -       -       smtpd

Read Postfix official documentations :

Vim
1
2
http://www.postfix.org/TLS_README.html#client_tls
https://help.ubuntu.com/community/Postfix

Another SMTP Client is MSMTP. You should not install both the above stuff and this one.

Vim
1
apt-get install msmtp ca-certificates

Vim
1
nano /etc/msmtprc

Copy and paste the following in the text editor:

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
defaults
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
account default
host smtp.gmail.com
port 587
auth on
user admin@thecustomizewindows.com
password PASSWORD
from admin@thecustomizewindows.com
logfile /var/log/msmtp.log
<pre>
 
You have to replace `admin@thecustomizewindows.com` with your email and `PASSWORD` with your password. Last step is :
 
<pre>sudo chmod 0644 /etc/msmtprc

So, these are two server side relay options. Many peoples has huge contribution for the whole guide including Major Hayden, Rahul Bansal and many. If you have WordPress on the domain, honestly it is better to take the second option.

 

Configure WordPress To Use Google Apps Gmail

 

There is a great WordPress Plugin :

Vim
1
https://wordpress.org/plugins/wp-mail-smtp/

Official Screenshot on the repo will tell you the easy story. It is hugely used Plugin.

Tagged With /etc/ssl/certs/Thawte_Premium_Server_CA pem , google apps for ubantu , google apps for ubuntu , Ubuntu Google Apps authentication
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Configure Ubuntu Server & WordPress To Use Google Apps Gmail

  • Google Cloud Apps for Domains : How to Setup

    Google Cloud Apps for Domains is multifaceted, it has some free offers like Custom Domain Email with limited features to Cloud Apps for power applications.

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Simple Mail Transfer Protocol (SMTP)

    Simple Mail Transfer Protocol, usually abbreviated as SMTP is a communication protocol used to transfer electronic mail (email) to the email servers.

  • How To Install Apache2 on Ubuntu 18.04 With Let’s Encrypt, HTTP/2, HSTS

    Here is Detailed Guide on How To Install Apache2 on Ubuntu 18.04 With Let’s Encrypt, HTTP/2, HSTS With Commands and Configurations For Most Secured Setup.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy