LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Blogs > arniekat
User Name
Password

Notices



Rate this Entry

Slackware-13.37-Hacks-Claws Mail/GnuPG

Posted 07-11-2011 at 11:43 PM by arniekat

Claws-Mail with GnuPG Encryption

This tutorial will setup Claws-Mail with HTML Mail Viewing, Spam Filtering and GnuPG Encryption. If you use Yahoo Mail or some other service, you will need to get the settings for your email from your provider. The information here came from the Claws-Mail Help and from SlackBuilds.org.

Compile and install the following applications in the following order from SlackBuilds.org

1. libetpan-1.0 (Dependency of Claws-Mail)
2. bogofilter-1.2.2 (Optional-Only if you want a spam filter)
3. claws-mail-3.7.9
4. icu4c-4.6.1 (Dependency of WebKit for HTML Viewing)
5. libsoup-2.32.2 (Dependency of WebKit for HTML Viewing)
6. webkit-r61056 (For HTML Mail Viewing)
7. claws-mail-extra-plugins-3.7.9

NOTE-Be sure to remove the clamd and geolocation_plugin from the claws-mail-extra-plugins.SlackBuild since we are not including this in the package.

CREATING GNUPG PRIVATE-PUBLIC KEYS

Open the application Gnu Privacy Assistant, which is included with your default Slackware installation. You can use KGPG if you are comfortable with that. If you use the GNOME Desktop, you will have the Seahorse application. I will be using the Gnu Privacy Assistant since it can be used with any Desktop Environment. In KDE, it is located at KDE Menu > Utilities > Gnu Privacy Assistant

Here are the prompts/responses from Gnu Privacy Assistant:
You do not have a private key yet. Do you want to generate one now (recommended) or do it later? Click "Generate Key Now"
Please insert your full name now: <Your Full Name>
Click Forward
Your email address: <Your_email_address_at_gmail.com>
Click Forward
Please choose a passphrase for your new key.
Passphrase: <GnuPG_Passphrase>
Repeat Passphrase: <GnuPG_Passphrase>
Click Forward
Do you want to create a backup copy? Create a backup copy.
Click Apply
Your key is being generated.
A backup copy of your key is stored in /home/user/sec_key.asc
Copy this key to a secure place, then shred the backup key with the following command:
$ shred -u /home/user/sec_key.asc
Close the Gnu Privacy Assistant

SETTING-UP CLAWS-MAIL

Open the application and input the email address, settings, etc. If you do not use GMail, you can get your settings from your email provider's website. Here are the prompts and responses:

Welcome to the Claws-Mail Setup Wizard
Click Forward

Your Name: <Your_Full_Name>
Your EMail Address: <Your_email_address_at_gmail.com>
Your Organization: <Organization_Name>
Click Forward

Receiving Mail Dialog Box
Server Type: POP3
Server Address: pop.gmail.com
Username: <gmail_username>
Password: <gmail_password>
CHECKED BOX: Use SSL to connect to Receiving Server
Click Forward

Sending Mail Dialog Box
SMTP Server Address: smtp.gmail.com
CHECKED BOX: Use Authentication
SMTP Username: <Empty to use same name as receive>
SMTP Password: <Empty to use same name as receive>
CHECKED BOX: Use SSL to connect to SMTP Server
Click Forward

Saving Mail To Disk Dialog Box
Mailbox Name: Mail
Click Forward

Configuration Finished

Click Save to Save Settings and Start Claws-Mail
Click "Get Mail" to download all messages

When you first click "Get Mail", you will have to accept the Unknown SSL Certificate gmail-pop.l.google.com
Click "Accept and Save"

When you first click "Compose", you will have to accept the Unknown SSL Certificate gmail-smtp-msa.l.google.com
Click "Accept and Save"

CLAWS-MAIL PLUGINS

A) EMail Encryption Plugins

Go to Configuration--Plugins, then select "Load" to load a plugin. A second dialog box will open at the /usr/lib/claws-mail/plugins directory. Select the pgpcore.so, pgpmime.so and pgpinline.so plugins and click "Open". Click "Close" to exit the Plugins Dialog Box.

Go to Configuration--Preferences for current account... Select Account > Privacy Menu Item. Select "PGP/Inline" from the “Default privacy system” drop-down box. I uncheck all the boxes so I have to specifically select to encrypt or sign emails. Select Plugins > GPG Menu item. At the Sign Key, select "Select key by your email address" as long as your GnuPG Key is set to the same email account as Claws Mail. If that is not the case, or if you prefer, you can select "Specify key manually." To get the value for "User or key ID", open up the Gnu Privacy Assistant and get the Key ID, which will consist of 8 alpha-numeric characters. Enter this value in the Claws Mail "Specify key manually" field. Click on "Apply". Click on "OK" to exit the dialog box.

