Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to setup forward for virtual users 1

Status
Not open for further replies.

Filippozeus

Technical User
Feb 27, 2007
6
IT
Hi,
I'm new to postfix, any i've recently setup a Postfix MTA Server.
My domain is configured in postfix as a virtual domain.

Every user hai its own mailbox and all works great.

Now i have to tell postfix that when a message arrive this message must be delivered to virtual user mailbox and to user1@gmail.com

How can i do this ?

Please be descriptive ... i'm new to postfix

Thanks in advance
 
I'll assume you're talking about mail for one named user. You have a few options:

(1) Put the following line into /etc/aliases , then run the commands "newaliases" and "/etc/init.d/postfix reload":
[tt]
virtualuser: virtualuser,user1@gmail.com
[/tt]
(2) Create a file ~virtualuser/.forward containing:
[tt]
user1@gmail.com
[/tt]
 
Hi,
thanks for reply.

I think I have a problem with point (2).

I had configured postfix to deliver mails in /var/spool/mail/virtual/
when postfix receive mail for virtualuser@mydomaninname it's delivered to
/var/spool/mail/virtual/virtualuser

And
/var/spool/mail/virtual/virtualuser is a mbox file, not a maildir.
So due to the fact that virtual user has no ~ (home directory) where do i have to put the .forward file ?

thanks a million in advance
 
Of course, silly me, a virtual user does not have a home dir, so the ~/.forward system won't work. You could still try the /etc/aliases option, and there is also the option to write a custom script to reroute mail, but that's a bit more complex.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top