Discussion Locked

Sendmail Aliases

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm running Sendmail on a Red Hat server. I need to be able to route incoming internet email to a local linux mailbox AND forward it to an external email address. If I did (in /etc/aliases):

jdoe: jdoe@somewhere.net, jdoe

but...this would result in a mail loop. Is there a way to tell aliases to point to the local mail file?

I'd like to do it with /etc/aliases. But, if anyone knows of a better way (maybe using .forward?) I'll take that advice too.

Thanks in advance.

Christian

3 replies

by cpfeiffe

If you are going to send the mail to another server you should always do so with .forward. /etc/aliases should only be used as an alias to a local mail file. If you want all mail for jdoe to go to jdoe@somewhere.net then create a home directory for jdoe (if not already done) and in the home directory put a file (.forward) that contains one line (jdoe@somewhere.net). If you need the mail to go to two places you should also use .forward instead of /etc/aliases, even if one of the two places isa local mail file. Simply add a second line to .forward (jdoe@localhost).

I hope this will help.

This discussion is closed to new replies.