Skip to content

rd remote.8

Manvendra Bhangui edited this page Aug 25, 2026 · 6 revisions

NAME

rd-remote - Redirect remote mail to another address or a Maildir

SYNOPSIS

rd-remote host sender qqeh size recip

DESCRIPTION

rd-remote reads a mail message from its input and redirects mail to another address or a maildir. The redirection is based on rules in control file redirectremote on a match with one of destination domain, sender address or recipient address. It has the same interface as qmail-remote(8). The control file redirectremote has four colon separated fields addr, type, dest, prefix. dest can be an email address or a Maildir. When dest is an email address, rd-remote calls qmail-remote after adjusting argv[1] to be the new destination domain and argv[5] to be the new recipient. When dest is a Maildir, rd-remote uses maildirdeliver(1) to deliver the mail. The last field prefix is optional. The control file format is discussed below.

addr:type:dest[:prefix]

Here addr is destination domain when type is the letter 'd'. addr is the recipient address when type is the letter 'r'. addr is the sender address when type is the letter 's'.

dest can be an email address or a Maildir. When dest is an email address, the mail is delivered to the address using qmail-remote. When dest is a maildir, the mail is directly delivered to the Maildir dest using maildirdeliver(1). addr can be an exact match, wildcard or a regular expression (if QREGEX environment variable is defined and is non-zero). So if addr is .*@example.com, it will match all addresses belonging to example.com (for type 'r' or 's'). When type is 'd', you can use the regex .*example.com for addr to match all address with example.com as the domain name.

prefix is optional. If given rd-remote uses prefix-recip as the value for the Delivered-To header. If not given, sender-recip is used as the value for the Delivered-To header.

You can set QREMOTE=/usr/sbin/rd-remote for spawn-filter(8) to make it use rd-remote instead of qmail-remote for remote deliveries and deliver the mail to dest instead of the original recipient.

rd-remote can be used to tempararily redirect mails for a busy/ratelimited remote mailserver to a Maildir and later use maildirsmtp(1) or maildirserial(1) and serialsmtp(1) to do the remote delivery with a lower concurrency.

EXAMPLES

Redirect remote mails to the domain indimail.org to the address
reservoir@xxyyyzz.com

in control file redirectremote
indimail.org:d:reservoir@xxyyyzz.com

Redirect remote mails addressed to xxyyyzz@indimail.org to the address
reservoir@xxyyzz.com

in control file redirectremote
xxyyyzz@indimail.org:r:reservoir@xxyyyzz.com

Redirect mails from sender xxyyyzz@indimail.org to the address
reservoir@xxyyzz.com

in control file redirectremote
xxxyyyzz@indimail.org:s:reservoir@xxyyyzz.com

Redirect mails from sender xxyyyzz@indimail.org to the Maildir
/home/mail/reservoir/
(NOTE. Maildir should be owned by user qmailr)

in control file redirectremote
xxxyyyzz@indimail.org:s:/home/mail/reservoir

LIMITATIONS

Unlike qmail-remote, rd-remote cannot handle more than one recipient. But that is OK when used with indimail-mta as qmail-rspawn never invokes qmail-remote with more than one recipient. If used in scripts to send an email to multiple recipients, you cannot use rd-remote. Instead you will have to loop it for each recipient and call rd-remote for each of the addresses.

SEE ALSO

qmail-remote(8), spawn-filter(8),

AUTHORS "Manvendra Bhangui" <mbhangui@gmail.com>.

Clone this wiki locally