postfwd.cf.j2 994 Bytes
Newer Older
1
# lower rate limit for certain authenticated users
Florian Pritz's avatar
Florian Pritz committed
2
&&SASL_WHITELIST {
3
4
5
6
7
8
	# other servers relay via orion using authentication. username is the
	# hostname part of the fqdn
{% for host in groups['all'] %}
	sasl_username={{ hostvars[host].inventory_hostname_short }}
{% endfor %}
	# add other usernames to bypass rate-limits here:
Florian Pritz's avatar
Florian Pritz committed
9
10
11
	sasl_username=devnull;
};

12
# lower rate limit for certain users
Florian Pritz's avatar
Florian Pritz committed
13
14
15
id=SaslWhitelist;
	protocol_state==END-OF-MESSAGE;
	&&SASL_WHITELIST;
16
	action=rcpt(sasl_username/300/10800/REJECT You can only send to 300 recipients per 3h per user)
Florian Pritz's avatar
Florian Pritz committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
id=SaslWhitelist2;
	protocol_state==END-OF-MESSAGE;
	&&SASL_WHITELIST;
	action=dunno;

# sasl_username != doesn't work for whatever reason
id=RcptRate;
	protocol_state==END-OF-MESSAGE;
	sasl_username!~/^$/;
	action=rcpt(sasl_username/100/21600/REJECT You can only send to 100 recipients per 6h per user)

# this causes postfwd to log something for every mail; easier testing
id=logging;
	protocol_state==END-OF-MESSAGE;
	action=dunno;