• 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 » Encrypting Outgoing Emails With GPG/PGP on WordPress

By Abhishek Ghosh June 24, 2015 2:25 am Updated on June 24, 2015

Encrypting Outgoing Emails With GPG/PGP on WordPress

Advertisement

There Are Two Ways For Encrypting Outgoing Emails With GPG/PGP on WordPress. Either Fully Server Side Or PHP5 Based Way Using WP Plugins. Encrypting Outgoing Emails With GPG/PGP on WordPress is often asked topic and the person who is administering or creating the setup must ensure to have complete knowledge (and assumed to have basic knowledge about unix commands) on the topics we are talking about. Encrypting outgoing emails with GPG/PGP on WordPress is possible only in PaaS, Cloud Computing IaaS/Cloud Server, traditional VPS and dedicated servers. Encrypting outgoing emails With GPG/PGP on shared hosting can either fail or can be synonymous with running nude in the public road assuming wearing an invisible bullet proof dress.

 

Encrypting Outgoing Emails With GPG/PGP on WordPress : Basics Must Be Known

 

  1. UNIX Commands
  2. Determine which method is suitable yourself
  3. Use a Third Party Mail Server for proper SPF. Read this article.
  4. We can use Transactional Email services, we gave example on how to send emails from WordPress using Mandrill.
  5. A computing power is needed for encryption.
  6. Learn about GNU PG.
Encrypting Outgoing Emails With GPG:PGP on WordPress

 

Encrypting Outgoing Emails With GPG/PGP on WordPress From Server Side

 

In this case, we are installing GNU Privacy Guard on server. These should be our steps on SSH for a deb based GNU/Linux like Debian :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
apt-get install gnupg
# we can import our signed key sent to key server
gpg --keyserver pgp.mit.edu  --search-keys me@myemail.tld
gpg --import name_of_public_key_file
# we can generate key sent on server
gpg --gen-key
# we can sign
gpg --sign-key me@myemail.tld
# we can import private key
gpg --allow-secret-key-import --import /path/to/key
# we commonly sign using this format of command
pgp --sign-key "xyzzzd" --signer "######" --sig-type exportable --passphrase "######@##"

This is not the way when you want only WordPress to handle the emails. Setup can vary and usage of the way should be appropriate.

Advertisement

---

 

Encrypting Outgoing Emails With GPG/PGP on WordPress Using PHP-GPG

 

PHP-GPG is a PHP based implementation of GPG.

Vim
1
https://github.com/jasonhinkle/php-gpg

We need to install this :

Vim
1
apt-get install php5-gnupg

Then filer the emails with either theme/child theme’s function.php file or our function.php file replacement plugin :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// This snippet is written by Marcus Povey
// Ask question if you have
// https://www.marcus-povey.co.uk/2015/06/04/extending-wordpress-to-send-pgp-emails/
// you can copy below this line for personal usage
// ask the original creator for pure commercial usage
function find_encryption_key($keys) {
    $fingerprint = null;
    foreach ($keys as $k) {
        
        if ((!$k['expired'])  && ($k['can_encrypt']) && (!$fingerprint) && (isset($k['fingerprint']))) {
            $fingerprint = $k['fingerprint'];
        }
        
        if (!$fingerprint && isset($k['subkeys'])) {
            $fingerprint = find_encryption_key($k['subkeys']);
        }
    }
    
    return $fingerprint;
}
function encryptto($message, $address) {
    $gpg = new gnupg();
    
    if (is_array($address)) {
        $address = $address[0];
    }
    $keys = $gpg->keyinfo($address);
    if ($keys) {
        $fingerprint = find_encryption_key($keys);
        $gpg->addencryptkey($fingerprint);
        
        return $gpg->encrypt($message);
    }
    
    return false;
}
add_filter( 'wp_mail', function ($args) {
    $new_wp_mail = array(
        'to'          => $args['to'],
        'subject'     => $args['subject'],
        'message'     => $args['message'],
        'headers'     => $args['headers'],
        'attachments' => $args['attachments'],
    );
    
    if ($encrypt = encryptto($args['message'], $args['to'])) {
        $new_wp_mail['message'] = $encrypt;
    }
    
    return $new_wp_mail;
}, 1);

There are lot of WordPress Plugins to avoid the Server side steps. There are lot plugins available to encrypt the contact us form.

Tagged With exim encrypt outgoing email with pgp gpg , GnuPG wordpress , NB! Outgoing email servers require prior authorization with your e-mail addr , two ways to encrypt outgoing emails

This Article Has Been Shared 409 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic 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 Encrypting Outgoing Emails With GPG/PGP on WordPress

  • Setup own URL Shortening Service for Websites on Rackspace Cloud

    Setup own URL Shortening Service for Websites on Rackspace Cloud within fraction of a minute using Free Google Apps Labs Short Links service.

  • Cloud Computing Disaster Recovery For WordPress After Hacking

    Cloud Computing Disaster Recovery Cheat Sheet for WordPress presents the clever ways to make the hacker fool and get your website back within few minutes.

  • PubSubHubbub and Rackspace Cloud Queue

    PubSubHubbub is a networking protocol. Rackspace is Open Source but infamous for difficult to understand API documentation by normal human.

  • How to Upload Backup to Dropbox from Cloud Server

    Here is How to Upload Backup to Dropbox from Cloud Server in Case You Want To Keep Your Backup of Files and Database on a Free Cloud Storage.

  • Install Nginx PHP5-FPM on HP Cloud

    Here is How To Install Nginx PHP5-FPM on HP Cloud. HP Cloud means HP Helion Public Cloud. It is basically very easy to work with HP Cloud. People fear HP Helion Public Cloud very much. The basic reason possibly is not understanding the basics of Security Group Rules. So, you need to read our previous […]

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

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

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 (20K Followers)
  • Twitter (4.9k Followers)
  • Facebook (5.8k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.2k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What is Domain-Driven Design (DDD)? January 23, 2021
  • Top 10 Anti Hacking Software for Microsoft Windows January 22, 2021
  • What is Software Modernization? January 21, 2021
  • Cloud Computing : Cybersecurity Tips for Small Business Owners January 20, 2021
  • Arduino : Independently Blink Multiple LED January 18, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "Encrypting Outgoing Emails With GPG/PGP on WordPress," in The Customize Windows, June 24, 2015, January 24, 2021, https://thecustomizewindows.com/2015/06/encrypting-outgoing-emails-with-gpgpgp-on-wordpress/.

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 Cookie Policy.

PC users can consult Corrine Chorney for Security.

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

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

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