Go to Configuration--Preferences. Now select the Plugins > GPG Menu Item. Select the box to enable "Automatically check signatures". Also, select Passphrase: Store passphrase in memory and select a reasonable amount of time for the section "Expire after 10 minute(s)". If you only send very few encrypted emails, you can deselect storing the GnuPG Key Passphrase in memory. Click on "Apply". Click on "OK" to exit the dialog box.

Digitally Signing a clear-text email.
Hit the "Compose" button.

1. Compose your message.
2. Go to Options, then select "Sign" if you want to digitally sign the email. GnuPG will use your Private Key to sign the email so that someone with your Public Key will verify that it came from you. When you hit "Send" you will be asked for the GnuPG Private Key Passphrase. Enter it and the mail should be on its way digitally signed. When the mail is received, the recipient will click on the email to read it. It will have a section entitled "BEGIN PGP SIGNED MESSAGE", then you will see the clear-text message. The next section will have a "BEGIN PGP SIGNATURE", a bunch of random-looking garbage and an "END PGP SIGNATURE" section. If your recipient is also using Claws-Mail and they have imported your Public Key into their GnuPG Keyring (GPA, KGPG or Seahorse), when they receive a digitally-signed email, they will see at the bottom of the Claws-Mail dialog box, a note "Good Signature from ..." if the signature was verified.

Note - The recipient of your email MUST have your Public Key in their keyring in order to verify the signature. A Digitally-Signed email verifies that the email HAS NOT changed.

Creating an encrypted email.
Hit the "Compose Mail" button./

NOTE - You must have the recipient's Public Key in your keyring before you create the encrypted message. You will be using their Public Key to encrypt the message so only the recipient can decrypt it with their Private Key. It is linked by email address.

1. Compose your message.
2. Go to Options, then select "Encrypt" if you want to completely encrypt the email. When you hit "Send", you will receive an Encryption Warning that "Attachments are not encrypted by the PGP/Inline system, nor are mail headers, like the Subject line". Claws-Mail will look for a Public Key that matches the email address of the recipient. If it cannot find one, Claws-Mail will ask you to select a Public Key to encrypt the message. Click "Continue" to send it. When the mail is received, the recipient will click on the email to read it. Assuming they are using Claws-Mail, they will then be asked for the passphrase of their Private Key. Then the message will be decrypted with it. The message will have a section entitled "Start of PGP/Inline encrypted data", then the decrypted message and finally an "End of PGP/Inline encrypted data".

B) Bogofilter Spam Filter Plugin

This plugin can check all messages that are received from an IMAP, LOCAL or POP account for spam using Bogofilter. You will need Bogofilter installed locally. Before Bogofilter can recognize spam messages, you have to train it by marking a few hundred spam and ham messages with the use of "/Mark/Mark as spam" and "/Mark/Mark as ham". The button is at the top next to the Trash button. When a message is identified as spam it can be deleted or saved in a specially designated folder.

Go to Configuration--Plugins, then select "Load" to load a plugin. A second dialog box will open at the /usr/lib/claws-mail/plugins directory. Select the bogofilter.so plugin and click "Open". Click "Close" to exit the Plugins Dialog Box.

The options can be found in Configuration--Preferences, then Plugins > Bogofilter. The options/changes I made are as follows: Save spam in: I create a folder named "spam" to put the junk in. I will appear as "Save spam in #mh/Mailbox/Spam" Click the "Apply" button, then the "OK" button.

C) Fancy HTML Mail Plugin

This plugin renders HTML mail using the WebKit library. By default all remote content is blocked and images are not automatically loaded.

Go to Configuration--Plugins, then select "Load" to load a plugin. A second dialog box will open at the /usr/lib/claws-mail/plugins directory. Select the fancy.so plugin and click "Open". Click "Close" to exit the Plugins Dialog Box.

Now, whenever you are reading an email, you can select to see the HTML version by clicking the 3rd button on the right which is a "text/html" button. Now you will see the HTML version of the email. You can also toggle between text only and HTML mail viewing options.

Options can be found in Configuration--Preferences, then Plugins > Fancy. The options available are as follows (the defaults are shown below, but you can change as you see fit):

Auto-Load Images UNCHECK
Block External Content CHECK
Enable Javascript UNCHECK
Enable Plugins UNCHECK
Open Links With External Browser UNCHECK
Posted in Uncategorized
Views 1091 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 11:07 AM.

Main Menu
Advertisement

Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration