• 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

This Article Has Been Shared 805 Times!

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

  • Installing WordPress via PHP Script : Cloud Sites and Other WebHosts

    Installing WordPress via PHP Script is a very way to install WordPress on your Server via FTP without Shell Access. The script automatically download and unzip.

  • mod_pagespeed and Google PageSpeed Service

    mod_pagespeed and Google PageSpeed Service has been evaluated and from our tests some parts of mod_pagespeed is good but Google PageSpeed Service lags far away.

  • Creating Spinning Logo for WordPress Genesis and Others

    Creating Spinning Logo for WordPress Genesis and Other Themes is quite easy. Move the mouse over the logo and it will spin. You can control the speed,behavior.

  • WordPress Optimization Tricks : The PHP Files

    WordPress optimization tricks offers you some uncommon and common hacks to optimize the Page Loading speed specific to WordPress files only.

  • W3 Total Cache Pro and WordPress Page Loading Speed

    W3 Total Cache Pro has recently been introduced by W3TC Plugin developer and here is some questions frequently asked by the WordPress users as suggestion.

Additionally, 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 (22.1K 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

  • What Is A Digital Media Consultancy? May 17, 2022
  • How Artificial Intelligence (AI) Is Changing The Way We Play Bingo May 16, 2022
  • Why You Need A Big Data Consultant May 15, 2022
  • The Connection Between AI And Online Slots May 13, 2022
  • How To Choose Your Niche As An Instagram Influencer May 12, 2022

About This Article

Cite this article as: Abhishek Ghosh, "Configure Ubuntu Server & WordPress To Use Google Apps Gmail," in The Customize Windows, February 25, 2015, May 18, 2022, https://thecustomizewindows.com/2015/02/configure-ubuntu-server-wordpress-to-use-google-apps-gmail/.

Source:The Customize Windows, JiMA.in

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Privacy Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

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

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