I've spent a good few hours trying to set up my email on my new Site5 account. I wanted to set it up as follows:
-
Mails to my various target addresses (personal, public and wife) all arrive in a single account in different folders. This way I only have to poll a single account. This account is also my backup email archive.
-
All mail (except maybe spam checked mail) is forwarded to gmail to use as my email client. Site5 gives access to three web based email packages (Squirrelmail, Neomail, Horde) but they are not as good as gmail.
This is how my work email is set up and also how my former home email was set up. Both use procmail to do filtering and forwarding and are working sweetly.
So how to do this in the more restricted world of Site5?
On the Site5 site this is the main clue on how to set things up. This describes a technique of editing a file called /etc/valiases/ to get the email system to forward emails to procmail. procmail is then used to filter mails to the appropriate target folders, run spamassassin etc.
I tried using the prescribed setup and encountered two problems:
-
forwarding to gmail from the procmailrc did not work. According to the procmail log it did try to use sendmail to send the message but the messages never arrived.
-
I ended up with two copies of each mail, one that had been through procmail and another that did not (it had no spamassassin headers).
I did a google on cpanels (which is a relative of netadmin, which Site5 use) emailing forwarding facility and worked out that it is not necessary to edit valiases directly, the file can be edited via the netadmin email forwarding section. For each of my required email addresses I added two forwarding entries:
-
A forward to my gmail account
-
A forward to procmail (e.g. "|/usr/bin/procmail /home//.procmailrc")
The .procmailrc is set up in a conventional enough way, e.g:
## basic .procmailrc
SHELL=/bin/sh
LOGFILE=/home/blah/procmail_log ##replace with your actual domain!
VERBOSE=yes ## you can set this to YES for debugging
MAILDIR=/home/blah/mail/blah.com
DEFAULT=messages/inbox
# isn't bigger than a few k and working with big messages can bring
# SpamAssassin to its knees.
#
# The lock file ensures that only 1 spamassassin invocation happens
# at 1 time, to keep the load down.
#
:0fw: spamassassin.lock
* < 100000
| spamassassin
# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mbox. (This one is optional.)
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
messages/spamdefinitely
# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
:0:
* ^X-Spam-Status: Yes
messages/spampossibly
#
# Sort into recipients
#
:0
* ^TO_someone@blah.com
messages/someone
:0
* ^TO_someoneelse@blah.com
messages/someoneelse
:0
DEFAULT
All emails go into an account called 'messages' which has folders for each recipient and also folders for messages that might be spam or are definitely spam.
This setup seems to be working. I was getting two copies of my emails before because I had set up email accounts with the same names as I was forwarding to procmail. If the Site5 email system receives a message to fred@somedomain.com it will look for email accounts called fred@somedomain.com and deliver the message there if it exists. It will then look for an email forwarding link for fred@somedomain.com and will forward it if that exists. I was getting two copies of email because the email account existed and got email delivered directly and also because my procmailrc was delivering another copy. After I deleted the extra email accounts I stopped getting duplicate copies. Everything arrives via procmail.
I'm not sure why procmail could not forward email to gmail but I suspect the Site5 account may be set up to restrict sending of emails to stop spammers using Site5 hosting.
I don't think it is necessary to have shell access to Site5 to do this. Editing the valiases file apparently would require shell access but that is not necessary if you use netadmin (aka cpanel) to set up the forwarding. The .procmailrc file can just be uploaded using ftp. I did ask Site5 for shell access and got it within an hour. So far I am very pleased with Site5: fast servers and fast support.