forward emails without deleting them from the server

Hello,
I use an email server on solaris and i like to forward emails that come in to another email address (by request from some users).I have done this by creating a file '.forward' in the users directory and writting the destination email in this file. The problem is that the emails do not remain in the server, they move to the email address written in the '.forward' file.
In fact i like to copy the incoming emails to another email address.How can i do this?
Thanks for your help
oceanisAsked:
Who is Participating?
 
shanechambersConnect With a Mentor Commented:
The .forward functionality offers the ability to list more than one destination.  You can therefore put something like

user, user@remotesite.com

into the .forward file, and it would keep a copy in the local user's mail file (with no chance of a mail loop), and send a copy to the user@remotesite.com.

I do this all the time, and it works fine.
0
 
mshivdasCommented:
I think you can use the format:

\username, "remoteusername@remotesite"

0
 
mshivdasCommented:
Whoops -- hit submit a second too soon.

I think you can use the format:

 \username, "remoteusername@remotesite"

in the .forward file in the user's home directory.
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
dcgamesCommented:
Will this cause a loop?
0
 
mshivdasCommented:
It didn't when I tested it.    I believe that the \ stops the second loop from happening.
0
 
mshivdasCommented:
To clarify further, to the best of my knowledge, the result of putting a \ before the username is that the message gets copied to the local mail spool rather than actually being "sent" back to the user which would potentially create a rather ugly mail loop.
0
 
HahoCommented:
in sendmail, u can use the virtualuserdb to forward mails from one account to another or even to an external address..
we use this feature to provide email forwarding services to our users..
0
All Courses

From novice to tech pro — start learning today.