Hi, Im trying to implement a mail gateway using postfix, and I am having trouble preventing it from relaying.

The box is not available to the net now, I am just testing it via telneting to port 25 and sending mail that way. Problem is, it attempts to deliver mail to domains which have not been specified as allowed. Maybe I am missing something major, and making a stupid mistake(I have never used postfix before), but I hope someone can help me.

Here is my current main.cf I took all the comments out to save some space here. I was under the impression that postfix would only relay mail to domains which were specified in relay_domains. I am trying to relay mail for obfuscated.com(not really) and it never seems to stop the other messages.

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = mail.obfuscated.net
mydomain = obfuscated.net
myorigin = $myhostname
inet_interfaces = all
notify_classes = resource, software
disable_dns_lookups = yes
initial_destination_concurrency_limit = 3
default_destination_concurrency_limit = 12
queue_minfree = 6144
relay_domains = obfuscated.com
masquerade_domains = $mydomain
masquerade_exceptions = root

Thanks in advance.

Nevermind, it seems that postfix by default allows relaying from the same subnet on which it resides. if you set

mynetworks_style = host

it will stop trusting any thing for relaying except for the local host.