Sendmail question

How would I configure sendmail so that the INTERN group can only send email locally to xyz.com, while the EXTERN group can send email anywhere.

Thanks for your help!

You don't have to do anything for the EXTERN group. Just create the alias in the /etc/aliases file.

___________________________________
For the INTERN group, I would use a script as a filter.

Direct all mail from this alias INTERN into the script. Then if the email address meets your criteria for the xyz.com then allow the email to go. Otherwise, redirect the email back to the sender or send them a standard denial email.

In /etc/aliases, where testscript is your script that checks for the email address. You may have to put the script put in a certain directory for this to work. On my systems it is in /usr/local/bin as a default for sendmail scripts.

Yours may be different.

#vi /etc/aliases
...
...
#Local Aliases

INTERN: "|testscript"

Hope this helps.
My brain is your brain...

:cool: :smiley:

Kelam,

Isn't the aliases file for incoming, not outgoing email? Won't Sendmail see the domain name on the receipent (such as @yahoo.com) and send the mail out, never looking at the aliases file or who is sending the mail?

I never thought about it??? I assumed that you can have it read for outgoing mail as well.

I had only used it for incoming mail filtering, and just assumed that it would work for outgoing as well.

hehehe my bad...!:eek:

I know you can restrict ALL mail from a user to only local, but I guess I don't know how to limit them to one address???

:smiley:

EDIT: here is something that is for sendmail.cf...

I did find a google search for something that looks promising. The first is one page. The second is the google search results.

http://www.rosat.mpe-garching.mpg.de/mailing-lists/procmail/2000-05/msg00051.html

http://www.google.com/search?hl=en&ie=ISO-8859-1&q=sendmail\+filtering\+outgoing\+mail

You can use procmail config file for run external script. This script can do anything.
Procmail check all mail (outgoing and incoming).
:slight_smile: I think this help you.

You can use procmail config file for run external script. This script can do anything.
Procmail check all mail (outgoing and incoming).
:slight_smile: I think this help you.

AlarIT