1

I have a local postfix server, and i want it to only relay emails to the only local domain (localdomain.be):

myhostname = localdomain.be
mydomain = localdomain.be
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $myhostname
mydestination = $myhostname

relay_domains = $mydomain
default_transport = smtp
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.0.0.0/24
mailbox_size_limit = 64000000
message_size_limit = 1000000
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtp_host_lookup = native

This configuration works fine to allow relay mail locally and on external destination domains, but i would like it to be an impossibility to send to other domains (ie: gmail.com).

relay_domains is supposed to ensure that but it does not seem to really filter since i can still send to my gmail address.

1
  • Are you testing ("i can still send to my gmail address") from outside or from inside? Clients within $mynetworks are exempt from some restrictions. Feb 9, 2011 at 14:56

1 Answer 1

0

Set up /etc/postfix/transport like so:

mydomain.com :
*               error:mail for * is not deliverable

postmap /etc/transport

and in main.cf put

transport_maps = /etc/postfix/transport

and then postfix reload

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .