Version 1.00: added smtp/qmtp proto for qmail Version 1.01: Retrieve sender, dst and IP from Enviroment Variables which must me set by qmail-smtpd or tcpserver daemontools Version 1.02: Check if sender is Null Sender as allowed by RFC 821 Version 1.03: Add make install, deinstall and clean to Makefile Version 1.04: Identify unique MSG ID Version 1.05: Recorde one-line log entry to /var/log/qmail-sf.log which should be owned by qmaild and have rw permission Version 1.06: softfail.h to store user-defined constants Version 1.07: separated DEBUGTLOG to produce detailed logging from LOGTXT to produce one-line log entry Version 1.08: Now we do five instead of three checks per message Version 1.09: LOGTXT doesn't exist anymore; it became default; now qmail-sf is able to run (and identify it) from SMTP, QMTP or QMQP sessions; fixed some horrible core dump when someone tried to run qmail-sf on the CLI; Version 1.10: Now we *finally* can say we do greylisting instead of only forcing greylisting basics with soft failure; more than 4xx code, we now detect abuse and automatically move the abusing host from greylist to blacklist; this is the deal behind greylisting: deciding weather it fits a white or a black list. Two more user-oriented defines were added, RFCSEENTIME and SEENCONSECMAXTIME Version 1.11: Created rotate-softfail-db to improve database maintainance this program Version 1.12: fixed rotate-softfail-db, second query was out of sync Version 1.13: reorganized everything, created README, CHANGELOG and COPYRIGHT files, revamped Makefile, added PREFIX and QMAIL_PREFIX for customization (and FreeBSD ports' lintage), added a minor change on database queries regarding messages already seen, and made RFCSEENTIME = 70 by default, which in production has shown to be a more appropriated value. Version 1.14: more Makefile customization to fit FreeBSD's organization. Version 1.15: more Makefile customization, decide to "cat crontab" instead of echo'ing it to /etc/crontab, for compatibility reasons and also lowered RFCSEENTIME to 30 seconds by default. Defined ${LOCALBASE} to avoid patching on FreeBSD Ports Collection. Added timestamp on logging information. Changed default value of SEENCONSECMAXTIME to 15 (proven to cause less false-positive). Added ${LOCALBASE} to Makefile to satisfy FreeBSD organization. Added -b, -f and -h options to rotate-softfail-db program. Added conf.h, which is now the default way to configure softfail, and not softfail.h anymore. Updated README file to reflect all new changes. Version 1.16: Removed unecessary expiry information from logs which was leading users to get confused due to reversed nature of information; Fixed rotate-softfail-db: -h option was causing unknown options to be triggered; default behavior (without arguments) was deleting all automatically added entries from instead of only black ones. Changed MAXDAYSAUTOINDB name to MAXDAYSAUTOBLACKINDB because the previous name was not clear about what it does. Changed README to reflect the updates. Version 1.17: Users asked, and now SFSEENTIME enviroment variable, if existing, overrides hardcoded RFCSEENTIME, and SFMAXSEENTIMES if existing, overrides hardcoded SEENCONSECMAXTIME. It makes Soft Fail easier to be adjusted, based upon each company´s mail usage profile and what they think may be considered abuse or not. Changed README to reflect the updates. Version 1.18: Users liked the later changed and asked for more. Now SFGLTIME (Soft Fail GreyListing Time) enviroment, if existing, overrides hardcoded UNBLOCK_AFTER_SEEN. If makes thing very flexible, specially for users who want to have distinct GL policy per host, using tcprules(1) cdb file. Logging is changed a little to give this new informations. Now, every "Doesn't Exists Block" log entry prints "Doesn't Exists Block (Ns)" where N will print the value of UNBLOCK_AFTER_SEEN (or SFGLTIME enviroment, the one with precedence). When hosts try to delivery again before SFSEENTIME, logging information will print "(N/M)" reading N early delivery attempts out of M, where M is SFMAXSEENTIMES. Version 1.19: Added whitelisting based on sender domain, which is, by nature, an unsafe approach and should be used with care, since sender domain can easily be forged on envelope headers. Added this feature because some users requested. Avoid using it on uncontrolled enviroments. Version 1.18: Changed defaults on softfail.h because since 1.19 changes we count SFGLTIME in seconds, not minutes anymore. Just a minor change. TODO: There are, at least, two ways to follow RFC breakage from a host: (1) absolute number of times based on RFCSEENTIME or (2) consecutive number of times based on RFCSEENTIME. By default the second one is used. To use the first one, we would decrease earlyseen_cnt count upon RFC compliant delivery retrial instead of reseting it to zero like we do now. It is hardcoded in this current version of FreeBSD Brasil's Soft Fail. A good approach would make it user-configurable. To make it a good choice regarding qmail-sf's behavior, SEENCONSECMAXTIME shall be decreased at least by one half. NEEDS TESTING to see if it is more efficient than the current approach under some circunstances. Patrick Tracanelli,