PDA

View Full Version : [SOLVED] [postfix] how to redirect a virtual user mail to /dev/null



zespri
March 12th, 2010, 09:00 PM
Hello,

I followed guide posted here: http://neranjara.org/article/title/How_to_configure_PostFix_and_Dovecot_for_Virtual_U sers_with_out_a_Database_ and all worked great.

However I'm not sure how can I set up a virtual user to redirect all mail to /dev/null without just deleting their mailbox on schedule.

I tried to put them in virtual_alias_maps:


trash@example.com nobody

and then set up an alias like this:


nobody: /dev/null

Unfortunately it didn't work as I have a catch all address in virtual_mailbox_maps:


@example.com example.com/catch-all/

So in the log I see that mail to trash@example.com has been delivered to nobody@example.com and the mail itself appears in the catch-all mailbox.

How do I work around this?

zespri
March 16th, 2010, 07:15 AM
Silence here
Silence in a postfix news group
Silence in #postfix IRC
Much harder to get support for *nix stuff than for windows related questions.

KB1JWQ
March 16th, 2010, 03:29 PM
That's interesting-- neither here, newsgroups, nor a non-freenode IRC network are official Postfix support forums; perhaps you should be more diligent in researching the proper venue for your questions?

That being said, you could create a local user aliased to /dev/null and redirect mail to that virtual user to that local user via virtual_alias_maps.

Failing that, look up DISCARD in the access maps, it may do what you need.

Failing that, you could create a pipe transport to /dev/null in master.cf and reroute mail for that user over that specific transport.

KB1JWQ
March 16th, 2010, 03:39 PM
Oh, and there's also a DISCARD transport.

zespri
March 16th, 2010, 08:13 PM
First of all, thank you for replying.


That's interesting-- neither here, newsgroups, nor a non-freenode IRC network are official Postfix support forums; perhaps you should be more diligent in researching the proper venue for your questions?
It was freenode IRC. Asked the question three times during the course two days (roughly every 12 hours). Just out of curiosity where else but "official" IRC and a mailing list listed on the "official" site could I go? However, this is beside the point.


That being said, you could create a local user aliased to /dev/null and redirect mail to that virtual user to that local user via virtual_alias_maps.
This is exactly how I tried to set it up, see my original post. It didn't work. Catch-all kicked in first and although I didn't have virtual mail box for this user it redirected the mail to catch all address. I may be set it up wrongly, I explained how I did this in the OP.


Oh, and there's also a DISCARD transport.
This one is what has finally worked. Thank you for the tip.