File: antirelay_check_rules_example

package info (click to toggle)
smtpd 2.0-8
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 432 kB
  • ctags: 298
  • sloc: ansic: 4,164; makefile: 121; sh: 87
file content (36 lines) | stat: -rw-r--r-- 1,709 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# A simple anti-relay only example. Make sure you don't get used as a third
# party relay to spam other unfortunate people and grind your server
# to a halt dealing with the complaints. 

# assumes we are "my.domain". - edit for your own use.

# If we have JUNIPER_SUPPORT, we can allow through stuff based on 
# what sort of interface it arrived on. This says we will relay
# for any connection on a trusted interface.
#allow:TRUSTED:ALL:ALL

# Don't allow people to %hack relay off of me.
noto:ALL:ALL:*%*@*:551 Sorry %H (%I), I don't allow unauthorized relaying. You can't use me to send mail from %F to %T.
noto:ALL:ALL:*!*@*:551 Sorry %H (%I), I don't allow unauthorized relaying. You can't use me to send mail from %F to %T.
noto:ALL:ALL:*@*@*:551 Sorry %H (%I), I don't allow unauthorized relaying. You can't use me to send mail from %F to %T.

# If we have NS_MATCH=1 compiled in, we can do it this way, by allowing
# the relay mail outbound from hosts that have dns.my.domain as one of
# their nameservers. this might be useful if we sit in front of a 
# lot of domains.
allow:NS=dns.my.domain:ALL:ALL
# alternatively, if we don't want to use NS_MATCH, we can simply allow 
# all hosts ending in my.domain to relay through me.
allow:*my.domain:ALL:ALL

# If we have NS_MATCH=1 compiled in, we can again, match on the nameserver
# accepting mail for any address where the RHS uses us as a nameserver.
allow:ALL:ALL:NS=dns.my.domain
# alternatively, allow anything ending in my.domain.
allow:ALL:ALL:*my.domain

#
# punt anything else, we won't relay for people we don't know.
#
noto:ALL:ALL:ALL:551 Sorry %H(%I), I don't allow unauthorized relaying. Please
use another SMTP host to mail from %F to %T