Skip to content

rd remote.8

Manvendra Bhangui edited this page Feb 25, 2024 · 4 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]

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).

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.

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

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 examplecom (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.

You can set QREMOTE=/usr/sbin/rd-remote for spawn-filter(8) to make it use rd-remote for remote deliveries and deliver the mail locally.

rd-remote is useful when you want to tempararily redirect mails for a busy/ratelimited remote mailserver to a Maildir and use maildirsmtp(1) or maildirserial(1) and serialsmtp(1) to do the remote delivery later with low concurrency.

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-remopte.

SEE ALSO

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

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

Clone this wiki locally