How to forward some incoming mails from Postfix


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?


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.


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,

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”.

I found that setting!
Thank you,

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?


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

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.


I haven’t tested this myself yet, but it should work with Procmail. See for example this FAQ site:

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

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!

Right, the c in :0c means “continue with further rules”. :wink: