Restricting outbound internet emails to specific domains

Discuss the Scalix Server software

Moderators: ScalixSupport, admin

Armitage72

Restricting outbound internet emails to specific domains

Postby Armitage72 » Wed Sep 26, 2007 5:51 pm

I'd like to be able to restrict outbound internet emails to specific domains. There is a KB article at http://portal.knowledgebase.net/display ... =0.7604334 that works for blocking all outbound internet emails which I was able to get working. Is it possible to modify the rules or routing so that certain domains are exempted?

For example, outbound internet emails to domain-a.com and domain-b.com are allowed, while any other external domains are rejected?

Thanks!

florian
Scalix
Scalix
Posts: 3852
Joined: Fri Dec 24, 2004 8:16 am
Location: Frankfurt, Germany
Contact:

Postby florian » Tue Oct 02, 2007 7:23 pm

the scalix rules mechanism - as it is based on routes - could only do that if all recipients on the domain are listed in the directory, so it's pretty much inadequate. I would suggest to block the disallowed domain on the sendmail level, through which every outbound internet mail flows. believe accessdb is your friend there.

Florian.
Florian von Kurnatowski, Die Harder!

Armitage72

Postby Armitage72 » Thu Oct 04, 2007 9:08 am

Thanks for the tip, Florian. After some searching I found a post on how to do this in sendmail.

- cd to /etc/sendmail
- Add the following to sendmail.mc, changing the entries for outgoing_domains to the domains you want to allow emails to

Code: Select all

LOCAL_CONFIG
C{outgoing_domains} domainA.com domainB.com domainC.com

SLocal_check_rcpt
R$*                                             $: $1 $| $>CanonAddr $1
R$* $| $+ < >                                   $@ OK
R$* $| $+ < $* $={outgoing_domains} . >         $@ OK
R$* $| $+ < $+ >                                $#error $@ 5.7.1 $: "550 Access denied"
R$* $| $*                                       $@ $1


- Type 'make'
- Restart sendmail

External emails to domainA.com, domainB.com, and domainC.com will go through, all others will give a bounceback to the sender of "550 Access denied".

florian
Scalix
Scalix
Posts: 3852
Joined: Fri Dec 24, 2004 8:16 am
Location: Frankfurt, Germany
Contact:

Postby florian » Thu Oct 04, 2007 10:50 am

Hey, great.

Thanks for documenting this back here. Now... as you've done that, maybe we can go one step further - would you be willing to doc this in a little mini how-to on wiki.scalix.com?

I think this is information worth preserving....

Cheers, Thanks,
Florian.
Florian von Kurnatowski, Die Harder!


Return to “Scalix Server”



Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron