srsreverse - reconstruct the original address from its SRS extension and forward bounce mail
in .qmail: |srsreverse
Upon reception by qmail-smtpd, qmail-local may feed a locally delivered bounce email through srsrevers in order to reconstruct the original sender from the received SRS address provided in the local part and to forward the bounce mail to its original address.
In order to accept emails for SRS modified return addresses, you need to setup those in rcpthosts. If your domain is example.com in rcpthosts you probably want to set up additionally srs.example.com. However, .example.com would be fine as well.
SRS can facilitate a virtual user typically named srs and thus requires an entry like srs.example.com:srs in virtualdomains.
srsreverse is called from a dot-qmail file which could be /var/qmail/alias/.qmail-srs-default.
srsreverse reads the control file virtualdomains to exfiltrate the (virtual) SRS user name for the received domain, if given. With the evaluated srsdomain, srsrevers fetches the SRS secret from srsdomains in order to validate the SRS bounce address.
srsrverse reads the environment variables DTLINE, HOST, and RECIPIENTS. HOST is used to determine the srsdomain. The forwarding bounce address is reconstructed from the local part of RECIPIENTS.
The Sender Rewriting Scheme SRS can be considered as tailored form of VERP: Variable Envelope Return Path. The chosen primary delimiter = is recognized by qmail-smtpd’s recipient extension.
srsreverse uses srs2.c from libsrs2.
srsforward(1), dot-qmail(5), qmail-command(8), qmail-queue(8), qmail-send(8).