Koozali.org: home of the SME Server

Contribs.org Forums => General Discussion => Topic started by: fastxl on April 09, 2015, 08:03:16 PM

Title: Block email to outside Domains
Post by: fastxl on April 09, 2015, 08:03:16 PM
I have SME Server 8 that I am setting up as an "internal" email server for just our office. I have it working, but I need to be able to block any emails going to and other Domain. Example if some tries to email joe.smith@yahoo.com or steve@hotmail.com I would like that email returned. How can I accomplish this?

Thanks,
Eric
Title: Re: Block email to outside Domains
Post by: janet on April 09, 2015, 08:42:27 PM
fastxl

I have not tested this, but you could put a fake non existant mail server address in the server manager Email panel for the ISP's SMTP server
eg mail.fakesmtpserver.org (assuming that does not exist).

I expect local mail will be delivered but external mail will not be able to be sent as there is no specified external SMTP server available.

Title: Re: Block email to outside Domains
Post by: fastxl on April 09, 2015, 08:49:46 PM
Seems to work perfect. So simple. Thanks for the fast reply.

Eric
Title: Re: Block email to outside Domains
Post by: Stefano on April 09, 2015, 09:07:59 PM
be sure to block outgoing traffic to tcp 25/465/587

Title: Re: Block email to outside Domains
Post by: fastxl on May 08, 2015, 01:56:26 PM
I need to revisit this subject. I was able to block sending email from all users to people outside the domain by adding a "Fake" ISP mail server. Now it seems I am going to need some of my users to have their email "forwarded" to an outside email address. Any ideas on how I can make this happen?

Thanks,
Eric
Title: Re: Block email to outside Domains
Post by: CharlieBrady on May 09, 2015, 06:33:47 AM
Any ideas on how I can make this happen?

Custom template for /var/qmail/control/smtproutes to send the particular outside domain to a particular smtp server.
Title: Re: Block email to outside Domains
Post by: fastxl on May 11, 2015, 03:46:16 PM
Charlie,
Thanks for the direction. Here is what I plan to do.

mkdir –p /etc/e-smith/templates-custom/var/qmail/control

nano smtproutes

mail-to-domain.com:relay-mail-server.com
:fake.mail.server.com

signal-event email-update

Am I correct that all mail to “mail-to-domain.com” will be forwarded to “relay-mail-server.com? And all else will be returned because it is a “dummy” server? Can I narrow it down to a specific user? Can I have a line in the smtproutes file like john.doe@mail-to-domain.com:relay-mail-server.com?

Thanks,
Eric
Title: Re: Block email to outside Domains
Post by: CharlieBrady on May 11, 2015, 03:55:45 PM
Can I have a line in the smtproutes file like john.doe@mail-to-domain.com:relay-mail-server.com?

No.

http://www.qmail.org/man/man8/qmail-remote.html