{ 14 comments… read them below or add one }

1 Shoaibi June 4, 2009 at 10:24 am

hmmm, nice…

Reply

2 noneck June 8, 2009 at 11:27 pm

You could also leave the original address to keep a copy locally before forwarding, or have multiple email addresses seperated by commas.

vivek@cyberciti.com vivek@cyberciti.com, vivek@nixcraft.co.in

Reply

3 Gopal August 13, 2009 at 9:13 am
4 Mohammad Mateen October 30, 2009 at 8:46 pm

How i can get this functionality ?
—————————————————-
Directory: /home/logmon Shell: /bin/bash
Never logged in.
Mail forwarded to “|/usr/local/bin/logmon.sh”
No mail.
No Plan.
—————————————————-

Plz help

Reply

5 Mohammad Mateen October 30, 2009 at 8:47 pm

In simple words i want to forward a shell user email to some script

Reply

6 abi June 1, 2010 at 5:38 am

Hi,

I have added the lines as per said and is working fine. Now i want remove the forwarding, so i removed the added lines and restarted the postfix. But still the script is running. can u tell a solution to fix it?

Reply

7 Anatoliy September 8, 2010 at 11:48 am

Possible you forget about

postmap /etc/postfix/virtual

after changes to the virtual config

Reply

8 William October 14, 2011 at 10:41 pm

Muchas Gracias!

Even though it is old, it worked perfectly for me – tip if you never used postfix: set the mailname to something useful or google will reject the emails.

William

Reply

9 Manuel December 22, 2011 at 10:18 am

Hi,

how can u configure postfix to send EVERY E-Mail to exactly ONE User on your machine?

for example:

I create a user “mailarchiv”.

Every mail which goes to the Server “mail-05″ should be saved in the Mailbox of “mailarchiv”.

Can u give me a hint?

Reply

10 SAS January 16, 2012 at 1:38 pm

You had it there, didn’t you?

@yourdomain.com mailarchiv@yourdomain.com

Reply

11 KV November 17, 2012 at 4:11 pm

How can i forward from subdomain to main domian.

Ex: all email from subdomain @mail.maindomain.com to mail@maindomain.com

Thanks,

Reply

12 tony May 8, 2013 at 3:06 pm

I did this, precisely as described, and now all mail to my server is rejected.

cat /etc/postfix/virtual
tony@tonybaldwin.org tony@tonybaldwin.info
tony@tonybaldwin.me tony@tonybaldwin.info
tony@tonyb.us tony@tonybaldwin.info

can’t get mail to any of the .org, .me, or .us, and can’t even get mail to the .info address.
All of these addresses were working before I did this.
Clearly, I want to send them all to one address, the .info address,
but now nothing gets through at all.
This is on Debian Squeeze, if relevant.

Reply

13 tony May 8, 2013 at 3:17 pm

Also, blanking the virtual file and restarting postfix doesn’t put it back to working properly, either.
Following your instructions has hosed my mail server completely.
The e-mail addresses mentioned above are all in the mail db (mysql).
You do not mention whether this is relevant or not.
I was using them all as distinct mail address, and they were working, and I want to forward them all to one, now.
But if I can’t do that, at the very least, I’d like them to work as they before.
Currently none of them are working.

Reply

14 tony May 8, 2013 at 3:27 pm

well, I seem to have got it working as it was again.
I had to empty the /etc/postfix/virtual,
remove the virtual_alias_domains line in my main.cnf
I ran sudo newaliases
and reloaded postfix
and it’s back to the previous “normal” state.
Clearly I’ll have to seek how to forward my mail properly elsewhere.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as: , , , , , , , , , , , , ,

Previous Faq:

Next Faq: