• 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 277 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 (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

  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023
  • What is Vehicular Ad-Hoc Network? January 24, 2023
  • Difference Between Panel Light, COB Light, Track Light January 21, 2023
  • What is COB LED? How LED Chip On Board Works January 20, 2023

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, January 27, 2023, https://thecustomizewindows.com/2015/02/configure-ubuntu-server-wordpress-to-use-google-apps-gmail/.

Source:The Customize Windows, JiMA.in

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT