1

Topic: Update to FAQ: How to move mails which marked as SPAM into Junk folde

There is a FAQ entry describing how to move mails marked as spam to junk folder:
http://www.iredmail.org/forum/topic365- … older.html  However, the information in this FAQ needs some updating, at least for current iRedMail on CentOS 6

Here is the original FAQ in quotes, with updates included in-line:

This tutorial is used to explain how to move mails which marked as SPAM into Junk folder in iRedMail. If they don't work for you, please post a new topic in iRedMail General Technical Support forum.
=====================

iRedMail uses Amavisd-new + SpamAssassin to detect spams, and it also:

    Add '**** SPAM ****' in mail subject by default

    Add 'X-Spam-Status' in mail HEAD.

If you want to move spam mails into Junk folder, here are steps:

The intro is the same!  smile

Make sure your domain name is listed in /etc/amavisd.conf (RHEL/CentOS) or /etc/amavis/conf.d/50-user (Debian/Ubuntu). e.g.

@local_domains_maps = ['demo.iredmail.org', 'a.cn'];

Two changes:

1) Current RHEL/CentOS setups default to /etc/amavisd/amavisd.conf

2) amavisd.conf uses the following setting:

@local_domains_maps = 1;

In this case, all messages are treated as local no matter what;  in this context, it means that spam headers will be added to all messages, which is what we want.  So, no changes necessary here.

Find location of global sieve rule file in /etc/dovecot.conf (RHEL/CentOS) or /etc/dovecot/dovecot.conf (Debian/Ubuntu): sieve_global_path, default is /var/vmail/sieve/dovecot.sieve.

plugin {
    # ... SKIP OTHER SETTINGS HERE ...
    sieve_global_path = /var/vmail/sieve/dovecot.sieve
}

Two changes:

1) Current RHEL/CentOS setups default to /etc/dovecot/dovecot.conf

2) The parameter sieve_global_path has been replaced with sieve_default;  the destination path is the same, however.

iRedMail copies a sample file in the same directory by default, filename is /var/vmail/sieve/dovecot.sieve.sample. Rename it to the correct filename. If you can't find the sample file, you can also download it here.

    Restart dovecot service, and it should work for you now. If it doesn't work for you, please try to debug dovecot and find the root case from log files.

This remains the same.

So, in the default case, the FAQ collapses down to simply copy/rename /var/vmail/sieve/dovecot.sieve.sample to /var/vmail/sieve/dovecot.sieve and bounce the dovecot service!

Hope this helps save someone a little time in the future.

Tim Massey

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Update to FAQ: How to move mails which marked as SPAM into Junk folde

Thanks for your feedback. I created a separate tutorial here moment ago:
http://www.iredmail.org/docs/move.detec … older.html

3

Re: Update to FAQ: How to move mails which marked as SPAM into Junk folde

ZhangHuangbin wrote:

Thanks for your feedback. I created a separate tutorial here moment ago:
http://www.iredmail.org/docs/move.detec … older.html

A quick glance shows that this document is different from what I posted above in one way.  For completeness, here is the change.  In my post above, I state the following:

2) The parameter sieve_global_path has been replaced with sieve_default;  the destination path is the same, however.

That is true.  In the documentation Mr. Huangbin posted, though, sieve_before is used instead.  The documentation mentions that sieve_default is user-overrideable.  sieve_before is ran before any user-defined sieve processing, so it gets processed no matter what.  The Dovecot documentation covers this in more detail:  http://wiki2.dovecot.org/Pigeonhole/Sieve/Configuration.

Tim Massey