1

Topic: Mail flow and forwarding to external email address

==== Required information ====
- iRedMail version (check /etc/iredmail-release):  0.9.6
- Linux/BSD distribution name and version:  FreeBSD 11
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====

I once had an issue with my current (soon to be previous) 15 year old mail server (running Debian/Postfix/Dovecot/spamassassin/roundcube) where email sent to local accounts that had an external email address as their destination, were sent on, even if they were marked as spam. The issue was I was moving email to a users 'spam' folder with procmail when it was delivering mail locally. If an email wasn't going to be stored locally, then it was sent on regardless of it's spam status spamassassin had marked it as.

With iRedmail, if I set a forward sieve rule for a user, will this happen? In writing this now, I had a thought, I  could set two rules, 1/ discard any email marked as spam and stop, and 2/ forward all remaining emails on. Is this the best way?

Thanks for a great software solution!

----

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

2

Re: Mail flow and forwarding to external email address

DaveQB wrote:

1/ discard any email marked as spam and stop, and 2/ forward all remaining emails on. Is this the best way?

Yes.

3

Re: Mail flow and forwarding to external email address

ZhangHuangbin wrote:
DaveQB wrote:

1/ discard any email marked as spam and stop, and 2/ forward all remaining emails on. Is this the best way?

Yes.

Thank you so much.
Or I guess step 1 can move spam mails to Junk instead in case something ever needed to be retrieved. Would need to be cleaned out (Junk folder) by someone every so often.

Ok so system wide sieve at /var/vmail/sieve/dovecot.sieve is thus:

require ["fileinto"];

# rule:[Move Spam to Junk Folder]
if header :is "X-Spam-Flag" "YES"
{
    fileinto "Junk";
}

So that applies to all users before their own sieve rules kick in? Thus step 1 from my 2 step solution would not be needed if I wanted to move spam to a users Junk and then forward all other emails to external email addresses?

Thanks again.

4

Re: Mail flow and forwarding to external email address

DaveQB wrote:

So that applies to all users before their own sieve rules kick in?

Yes. but we don't use 'stop' directive here, so it will go through user's sieve rules.

DaveQB wrote:

Thus step 1 from my 2 step solution would not be needed if I wanted to move spam to a users Junk and then forward all other emails to external email addresses?

You just need the forwarding part. but better do a testing.

5

Re: Mail flow and forwarding to external email address

ZhangHuangbin wrote:
DaveQB wrote:

So that applies to all users before their own sieve rules kick in?

Yes. but we don't use 'stop' directive here, so it will go through user's sieve rules.

Oh right. So fileinto in't a move, it's a copy? Ok cool. Thanks for your help Zhang! I'll buy you a coffe smile

6

Re: Mail flow and forwarding to external email address

"fileinto" is a move, but it will go through further rules to process this email.
a "stop" is stopping immediately and skip any further rules.

7

Re: Mail flow and forwarding to external email address

ZhangHuangbin wrote:

"fileinto" is a move, but it will go through further rules to process this email.
a "stop" is stopping immediately and skip any further rules.

Thanks.
Do you foresee an issue for me to add a stop command to the system wide spam header filter on my server? It would mean all mail marked as spam would go in each users "Junk" folder and no other actions would happen on those emails which should be a good thing, I think .

8

Re: Mail flow and forwarding to external email address

If stopping is what you want, then it's fine.