Other Free Email Stuff
Here I've put more 'minor' patches. At present there is only the NORCPTHOSTS patch:
NORCPTHOSTS patch
Overview
This simple patch adds a switch (via an environment variable) to qmail to disable rcpthosts[.cdb], so qmail refuses mail until relaying is enabled, typically via an additional SMTP AUTH patch. This is useful if you're using the same machine with different ports to handle both MX traffic (mail in) and relaying (mail submission) with SMTP AUTH. Setting the NORCPTHOSTS environment variable (for mail submission) disables rcpthosts and rcpthosts.cdb.
With this patch, you can use various filters such as RBL blacklists or greylisting on the MX service, whilst the mail submission service relies on authentication. Users connecting from blacklisted locations can still send mail since they authenticate to access the service.
Note that instead of using this patch, you may prefer to patch the ofmipd program from the mess822 package for SMTP AUTH as a replacement for qmail-smtpd (John Levine offers one such patch for ofmipd). ofmipd is generally a better fit for a mail submission service.
Typical Application
This patch is relevant if you want to have a single qmail installation providing an authenticated relaying service and acting as an MX for one or more domains - these two services being on separate ports or addresses.
Relay: The relaying service uses SMTP AUTH (or some other form of authentication) which enables qmail-smtpd to accept mail for delivery once authenticated. No mail is accepted prior to authentication to prevent spammers being able to use this service to spam your domains. Note that having RELAYCLIENT set overrides NORCPTHOSTS.
MX: The same instance of qmail can also be used for the MX service on the same machine - mail is accepted for domains in rcpthosts[.cdb]. To limit spam, filters can be used (rblsmtpd, greylisting etc).
Download
Download the patch here.
Installation
Change into your qmail source directory, put the patch there then type,
patch < qmail-1.03_norcpthosts.patch
The patch should apply cleanly against qmail-1.03 or netqmail-1.05.
Re. some of the popular patches, this patch shouldn't clash with any of: Dabrowski/Johnston SMTP AUTH, Hoffmann SMTP AUTH, Russ Nelson's virusscan. There's a small conflict with Paul Jarc's realrcptto patch if you use that, but this is easily fixed by hand (apply realrcptto first in this case for the minimal amount of work).
Usage
For the relaying port/address, ensure NORCPTHOSTS is set (to "") - either as part of the run script or in a cdb if you're using tcpserver's -x option.
For the MX port/address, neither NORCPTHOSTS nor RELAYCLIENT should be set.
Also please see the "Typical Application" section above.
Status / Warranty
No warranty, express or implied is given - USE THIS SOFTWARE ENTIRELY AT YOUR OWN RISK. You will need to satisfy yourself as to the suitability of this software before deploying it in a production environment.
This page last updated: AR, 6th February 2008.
