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: mouss (moussnetoyen.net)
Date: Sun Apr 13 2008 - 13:38:03 CDT


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