1

Topic: Intercept Emails

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

I need to intercept emails from one recipient and have them go to a particular address. Sieve redirect works like forward. I need the original intended users to never see the emails. Halp? Thanks!

----

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

2

Re: Intercept Emails

Use mail forwarding:
http://www.iredmail.org/docs/ldap.user. … rding.html
http://www.iredmail.org/docs/sql.user.m … rding.html

NOTE: please ALWAYS ALWAYS ALWAYS show us basic info of your iRedMail server, so that we can give you more accurate answers.

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

3

Re: Intercept Emails

lol, sorry Zhang, I figured the question was so basic that it wouldn't really matter. smile

So that I know how to do. In this instance, I need to do so with emails ONLY from @fqdn.com. That's where I'm tripping up. I was trying to use sieve, but getting loop problems.

4

Re: Intercept Emails

If you want to apply the forwarding to some senders (@fqdn.com), you have to use sieve.
Show us your sieve rules which causes looping.

5

Re: Intercept Emails

if header :contains "from" "somewhere@outthere.com"
{
    Redirect "here@rightthere.com";
    Stop;
}

Using the Stop command causes this with no mail delivered to any recipient (which would seem to make sense based on the documentation):

Jan 13 10:30:25 mail postfix/pipe[29481]: 9781F73B4AF5: to=<here@rightthere.com>, relay=dovecot, delay=0.01, delays=0/0/0/0, dsn=5.4.6, status=bounced (mail forwarding loop for here@rightthere.com)

Using Keep in place of Stop sends an email to the redirect address, but still leaves the original recipient with a copy which is what I'm attempting to avoid.

So basically it looks like the stop statement is blocking the redirect from happening. Any idea where to go? My next thought is to perhaps do the statement twice, first with keep, then next with stop. Might work?

6

Re: Intercept Emails

Doing:

if header :contains "from" "somewhere@outthere.com"
{
    Redirect "here@rightthere.com";
}

= Loop

if header :contains "from" "somewhere@outthere.com"
{
    Redirect "here@rightthere.com";
    Discard;
}

=Loop



After more research I think maybe i'm starting to understand. I think maybe sieve has an issue with stopping because it wants to relay the email, but I'm preventing it from doing so... I think maybe if I forward everything to an external address instead it might work. Maybe.

7

Re: Intercept Emails

Musikaman wrote:

if header :contains "from" "somewhere@outthere.com"
{
    Redirect "here@rightthere.com";
}

Not sieve issue, but your sieve rule issue.
why you don't check "to:", "cc:", "bcc:" also? if one of them is "here@rightthere.com", don't redirect.

8

Re: Intercept Emails

Ah, I see what you're getting at. That would make sense as to why there's a loop error.

In the meantime I was able to use that rule by sending it to an external account.

Thanks Zhang!