postfix: block emails to external addresses

4 posts / 0 new
Last post
#1 Sun, 02/10/2013 - 03:32
Johnster

postfix: block emails to external addresses

I have two virtual hosts on one server. One of the hosts is used for internal networking only and the other host is an external site.

Eventually email will be used on both hosts but at the moment the internal host is the only one running email.

Emails are working fine through VPN. The issue is I am able to send emails from this internal host to real external FQDN email addresses. Is there a way restrict these email accounts from doing this?

I read that a possibility could be 'recipient_dependent_relayhost_maps' but I can't figure out the syntax or if you add it to 'Restrictions on recipient addresses'.

Thanks for any help.

Ubuntu Linux 12.04.2 Webmin version 1.610 Virtualmin version 3.98.gpl GPL

Mon, 02/11/2013 - 06:48
miner

Hi Johnster,

The problem as described, "The issue is I am able to send emails from this internal host to real external FQDN email addresses. Is there a way restrict these email accounts from doing this?" is not clear.

Please clarify.

Mon, 02/11/2013 - 15:10
Johnster

Hi miner,

Thanks for responding, I was wondering if there was a way to block users on one virtual host from sending email outside their domain?

Or is it better to somehow block the virtual host from communicating to the outside world. Only allow incoming/outgoing connections from localnets?

Hopefully that clears up the aim.

Mon, 02/18/2013 - 16:56
miner

Try using a transport(5) table:

/etc/postfix/main.cf
    transport_maps = hash:/etc/postfix/transport

etc/postfix/transport:
    example.org  :
    *      error:destination unauthorized
Topic locked