Configure Zentyal 4.2 To Move SPAM Email To Junk Folder

Configure Zentyal 4.2 To Move SPAM Email To Junk Folder

Get Social!

logo-zentyal-blackZentyal, the “all-in-one” exchange server replacement and does quite a good job delivering AD-like management and authentication, file shares, email and webmail straight out of the box. The out-of-the-box set-up is a good starting point and most people will be up and running in no time.

Once you start to dig a little deeper into Zentyal’s configuration, and start to use it day-to-day, you’ll notice that a few basic things are missing.

Take for example the email offering – it all works quite nicely until you start to receive SPAM. You may, as I did, enable the email filter ‘Antispam’ to help fight your SPAM problems. The interesting thing with Zentyal is that enabling all of this will enable you to mark messages as SPAM, but not do anything with it. So now all of your users will still have all their messages in their Inbox, just some will have a SPAM rating in their header.

What you really need is to have Zentyal move all of the SPAM marked messages into a Junk folder (which is actually created for all users by default). To do that you’ll need to create your own Sieve rules configuration to move any received email message to the Junk folder. It’s easy enough to do,  with just a few small configuration file changes.

Log onto your Zentyal server using a Terminal and open the dovecot.conf configuration file using your favourite file editor.

vi /etc/dovecot/dovecot.conf

Add the following code in the ## Plugin settings section at the bottom of the file:

plugin {
    sieve = ~/.dovecot.sieve
    sieve_global_path = /etc/dovecot/sieve/default.sieve
    sieve_dir = ~/sieve
    sieve_global_dir = /etc/dovecot/sieve/global/
}

Create the global directory, if it doesn’t already exist:

mkdir -p /etc/dovecot/sieve/global

And add your Sieve rule file to move all incoming email into the Spam/ Junk folder which has the X-Spam-Flag set by SpamAssassin:

require ["fileinto"];
# rule:[SPAM]
if header :contains "X-Spam-Flag" "YES" {
        fileinto "Spam";
}

Finally you’ll need to restart dovecot for the changes to be picked up.

service dovecot restart

And that’s all there is too it. All new SPAM mail will be moved directly into the Spam/ Junk folder.


Zimbra Email Server Intergration with SendGrid

Category : How-to

Get Social!

zimbra-logoZimbra Email Server is an install anywhere, full featured email server solution. I know that sounds like a sales pitch, but it really is one of the better all-in-one on premise email solutions. It’s scalable, deployable on several platforms and hosts a comprehensive web mail service for users to manage email from a browser.

As good as Zimbra is, it can’t (or can any email server) make up for a bad network set up. For example, many email servers, such as Hotmail, will simply bounce emails coming from dynamic IP addresses – bad news if you run Zimbra from home. You’ll also need to set up SPF records to validate email being sent from your server against your domain.

To simplify the sending part of your email server, you can use a service such as SendGrid. What SendGrid do is act as the middle man between your email server and the recipient. Your email server will forward sent emails to SendGrid and SendGrid will deliver the email to the recipient with all the required configuration taken care of to keep your sent email out of the SMAP bin.

Before we get going, we’ll need an account on SendGrid. The free account should be enough to get you started.

To set up Zimbra, we need to configure the MTA to relay all email to our SendGrid address for SendGrid to relay the email to the recipient. Follow the below steps to set up Zimbra as a relay server.

Open the below file in your favourite text editor:

vi /opt/zimbra/conf/relay_password

And add, all on one line, smtp.sendgrid.net along with your username and password in the following format username:password. For example:

smtp.sendgrid.net james:mypa55w0rd

Next, run the following commands in order to configure Zimbra’s MTA to use your above SMTP credentials to relay all outgoing email.

postmap /opt/zimbra/conf/relay_password
postmap -q smtp.sendgrid.net /opt/zimbra/conf/relay_password
zmprov ms `zmhostname` zimbraMtaSmtpSaslPasswordMaps lmdb:/opt/zimbra/conf/relay_password
zmprov ms `zmhostname` zimbraMtaSmtpSaslAuthEnable yes
zmprov ms `zmhostname` zimbraMtaSmtpCnameOverridesServername no
zmprov ms `zmhostname` zimbraMtaSmtpTlsSecurityLevel may
zmprov ms `zmhostname` zimbraMtaSmtpSaslSecurityOptions noanonymous
zmprov ms `zmhostname` zimbraMtaRelayHost smtp.sendgrid.net:587

Zimbra will reload the config after 2 minutes (by default) and your new changes will take affect.

Send a test email and you should see that all new outgoing email is sent via SendGrid.


Visit our advertisers

Quick Poll

How often do you change the password for the computer(s) you use?

Visit our advertisers