Barricade MX
smtpf/2.1
|
| IPv4 Lookup | IPv6 Lookup | |
|---|---|---|
| tag:192.0.2.9 | tag:2001:0DB8:0:0:0:0:1234:5678 | |
| tag:192.0.2 | tag:2001:0DB8:0:0:0:0:1234 | |
| tag:192.0 | tag:2001:0DB8:0:0:0:0 | |
| tag:192 | tag:2001:0DB8:0:0:0 | |
| tag:2001:0DB8:0:0 | ||
| tag:2001:0DB8:0 | ||
| tag:2001:0DB8 | ||
| tag:2001 |
Note that the compact form of an IPv6 address, "2001:0DB8::1234:5678", cannot be used.
Only the full IPv6 address format, with all intervening zeros, is currently supported.
| tag:[ipv6:2001:0DB8::1234:5678] |
| tag:[192.0.2.9] |
| tag:sub.domain.tld |
| tag:domain.tld |
| tag:tld |
| tag: |
Note that the bare tag is often used to specify system wide defaults.
| tag:account@sub.domain.tld |
| tag:sub.domain.tld |
| tag:domain.tld |
| tag:tld |
| tag:account@ |
| tag: |
Note that the bare tag is often used to specify system wide defaults.
The following list outlines the available tags and their supported key lookups:
REJECT), the connection
will be dropped. If white listed (OK), then the messages from this connection
by-passes all the filtering except anti-virus. The connection can also be "grey-listed"
(CONTENT), similar to dns-gl, which
only white lists a connection as far as, but not including, the data content filters.
REJECT),
mail from this sender is refused. If white listed (OK), then the messages from
this sender will by-pass all the filtering except anti-virus. Black listing using
this tag is fine, but white listing is not recommended as it is too easy
for someone to fake the sender address.
When there are multiple message length limits possible, then the limit applied, in order of precedence is:
messages '/' time [unit]
which is the number of messages per time interval. The time unit
specifier can be one of week, day, hour, minute, or seconds (note
only the first letter is significant). A negative number
for messages will disable any limit.
When there are multiple message limits possible, then the limit applied, in order of precedence is: Msg-Limit-To:, Msg-Limit-From:, and Msg-Limit-Connect.
hotmail.com.
In some cases
when a third party mail system rejects spam or virus mail during the
SMTP session, a DSN (bounce message) is generated and sent back to the
false sender. Since spammers typically send millions of messages with
falsified sender addresses, the mail system of the abused domain can
be swamped by the backscatter. smtpf's
EMEW facility was designed in
part to help with backscatter, but cannot be deployed in some mail
system archietures.
So smtpf provides another mechanism to help with backscatter situations, where smtpf monitors the rate of DSN or MDN messages (essentially any message from the "null sender") arriving per minute and rejects such messages above a certain threshold that can be configured globally, by domain, and by recipient.
OK is used, then the message is not processed by spamd.
REJECT),
mail to this recipient will be refused; the current message transaction is permitted
to specify addition recipients or abandon the transaction. If white listed (OK), then
the message will by-passes all the filtering except anti-virus.
It should be noted that black & white listing with Connect:, Connect:From:, Connect:To:, From:, From:To:, and To: take effect immediately in the SMTP state they apply to. This can be changed by enabling smtp-delay-checks which delays policy rejections until the recipients have been specified with the possibility to white list. The auth-delay-checks option can be used to delay the connection and EHLO related tests until a MAIL FROM: is received allowing for an SMTP AUTH command to be issued.
When a key lookup matches, then the value returned is a pattern list, which in
its simplest and most common form is either an action word like
OK, BODY, DISCARD, NEXT,
REJECT, SPF-PASS, or SKIP;
or a numerical value depending on the tag involved. For example:
Connect:192.168.0 OK GreatPause:bargainsrus.com 30000
The action words supported are:
OK white list, by-pass one or more tests CONTENT white list as far as, but not including, the content filters;
used only with Connect:DISCARD accept & discard message NEXT resume lookup, opposite of SKIP SKIP stop lookup & return no result SPF-PASS white list sender if SPF returns Pass;
used only with Connect:From: and From:REJECT black list, either reject or drop
In most instances, the above forms of key lookup and values are sufficient. However, there may be times when finer granularity of control is required, in which case pattern lists can be used. A pattern list is a white space separated list of pattern-action pairs followed by an optional default action. The supported types are:
[network/cidr]action Classless Inter-Domain Routing
(only with IP address lookups)!pattern!action Simple fast text matching. /regex/action Extended Regular Expressions.
The simple pattern matching, !pattern!, uses an asterisk (*) for a wildcard, scanning over zero or more characters; a question-mark (?) matches any single character; a backslash followed by any character treats that character as a literal. This method always tries to match the beginning and end of string. For example:
!abc! exact match for 'abc' !abc*! match 'abc' at start of string !*abc! match 'abc' at the end of string !abc*def! match 'abc' at the start and match 'def' at the end, maybe with stuff in between. !*abc*def*! find 'abc', then find 'def'
The following is an example using a simple pattern to reject client connections that originate from a range of IP addresses of an ISP assigned to ADSL customers. Using a pattern like this allows you to drop connects from the ISP's ADSL, while still accepting connections from mail and web servers.
Connect:hananet.net !adsl-*-*.usr.hananet.net!REJECT
If you know that an ISP's mail and web servers follow a standard naming convention, you might prefer to only accept mail from those instead. We include web servers here to handle the case where a web server might have to send a mail response based on a form being filled in.
Connect:hananet.net !smtp*.hananet.net!OK !www*.hananet.net!OK REJECT
Note that SPF was designed to help mail servers identify originators of mail, so creating patterns as shown in the above two examples is not normally required. However, SPF is still considered experimental and not as widely deployed as one might hope.
The next example, /regex/, uses Extended Regular Expressions to validate the
format of the local-part of an AOL address, which must be between 3 and 16
characters long, can contain dots and RFC 2822 ``atext'' characters except % and /.
The NEXT word allows the one regular expression to validate the format of the address and resume key lookup if the
pattern matches; otherwise if the regular expression failed to match, REJECT the suspect aol.com address.
From:grandma@aol.com OK
From:aol.com /^[a-zA-Z0-9!#$&'*+=?^_`{|}~.-]{3,16}@aol.com$/NEXT REJECT
The discussion of Extended Regular Expressions is vast and complex, well beyond the scope of this document. There are many on-line tutorials and references available and the book Mastering Regular Expressions, 3e from O'Reilly covers the topic in depth.
If you need to use a pattern list, then try and follow these suggestions:
- TOP -