OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Duplicate emails with forwarding and virtual mailboxes

From: Ben Roberts (list-supportheadsnet.com)
Date: Sun Apr 13 2008 - 14:52:25 CDT


mouss wrote:
> Ben Roberts wrote:
>> mouss wrote:
>>> Ben Roberts wrote:
>>>>
>>>> Hello,
>>>>
>>>> I'm using Postfix with the virtual delivery method. I have 2 virtual
>>>> mailboxes, and everything is working as expected.
>>>>
>>>> However, the one thing I can't figure out is how to stop duplicate
>>>> messages being sent when I forward a copy of mail for mailbox A to
>>>> mailbox B.
>>>>
>>>> e.g.
>>>>
>>>> in /etc/postfix/vmailbox I have configured 2 virtual mailboxes
>>>>
>>>> user-foodomain.com testaccount/mail/user-foo/Maildir/
>>>> user-bardomain.com testaccount/mail/user-bar/Maildir/
>>>>
>>>> in /etc/postfix/virtual I have configured a forwarding rule:
>>>>
>>>> user-foodomain.com user-bardomain.com,user-foodomain.com
>>>>
>>>>
>>>> The idea is that all mail for user-foo is also forwarded to
>>>> user-bar. However, user-bar always received the message twice. I
>>>> can't figure out how to stop this happening.
>>>>
>>>> Is this because when the message is forwarded to user-foo this rule
>>>> gets repeated before Postfix realises and stops the loop occuring?
>>>
>>>
>>> 1) do not hijack threads. send a _new_ message instead of replying to
>>> an unrelated message.
>>> http://en.wikipedia.org/wiki/Thread_hijacking
>>>
>>>
>>> 2) when asking for help, you should follow the recommendations given
>>> to you in the list welcome message. if you lost this message, you
>>> need to read and follow
>>> http://www.postfix.org/DEBUG_README.html#mail
>>> In particular, output of 'postconf -n' is needed
>>>
>>> 3) if you use a content filter, you should carefully read
>>> http://www.postfix.org/FILTER_README.htm
>>> and/or
>>> http://www.ijs.si/software/amavisd/README.postfix.html
>>> (even if you don't use amavisd-new). In particular, search for
>>> no_address_mappings
>>
>> Ok, sorry about the thread hijacking. Didn't realise.
>>
>> Here's the output of postconf -n
>
> do you use a content filter? if so, you must disable address rewrite as
> described in the FILTER_README (see point 3 in my previous post).
>
>

Yes, I use a content filter to route mail to spamassassin. In the
master.cf file I have:

   smtp inet n - n - - smtpd
                  -o content_filter=spamfilter:

Do I need to modify this line so it reads:

   smtp inet n - n - - smtpd
                  -o content_filter=spamfilter:
                  -o receive_override_options=no_address_mappings

Thanks