summaryrefslogtreecommitdiffstats
path: root/libexec/spamlogd
AgeCommit message (Collapse)AuthorFilesLines
2019-07-25Fix copy pasto, re-add missing goto in error path.brynet1-1/+2
2019-07-25Yet another workaround for crappy libpcap API designbrynet2-3/+91
Add an internal version of pcap_open_live that ensures bpf(4) devices are opened read-only before locking. Neither pflogd(8) or spamlogd(8) require write access to bpf(4). Inspired by similar solution in OpenBSD tcpdump(8). pflogd(8) was safe since being unveiled last year, but spamlogd(8) was having /dev/bpf opened O_RDWR. Issue discovered by bluhm@'s unveil(2) accounting commit. ok deraadt@, mestre@ (thanks for testing spamlogd!)
2019-06-28When system calls indicate an error they return -1, not some arbitraryderaadt1-2/+2
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2018-10-25The only file that spamlogd(8) needs to access after calling pledge(2) ismestre1-1/+3
PATH_SPAMD_DB, so unveil(2) it with O_RDWR permissions. OK millert@ beck@
2018-06-28add missing ${LIBCRYPTO} to DPADDgsoares1-2/+2
OK deraadt@ millert@ jca@
2016-03-16- Check if user running spamlogd(8) has root privileges and if not then stopmestre1-8/+9
program early - #define SPAMD_USER "_spamd" and use it on getpwnam(3) call - Set usage() as __dead void - Remove lint-style comments OK beck@
2015-12-11pledge spamlogd - again from Ricardo Mestre <serial@helheim.mooo.com> - Thanks!beck1-1/+9
2015-01-21Include <netinet/in.h> before <net/pfvar.h>. In a future change whenderaadt1-2/+2
ports is ready, <net/pfvar.h> will stop including a pile of balony.
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt1-1/+2
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-10-25Remove unnecessary netinet/in_systm.h include.lteo1-2/+1
ok millert@
2013-09-15Some missing .Pa macros in FILES sections;schwarze1-3/+3
from Jan Stary <hans at stare dot cz>; discussed with jmc@.
2013-08-21Remove the use of time_t in the greylist db file and use int64_t insteadmillert2-5/+5
with backwards compatibility for records with 32-bit times. OK deraadt@ beck@
2011-03-18actually set and use whiteexp in the new -W option.okan1-3/+3
my goof noticed by Boudewijn Dijkstra. ok beck@
2011-03-04add -W flag (whiteexp), as opposed to pulling in a hardcoded defaultokan2-9/+27
value from spamd/grey.c; mostly from ohauer@gmx.de in PR/6142. ok beck@
2009-09-17merge/update the spamlogd rules into spamd - there were some subtlejmc1-14/+6
problems because of the recent pf nat changes that caused problems; i've fleshed out the example in spamd and just added a pointer to it from spamlogd; ok beck
2009-07-02add a missing full stop; noticed by frantisek holop <minusf at obiit dot org>schwarze1-5/+5
while here, add a missing comma and a missing word, too; ok jmc@
2008-04-12yes, all; girishvenkatachalamderaadt1-3/+3
2007-05-31convert to new .Dd format;jmc1-2/+2
2007-03-05nuke annoying debug logbeck1-4/+2
ok henning@
2007-03-05Make spamlogd log inbound/outbound like it did before.beck1-2/+5
ok henning@
2007-03-04tweaks;jmc1-3/+2
2007-03-04cleanup usagederaadt1-2/+3
2007-03-04Database synchronizaton for spamd/spamlogdbeck3-7/+60
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-27sync slightly w/ spamd(8);jmc1-9/+5
2007-01-04 Using DB_BTREE for spamd is wrong, order is never requiredbeck1-5/+5
and the rebalancing really slags big databases. Make spamd use DB_HASH instead, and convert if the old type is noticed on startup. Testing by me, djm, ian, others ok deraadt@, millert@, djm@
2006-11-26repair missing DPADD requestsderaadt1-1/+2
2006-11-04remove misplaced -l stuff; henning needs more caffeine...jmc1-7/+1
2006-11-03donot for tcpdump, use libpcap directly.henning3-129/+217
joint work with Berk D. Demir, ok beck deraadt
2006-10-26- sort optionsjmc2-10/+10
- sync usage()
2006-10-25allow spamlogd to use an alternate pflog interfacehenning2-4/+15
spamlogd was the #1 reason for me to implement the multiple pflog thing, so now you can finally have a nice seperation between logging and spamlogd tracking smtp connections joint work with djm, ok djm bob and kinda "Berk D. Demir" <bdd@mindcast.org>
2006-10-23no need to use "keep state" and "flags S/SA" in pf rules,jmc1-3/+3
now that it is the default; ok henning mcbride camield (ftp-proxy bits) deraadt
2005-05-24Remove -ansi as that means expose only C89 interfaces.millert1-2/+2
2004-09-18fix pr 3914, spamd doesn't log only incoming with -I,beck1-8/+9
and change to look only at S/SA so people logging all crud don't get slaughtered by entries. again from mike@tric.tomsk.gov.ru ok henning@
2004-09-16remove unused variablesderaadt1-4/+3
2004-08-10Variable size arrays are not ANSI C. Replace by malloc/free.otto1-2/+8
ok deraadt@ henning@
2004-07-14- new sentence, new linejmc1-14/+18
- .Sx a section reference - punctuation - uppercase smtp - bigger offset for display - clarifying logging - syslog stuff to SEE ALSO
2004-07-14sync usage() w/ SYNOPSIS;jmc1-2/+2
from Andrey Matveev;
2004-03-11Remove sync() calls that immediately precede databse close(). Sincemillert1-3/+1
close() calls sync() itself the standalone sync() is a no-op. OK beck@
2004-03-10spacesderaadt1-15/+13
2004-03-07remove some unused variables and includes; KNFotto1-18/+5
ok beck@
2004-03-01uset inet_pton(3) instead of home grown address validator; some other cleanupotto1-20/+5
ok beck@
2004-02-28Fix macro definition if pf.conf example. Ok beck@matthieu1-3/+3
2004-02-27fix CFLAGS -Idavid1-2/+2
ok deraadt@
2004-02-27make spamlogd watch the destination of outbound smtp connections,beck2-37/+113
so that replies to mail sent out do not get greylisting delays. ok millert@
2004-02-26paranoia; beck okderaadt1-1/+8
2004-02-26Add -g option for greylisting support for spamd. The greylisting techinquebeck3-0/+321
originates from a paper by Evan Harris which can be found at http://projects.puremagic.com/greylisting/. This implementation makes spamd allow for non-blacklisted addresses to be treated as "greylisted". where they are tracked in a db file, and whitelisted by addition to a pf table when the same envelope from and to are retried from the same source IP address. Testing by many, ok deraadt@