How to forward some incoming mails from Postfix

11 posts / 0 new
Last post
#1 Tue, 08/13/2013 - 11:37
marciano

How to forward some incoming mails from Postfix

Hello,

I am forwarding ALL incoming mail from certain user to gmail account but I only want that only for a couple of senders.
How can this be done?
Thanks

Tue, 08/13/2013 - 14:33
andreychek

Howdy,

There isn't a simple way to do that from Virtualmin, but the filters within Usermin should allow you to do that.

You could create filters designed to look for certain email addresses, and then when it sees those, it can perform a particular action -- which in your case would be forwarding the message to an alternate email address.

-Eric

Tue, 08/13/2013 - 15:59 (Reply to #2)
marciano

Hi Eric, thanks for your reply.

From Usermin Filter and Forward Mail
Warning - The system is configured to not process user-defined mail filters. Filters defined here will not be used.

I have a Maildir system.
Some folders/filters have been created from Squirrelmail but it only allows moving filtered messages to folders.

Thank you,
M

Wed, 08/14/2013 - 01:48
Locutus

There's a setting to configure whether users may define their own mail filters... It's in "Email Messages / Spam and Virus Scanning: Allow mailbox users to create mail filters".

Wed, 08/14/2013 - 09:07 (Reply to #4)
marciano

I found that setting!
Thank you,
M

Wed, 08/14/2013 - 17:17 (Reply to #5)
marciano

Options are exclusive.
Can't I "Deliver to Inbox" and "Forward to Addresses" ?
Those are radiobuttons and I can only select one of them.

The general rule is to deliver to inbox.
When I create a rule to forward a mail, it is not delivered to inbox too.

How can I get both rules performed like in general mail user settings where I can deliver ALL mail to inbox AND forward ALL mail anywhere?

Thanks

Wed, 08/14/2013 - 18:08
Locutus

You can: Create two filters and check "Continue with other filters" on the first.

Wed, 08/14/2013 - 20:05 (Reply to #7)
marciano

I did that but if the first rule is "deliver to inbox" no forward is performed (the second rule).
If the first rule is to to forward then it is not delivered to inbox.

Always it is followed the first rule but the second one.

Thanks

Thu, 08/15/2013 - 00:57
Locutus

I haven't tested this myself yet, but it should work with Procmail. See for example this FAQ site: http://partmaps.org/era/procmail/mini-faq.html#forward-copy

You may have to edit the Procmail config manually if Virtualmin doesn't set it properly.

Fri, 08/16/2013 - 13:44 (Reply to #9)
marciano

Hi Locutus,

I repeated 1)forward + c 2) deliver to inbox
I checked user/.procmailrc and all went fine reading your page link

Now it was okay, both actions were performed
Maybe I forgot to check "Continue with other filters"
I had changed the order of the rules in the filters list, I guess it could be the fault :0c is not the same as :0

Anyway, thanks!

Sat, 08/17/2013 - 05:02
Locutus

Right, the c in :0c means "continue with further rules". ;)

Topic locked