summaryrefslogtreecommitdiff
path: root/libexec/spamd/spamd.c
AgeCommit message (Collapse)Author
2007-11-03PR 5621 - spamd doesn't clear the last entry from an empty TRAP list,Bob Beck
noticed and patch from Piotr Sikora <piotr@sikora.nu>
2007-04-13fix helo to error out if no domain is providedBob Beck
ok millert@
2007-03-26use new license, ok deraadt@Bob Beck
2007-03-26Copyright - I should share the blame.Bob Beck
2007-03-26A couple of spamd improvementsBob Beck
1) Implement the NOOP command, which now seems necessary for certain windows mail wrappers and sender verification schemes. Tested by me and sidcarter@symonds.net, who noticed the problem on his site. ok millert@ 2) Change the behaviour of the maxblack parameter, instead of hanging up immediately on new blacklisted connections when the maxblack parameter is reached, we instead make spamd not stutter at them, so the connection is instead completed quickly. This seems to handle peaks and spikes much better than the old way of doing this. ok deraadt@, with some man page changes by jmc@
2007-03-07sync usage(); ok deraadtJason McIntyre
2007-03-06Add -M option to specify a local address that is a lower priority MXBob Beck
address than the primary one. spamd will trap hosts that contact this address first without first contacting the primary. - get it in, deraadt@
2007-03-06Make the maximum number of connections dependant on kern.maxfiles ratherBob Beck
than a hardcoded value. ok reyk@, deraadt@ with knfisms and saner variable names
2007-03-05remove -r option that didn't work anyway.Bob Beck
ok jmc@, reyk@
2007-03-05revert unintentional MAXCON change back to 800, accidentally did lastBob Beck
commit with the U of A value, which may not be safe on all GENERICs with an unmodified kern.maxfiles
2007-03-04Database synchronizaton for spamd/spamlogdBob Beck
This adds an HMAC protected synchronization protocol for use by spamd and spamlogd. - spamd can receive updates from other hosts for GREY, WHITE, and TRAPPED db entries, and will update the local /var/db/spamd accordingly. - spamd can send updates when it makes changes to the GREY or TRAPPED entries in the db to other hosts running spamd. (Note it does not send WHITE entries because the other spamd will see the GREY changes and have complete information to make appropritate decisions) - spamlogd can send updates for WHITE db entries that it performs on the local db to other hosts running spamd, which will then apply them on remote hosts. note that while this diff provides synchronization for changes made to the spamd db by the daemons, it does *not* provide for sychonizing changes to the spamd db made manually with the spamdb command. Synchronization protocol and most of the work by reyk@, with a bunch of the spamd, and spamlogd stuff by me. testing mostly at the U of A, running happily there under big load. ok reyk@ jmc@
2007-02-27spacingTheo de Raadt
2007-02-27fix -b breakage - make greylisting actually be on by defaultBob Beck
2007-02-27sort options and usage();Jason McIntyre
2007-02-27Flag day for spamd -Bob Beck
1) config files move to /etc/mail 2) -g option goes away in spamd-setup and spamd - greylisting is now the default 3) option change to spamd, -b addr becomes -l addr. 4) -b option in spamd-setup and spamd to turn on old blacklisting mode. Man page shortly to be flensed to make this easier to explain ok deraadt@ millert@
2007-02-23Make spamd include the HELO/EHLO identification string sent byBob Beck
the connecting hosts in the tuple key when greylisting. catches a few more bogus hosts and will let us trap based on HELO later. Changes spamdb(8) output to include the new field. ok deraadt@, jmc@
2007-02-23continue collecting lint to be sold as a parsley substitute; ok beckTheo de Raadt
2007-02-23greytrapping improvementsBob Beck
1) remove requirement for <> around spamtrap addresses 2) add support for /etc/spamd/alloweddomains to specify suffixes for which any destinations that don't match get trapped various knf's by theo, feedback from jmc, millert, deraadt
2006-11-27Make spamd error out for a greylisted session only after the DATABob Beck
command not after the RCPT command, as this helps people out when they are faced with retarded sender verification schemes - tested out by a number of people on tech@, and running at u of a for a while. Supposedly this makes verizon sender verification happy. Suggested as a stable candidate by people on tech@, I'm ok with that.
2006-10-29use setresuid/gid and check for failure, ok bobHenning Brauer
2006-05-15add an -h option to override the hostname that is reported in thejoshua stein
SMTP banner ok beck@
2006-03-14spamd can show the wrong IP address to clients in a %A message becauseBob Beck
the per-connection copy of the connecting address was being pointed to the on-stack copy. Spotted (and fix suggested) by Michael Durket in pr 5046 ok deraadt@
2005-11-30some cleanups prompted by lint, no really nasty bugs; ok beckTheo de Raadt
2005-11-12spacingTheo de Raadt
2005-08-04Fix handling of empty entries at the end of an address list; avoidsOtto Moerbeek
always skipping the last address. ok beck@
2005-05-23have to ignore SIGPIPE in the child too or a spammer can kill spamd just byMike Frantzen
closing the connection while we're trying to write to it
2005-04-16missing getopt choice; from dennisTheo de Raadt
2005-04-14Make spamd stutter at greylisted connections for a short period before talkingBob Beck
full speed. By default do this for 10 seconds. Many spammers disconnect by then. Adds -S option to select the amount of time greylisted connections will be stuttered at. feedback from jmc@, deraadt@, ok deraadt@
2005-03-11"Greytrapping" for spamd - allow for spamd greylisting to maintainBob Beck
a list of spamtrap destination addresses in the spamd database. When a spamtrap address gets an attempted greylist delivery, blacklist the offending host for a day. Does not affect hosts already whitelisted. ok deraadt@, jmc@, dhartmei@ to get it in so it can be whacked on
2004-11-17- \r\n fix for QUIT commandBob Beck
- Implement RSET in spamd - some virus scanning products (notably symantec's viruswall) spew a RSET into the smtp stream before every attempted delivery. (noticed by reitenba@fh-brandenburg.de and some others). This ensures such things can successfully talk to a spamd greylister. ok millert@ henning@
2004-10-05change default to 451 for greylisting, thanks to a number ofBob Beck
people on misc, and some observations by Evan harris on the greylisting mailing list that a number of clustered mailers like aol behave better (and retry from the same IP) when they see a 451, but do not when they see a 450 (traditionally used for mailbox lock failure) 450 was the original for spamd, as the default for the tarpit is to encourage quick retries to punish blacklisted smtp servers more. This got carried over to the greylisting implementation, and isnt' really optimal for that case. ok millert@, henning@, todd@
2004-09-18This should be info, from mike@tric.ruBob Beck
ok henning@
2004-08-17impliment QUIT, beck okHenning Brauer
2004-08-08spacingTheo de Raadt
2004-07-04typo; andrushock@korovino.netTheo de Raadt
2004-06-29absolutely no need to include machine/endian.h after sys/types.h and ↵Michael Shalayeff
sys/types.h after sys/param.h
2004-06-21use getaddr/nameinfo for address resolution. beck, henning okJun-ichiro itojun Hagino
2004-04-03fix logging. without -v, you get just the connection level, no mail data.Daniel Hartmeier
with -v, you get From/To/Subject at LOG_INFO, and the first ten body lines at LOG_DEBUG. ok beck@
2004-04-02nextstate() can get passed a read(2) chunk containing multiple lines,Daniel Hartmeier
so separate lines before logging headers/body. doesn't make logging more verbose, just fixes the case where chunks contain multiple lines. ok beck@
2004-03-17fix problem with counter and logging spotted by danh, where loggingBob Beck
would get messed up when the blacklist limit was hit. tested by danh@ and me ok cedric@
2004-03-16sort options and escape a minus sign;Jason McIntyre
2004-03-15Add -B option, with maxblack limit to limit the number of blacklistBob Beck
connections to something less than maxcon when greylisting. This ensures you don't completely run out of connections tarpitting spammers, and not allow real mail through. ok dhartmei@ millert@
2004-03-14make window size adjustement on sockets only after the DATABob Beck
connection. This ensures that greylisted connections are not delayed by a small windows size, but blacklisted connections still have to send the body through a tiny window, and presumably the body is the vast majority of what is being sent anyway. ok dhartmei@ millert@
2004-03-13Add signal handler to parent, so that when greylisting we don't need toBob Beck
kill all three processes to make it go away. Adjust daemon() call and logging appropriately. ok henning@, millert@
2004-03-12paranoia and cleanup, ensure we use free then NULL everywhere.Bob Beck
ok millert@ dhartmei@
2004-03-11fix bug where custom 450 messages are not displayed,Bob Beck
found by yongari@kt-is.co.kr ok dhartmei@, millert@
2004-03-10fix missing space, also fromBob Beck
yongari@kt-is.co.kr ok deraadt@
2004-03-10add -b option to specify local bind address, sent byBob Beck
yongari@kt-is.co.kr ok deraadt@
2004-02-28- ensure greylist entry expiry is not updated until actually whitelistedBob Beck
to avoid keeping multiple grey entries around from a single host for extra time. - make -G work - paranoia and cleanup suggestions from deraadt@ ok millert@
2004-02-26paranoia; beck okTheo de Raadt