Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to forward email going to user1@domain.com to user2@gmail.com, I read a bunch of articles and can't seem to get it to work.

I have a local user on the server "userA"

If I have "userA: user2@gmail.com" in the aliases table It forwards the emails but only when I send them from the server. But if I try emailing from another email address like user@hotmail.com it won't forward to user@gmail.com

If I have " userA: userA " in the aliases table it has no problem storing the emails on the server.

Any Advise? should I do this differently?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Simplest way to do this is to use the virtual map. Just add a line to /etc/postfix/virtual like this:

user1@domain.com user2@gmail.com

You may need to add

virtual_alias_maps = hash:/etc/postfix/virtual

to your main.cf.

Then just rebuild the virtual map:

sudo postmap /etc/postfix/virtual

and reload:

sudo /etc/init.d/postfix reload
share|improve this answer
    
Sorry been battling SMTP I'm going to get back to this asap. I didn't forget your response. –  Thomas Depole Feb 15 '13 at 22:43
    
Must of been the postmap, thanks Chrskly –  Thomas Depole Feb 18 '13 at 19:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.