I am not sure just how proficient you are with Linux, but if you are willing to spend some time creating a custom configuration, you may want to use an email configuration modeled after what I use here.
First, I use fetchmail to get my email from my various email accounts (all are on pop servers). Fetchmail passes it to procmail (this is where the custom configuration comes in), and procmail delivers mail arriving from known sources to specified directories under my mail directory. Any email coming from unknown sources is dropped into a "pending mail" directory. I then use Kmail as my local mail reader. When I set up Kmail for the first time, it created a mail directory at (
/home/$USER/.kde4/share/apps/kmail/mail). I replace that directory with a link to my local mail directory located under my user account's home directory (
~/mail).
I am a bit of a control freak, so I do not run fetchmail in daemon mode. I run it from a cron script each quarter hour (some more custom configuration). Way back when I first set this up. I used fetchmailconf to configure fetchmail. My fetchmailrc configuration file (made generic for my privacy) follows:
Code:
# Configuration created <creation date placed here by fetchmailconf> by fetchmailconf
set logfile "/home/$USER/tmp/fetchmail.log"
set postmaster "$USER"
set bouncemail
set no spambounce
set properties ""
poll <MAILSERVER> with proto POP3 and options no dns uidl
user '<USERNAME>' there with password '<PASSWORD>' is '$USER' here options fetchall stripcr
mda '/usr/bin/procmail'
poll <MAILSERVER> with proto POP3 and options no dns uidl
user '<USERNAME>' there with password '<PASSWORD>' is '$USER' here options fetchall stripcr ssl
mda '/usr/bin/procmail'
Notes:
<MAILSERVER> = email account server address (Gmail's email server address is
pop.gmail.com
<USERNAME> = your email account user name.
<PASSWORD> = your email account password.
<USERNAME> = your regular Linux account's user name (not root).
I will also include the most usefull parts of my procmailrc file:
Code:
# My personal procmailrc file as inspired by Spam Hammer
# Appreciation to Nic Wolff who provided the original script
# from which this was created
# Info at http://angel.net/~nic/spam-x.html
# Modifications by Ernest N. Wilcox Jr.
# email: ewilcox@gmail.com
# System variables for procmail:
SHELL=/bin/bash
PATH=$HOME/bin:/usr/bin:/bin:/usr/local/bin:.
COMSAT VERBOSE=off
# custom procmail directory and file path definitions
HOME=/home/$USER
PMDIR=$HOME/tmp
LOGFILE=$PMDIR/procmail.log
MAILDIR=$HOME/mail
DEFAULT=$MAILDIR/pending/new
INBOX=$MAILDIR/inbox/new
NOTIFICATIONS=$MAILDIR/Notifications/new
LISTBOX=$MAILDIR/Lists/new
DB=$HOME/.mail-accept.list
DENY_DB=$HOME/.mail-deny.list
# Program and device location definitions specific to my system
# You should check that these are the same on your system
FORMAIL=/usr/bin/formail
GREP=/bin/grep
SENDMAIL=/usr/sbin/sendmail
LS=/bin/ls
TR=/usr/bin/tr
HEAD=/usr/bin/head
DATE=/bin/date
BITBUCKET=/dev/null
# Miscelaneous definitions for recipe execution
# Replace each <KNOWN-SENDER-EMAIL-ADDRESS> entry below with the email address of mailing lists you are enrolled on (if any):
LISTS=(<KNOWN-SENDER-EMAIL-ADDRESS>|<KNOWN-SENDER-EMAIL-ADDRESS>)$
# Replace each <KNOWN-DOMAIN-NAME> with the domain names from which you get email that are not mailing lists. Example - if you receive email from LQ (LinuxQuestions), one entry would be linuxquestions.org:
KNOWN_DOMAINS=(<KNOWN-DOMAIN-NAME>|<KNOWN-DOMAIN-NAME>)$
# Replace each <DENY-DOMAIN-NAME> with the domain name of a domain from which you do not want to receive any mail. All mail from sources in this list will be sent to the BITBUCKET (/dev/null)
DENY_DOMAINS=(<DENY-DOMAIN-NAME>|<DENY-DOMAIN-NAME>)$
# Get sender
:0 hw
FROM=|$FORMAIL -rzxTo:|$TR / _
# If the message is from a list we're on, deliver it.
:0
* LISTS ?? (.)
* $ ^TO_$LISTS
$LISTBOX
# If the message is from a known domain, deliver it.
:0
* KNOWN_DOMAINS ?? (.)
* $ FROM ?? $KNOWN_DOMAINS
$INBOX
# Mail from the cron daemon goes into notifications.
:0
* ^From.*cron.*
$NOTIFICATIONS
# Handle rejected - unknown mail:
# If the message sender is in my deny-list, drop it in the bitbucket.
:0 h
* ? $GREP -i ^$FROM $DENY_DB
$BITBUCKET
# If the message is from a rejected domain, drop it in the bit bucket.
:0
* DENY_DOMAINS ?? (.)
* $ FROM ?? $DENY_DOMAINS
$BITBUCKET
# Handle mail from known sources:
# If the message sender is in my allow list:
:0
* ? $GREP -i ^$FROM $DB
$INBOX
# Anything else is delivered to pending messages
The next part of the puzzle is the bash script I run in cron to get all this working:
Code:
#!/bin/bash
# append a blank line and a date stamp into the fetchmail log file:
echo " " >> ~/tmp/fetchmail.log
date >> ~/tmp/fetchmail.log
# append a blank line and a date stamp into the procmail log file:
echo " " >> ~/tmp/procmail.log
date >> ~/tmp/procmail.log
# go get the mail
fetchmail -d 0
The final step is telling cron to go get the mail:
Code:
# Check for mail each quarter hour
0,15,30,45 * * * * /home/$USER/bin/chkmail &> /home/$USER/tmp/chkmail.log
I understand that this all looks very complicated (and it is, to be completely honest), but once you get things set up the way you want them, and working correctly, it automates most of your email management.
I do not read pending mail (mail from unknown sources) in Kmail. I first check unknown mail by navigating to
~/mail/pending/new in the Knoqueror File Manager (or Dolphin), then open the message with Kwrite. If it is something I want to read in Kmail, I simply close Kwrite. If the message is suspicious in any way, I delete it in Konqueror.
HTH,