rblsmtpd - block mail from RBL-listed sites and unwanted sources


rblsmtpd opts prog


rblsmtpd works with any SMTP server that can run under tcpserver. It accepts a series of getopt-style options opts while prog consists of one or more arguments.

Normally rblsmtpd runs prog. prog is expected to carry out an SMTP conversation to receive incoming mail messages.

However, rblsmtpd does not invoke prog if it is told to block mail from this client. Instead it carries out its own limited SMTP conversation, temporarily rejecting all attempts to send a message. Meanwhile it prints one line on descriptor 2 to log its activity.

rblsmtpd drops the limited SMTP conversation after 60 seconds, even if the client has not quit by then.


Blocked Clients

If the RBLSMTPD environment variable is set and is nonempty, rblsmtpd blocks mail. It uses $RBLSMTPD as an error message for the client. Normally rblsmtpd runs under tcpserver; you can use tcprules to set RBLSMTPD for selected clients.

If RBLSMTPD is set and is empty, rblsmtpd does not block mail.

If RBLSMTPD is not set, rblsmtpd looks up TCPREMOTEIP in the RBL, and blocks mail if TCPREMOTEIP is listed. tcpserver sets up TCPREMOTEIP as the IP address of the remote host.

You may supply any number of -r and -a options. rblsmtpd tries each source in turn until it finds one that lists or anti-lists TCPREMOTEIP.

If you want to run your own RBL source or anti-RBL source for rblsmtpd, you can use rbldns from the DNScache (djbdns) package.

SMTP Replies

Normally, if RBLSMTPD is set, rblsmtpd uses a 451 error code in its limited SMTP conversation. This tells legitimate clients to try again later. It gives innocent relay operators a chance to see the problem, prohibit relaying, get off the RBL, and get the mail delivered.

However, if RBLSMTPD begins with a hyphen ('-'), rblsmtpd removes the hyphen and uses a 553 error code. This tells legitimate clients to bounce the message immediately.

There are several error-handling options for RBL lookups:

Interrogation Mode

rblsmtpd may be used to only query RBLs and to present the results to qmail-smtpd in an interrogation mode.

Greetdelay Options

Introduce a certain delay in the SMTP connection; either before or after the RBL, the anti-RBL lookups respectively, depending whether this option is defined before or after the lookups.

IPv4/IPv6 inverse nibble format

rblsmtpd constructs from the incoming IP address TCPREMOTEIP it's inverse nibble format, depending on the setting of PROTO. If PROTO=TCP the standard inverse IPv4 address scheme is used, whereas in case of PROTO=TCP6 the IPv6 inverse nibble format is computed based on the expanded IPv6 address:

fe80::1 =>

IPv4-mapped IPv6 addresses

rblsmtpd recognizes IPv4-mapped IPv6 addresses and strips the IPv6 prefix piror to build the IPv4 inverse address for the RBL lookup.


tcpserver(1), tcprules(1), tcprulescheck(1), fixcrio(1), recordio(1), rblsmtpd(1), tcpclient(1), who@(1), date@(1), finger@(1), http@(1), tcpcat(1), mconnect(1), tcp-environ(5)