OpenBSD CVS

CVS log for src/libexec/spamd/spamd.c


[BACK] Up to [local] / src / libexec / spamd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.163 / (download) - annotate - [select for diffs], Thu May 9 08:35:03 2024 UTC (3 weeks, 3 days ago) by florian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.162: +2 -1 lines
Diff to previous 1.162 (colored)

ctime(3) and ctime_r(3) can fail when timestamps are way off.
Add missing error checks to all calls under libexec/

Input kettenis, millert
OK millert

Revision 1.162 / (download) - annotate - [select for diffs], Mon Apr 1 21:09:44 2024 UTC (2 months ago) by millert
Branch: MAIN
Changes since 1.161: +3 -1 lines
Diff to previous 1.161 (colored)

Advertise SMTPUTF8 and 8BITMIME extensions in EHLO.
Fixes potential interoperability issues when the real MTA
supports those extensions.  From Arnt Gulbrandsen, OK benno@

Revision 1.161 / (download) - annotate - [select for diffs], Tue Sep 5 16:01:58 2023 UTC (8 months, 3 weeks ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.160: +2 -4 lines
Diff to previous 1.160 (colored)

Log a dummy "<unknown>" IP address in the unlikely event that genameinfo(3) fails

clang-16 warning reported by robert@, ok tb@ millert@

Revision 1.160 / (download) - annotate - [select for diffs], Wed Apr 19 12:58:15 2023 UTC (13 months, 2 weeks ago) by jsg
Branch: MAIN
Changes since 1.159: +1 -2 lines
Diff to previous 1.159 (colored)

remove duplicate includes

Revision 1.159 / (download) - annotate - [select for diffs], Sat Jan 14 07:36:16 2023 UTC (16 months, 2 weeks ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.158: +2 -2 lines
Diff to previous 1.158 (colored)

Add missing void to function definition

Revision 1.158 / (download) - annotate - [select for diffs], Wed Jul 14 13:33:57 2021 UTC (2 years, 10 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.157: +1 -3 lines
Diff to previous 1.157 (colored)

Remove unneeded calls to tls_init(3)

As per the manual and lib/libtls/tls.c revision 1.79 from 2018
"Automatically handle library initialisation for libtls." initialisation
is handled automatically by other tls_*(3) functions.

Remove explicit tls_init() calls from base to not give the impression of
it being needed.

Feedback tb
OK Tests mestre

Revision 1.157 / (download) - annotate - [select for diffs], Wed Jul 7 07:28:56 2021 UTC (2 years, 10 months ago) by mestre
Branch: MAIN
Changes since 1.156: +4 -15 lines
Diff to previous 1.156 (colored)

Hoist whole TLS initialization instead of loading the cert/key into memory first
and setting them up later on, nowadays it's possible to do both steps in just
one go through tls_config_set_{cert,key}_file(3) so use it and then init TLS.
No functional change.

OK kn@

Revision 1.156 / (download) - annotate - [select for diffs], Tue Aug 6 13:34:36 2019 UTC (4 years, 9 months ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.155: +1 -10 lines
Diff to previous 1.155 (colored)

By now we are already confident that pledge(2) "just works(tm)" and that it can
be used to effectively remove filesystem access.

That being said, in spamd(8) when I pledge(2)d it the main priv process got
"stdio inet" which means there's no fs access at all so calling
chroot(2)/chdir(2) here doesn't get us any additional protection. Just remove
them.

OK deraadt@ and no objections from schwarze@

Revision 1.155 / (download) - annotate - [select for diffs], Mon Oct 22 17:31:24 2018 UTC (5 years, 7 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.154: +2 -2 lines
Diff to previous 1.154 (colored)

More "explicitely" -> "explicitly" in various comments.

ok guenther@ tb@ deraadt@

Revision 1.154 / (download) - annotate - [select for diffs], Thu Apr 26 08:57:07 2018 UTC (6 years, 1 month ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.153: +3 -3 lines
Diff to previous 1.153 (colored)

nuke trailing whitespace

Revision 1.153 / (download) - annotate - [select for diffs], Wed Oct 18 17:31:01 2017 UTC (6 years, 7 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.152: +56 -2 lines
Diff to previous 1.152 (colored)

Make blacklist entries override the whitelist.  When running spamd
in greylisting mode, it is not uncommon for an IP to get whitelisted
before it shows up on a spam blacklist.  With this change, spamd
will check its blacklists before adding a WHITE entry to the
<spamd-white> pf table.  If the IP matches a blacklist, the WHITE
entry will be removed.  OK phessler@

Revision 1.152 / (download) - annotate - [select for diffs], Thu Oct 12 16:22:33 2017 UTC (6 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.151: +3 -2 lines
Diff to previous 1.151 (colored)

Check for asprintf() returning -1 instead of assuming that the
pointer will remain unchanged when fails.  OK deraadt@

Revision 1.151 / (download) - annotate - [select for diffs], Thu Apr 6 15:30:12 2017 UTC (7 years, 1 month ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.150: +2 -2 lines
Diff to previous 1.150 (colored)

fix missing \ on \n, spotted by Edgar Pettijohn

Revision 1.150 / (download) - annotate - [select for diffs], Mon Jan 23 09:21:04 2017 UTC (7 years, 4 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.149: +3 -3 lines
Diff to previous 1.149 (colored)

check EAGAIN in the correct place,
noticed and ok phessler@

Revision 1.149 / (download) - annotate - [select for diffs], Mon Jan 23 09:09:15 2017 UTC (7 years, 4 months ago) by beck
Branch: MAIN
Changes since 1.148: +9 -2 lines
Diff to previous 1.148 (colored)

Switch spamd to nonblocking descriptors so we can count on getting a
short write when the socket buffers are full, instead of blocking.
ok benno@ claudio@

Revision 1.148 / (download) - annotate - [select for diffs], Tue Jan 17 23:28:04 2017 UTC (7 years, 4 months ago) by mestre
Branch: MAIN
Changes since 1.147: +17 -11 lines
Diff to previous 1.147 (colored)

- spamd(8)'s -l accepts an IP address as argument to bind(2) and it calls
inet_pton(3) to check if it's valid and since that function doesn't provide
a proper errno (POSIX doesn't mandate to do so) then if a string is given we
may get this message:
spamd: inet_pton: Undefined error: 0

- Instead replace that code to use getaddrinfo(3) from which is possible to get
a proper error message, and at the same time being able to parse IPs and
hostnames (if either the IP or host is not local then the next bind(2) will
fail)

- By default without arguments, spamd(8) will still bind(2) to 127.0.0.1 as
it did before

With feedback from deraadt@ and OK beck@

Revision 1.147 / (download) - annotate - [select for diffs], Wed Nov 30 07:54:36 2016 UTC (7 years, 6 months ago) by mestre
Branch: MAIN
Changes since 1.146: +3 -2 lines
Diff to previous 1.146 (colored)

Check return value of tls_config_set_protocols(3) and bail out in case of
failure

Feedback and OK jsing@

Revision 1.146 / (download) - annotate - [select for diffs], Tue Nov 8 09:31:55 2016 UTC (7 years, 6 months ago) by mestre
Branch: MAIN
Changes since 1.145: +2 -2 lines
Diff to previous 1.145 (colored)

Remove redundant & when clearing hostname variable, as per otto@'s request

Revision 1.145 / (download) - annotate - [select for diffs], Mon Nov 7 22:18:22 2016 UTC (7 years, 6 months ago) by mestre
Branch: MAIN
Changes since 1.144: +2 -2 lines
Diff to previous 1.144 (colored)

Replace bzero(3) with memset(3)

OK deraadt@

Revision 1.144 / (download) - annotate - [select for diffs], Tue Sep 6 11:06:40 2016 UTC (7 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.143: +3 -3 lines
Diff to previous 1.143 (colored)

must close our fd unconditionally and not just in the !TLS case; tls_close
doesn't do that for us. found, analyzed and patch supplied by Martin Proyer
<martin at proyer dot net>, many thanks! ok bcook
funny since I just discussed a somewhat mysterious spamd-TLS issue with bob
and brent over breakfast yesterday in cambridge - not sure it is this one,
if it is I've been intensively digging in the wrong corner, almost "missing
the obvious"

Revision 1.143 / (download) - annotate - [select for diffs], Wed Jul 13 16:35:47 2016 UTC (7 years, 10 months ago) by jsing
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.142: +2 -2 lines
Diff to previous 1.142 (colored)

Adjust existing tls_config_set_cipher() callers for TLS cipher group
changes - map the previous configuration to the equivalent in the new
groups. This will be revisited post release.

Discussed with beck@

Revision 1.142 / (download) - annotate - [select for diffs], Tue May 17 17:51:47 2016 UTC (8 years ago) by jca
Branch: MAIN
Changes since 1.141: +2 -2 lines
Diff to previous 1.141 (colored)

tyop

Revision 1.141 / (download) - annotate - [select for diffs], Wed Apr 27 10:24:50 2016 UTC (8 years, 1 month ago) by mestre
Branch: MAIN
Changes since 1.140: +1 -4 lines
Diff to previous 1.140 (colored)

Remove pledge(2)'s that are called before chroot(2) since in the near future
this will be forbidden. The remaining pledge(2) calls after chroot(2) are still
kept.

OK semarie@ "it is time now"

Revision 1.140 / (download) - annotate - [select for diffs], Sun Apr 10 03:04:21 2016 UTC (8 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.139: +4 -2 lines
Diff to previous 1.139 (colored)

per rfc, ehlo responses contain hostname, then options. from dyn+bsd

Revision 1.139 / (download) - annotate - [select for diffs], Fri Mar 25 16:31:32 2016 UTC (8 years, 2 months ago) by mestre
Branch: MAIN
Changes since 1.138: +5 -7 lines
Diff to previous 1.138 (colored)

- Both checks for pw are not needed since it was already done at the start of
the program
- Add error message to syslog if privdrop didn't succeed and then exit
- Remove lint comments

OK beck@ after his suggestion and also looks good to jca@

Revision 1.138 / (download) - annotate - [select for diffs], Thu Mar 10 00:07:03 2016 UTC (8 years, 2 months ago) by gsoares
Branch: MAIN
Changes since 1.137: +14 -5 lines
Diff to previous 1.137 (colored)

- add a define for "_spamd" user like others OpenBSD daemons;
- check for root privileges, otherwise exit early with an appropriate
status code and a formatted string;
- be more specific with chroot()/chdir() checks.

OK beck@

Revision 1.137 / (download) - annotate - [select for diffs], Sat Dec 12 20:09:28 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.136: +3 -5 lines
Diff to previous 1.136 (colored)

Remove NULL-checks before free(). ok tb@

Revision 1.136 / (download) - annotate - [select for diffs], Thu Dec 10 16:06:29 2015 UTC (8 years, 5 months ago) by beck
Branch: MAIN
Changes since 1.135: +36 -27 lines
Diff to previous 1.135 (colored)

tighten the pledge for spamd, from Ricardo Mestre <serial@helheim.mooo.com>
this loads the tls certificate files pre-pledge then does the bulk of the tls
setup goo pledged.

Revision 1.135 / (download) - annotate - [select for diffs], Tue Dec 8 03:21:09 2015 UTC (8 years, 5 months ago) by beck
Branch: MAIN
Changes since 1.134: +24 -12 lines
Diff to previous 1.134 (colored)

Initially pledge spamd
All the work done by Ricardo Mestre <serial@helheim.mooo.com> - Thanks.

Revision 1.134 / (download) - annotate - [select for diffs], Sat Dec 5 20:32:53 2015 UTC (8 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.133: +53 -21 lines
Diff to previous 1.133 (colored)

adjust to newer tls_read/_write semantics.
quite involved, due to tls_read potentially needing to write and tls_write
potentially needing to read (in the reneg case); that not fitting the spamd
model too well - it needs to keep a little more state.
help & ok bluhm & beck

Revision 1.133 / (download) - annotate - [select for diffs], Wed Dec 2 21:10:17 2015 UTC (8 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.132: +3 -2 lines
Diff to previous 1.132 (colored)

in response to EHLO, don't offer STARTTLS if we already completed the
STARTTLS dance. ok millert

Revision 1.132 / (download) - annotate - [select for diffs], Wed Dec 2 20:58:43 2015 UTC (8 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.131: +2 -2 lines
Diff to previous 1.131 (colored)

I misread the standard when adding TLS; clients are supposed to start over
and issue a new EHLO after STARTTLS. The misunderstaning seems to be common,
so we'll still grok MAIL FROM right after the STARTTLS dance, as well as
accepting a second EHLO. ok phessler beck millert

Revision 1.131 / (download) - annotate - [select for diffs], Wed Dec 2 19:03:17 2015 UTC (8 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.130: +3 -2 lines
Diff to previous 1.130 (colored)

fix error messages to say tls_write after tls_write and not tls_read...
with bluhm

Revision 1.130 / (download) - annotate - [select for diffs], Thu Sep 10 13:56:12 2015 UTC (8 years, 8 months ago) by beck
Branch: MAIN
Changes since 1.129: +3 -3 lines
Diff to previous 1.129 (colored)

read, tls_read, and tls_write return ssize_t
jointly with jsing@

Revision 1.129 / (download) - annotate - [select for diffs], Thu Sep 10 10:32:16 2015 UTC (8 years, 8 months ago) by beck
Branch: MAIN
Changes since 1.128: +17 -12 lines
Diff to previous 1.128 (colored)

fix after libtls api changes
ok jsing@

Revision 1.128 / (download) - annotate - [select for diffs], Mon May 18 16:04:21 2015 UTC (9 years ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.127: +5 -12 lines
Diff to previous 1.127 (colored)

Change spamd to use divert-to instead of rdr-to.

divert-to has many advantages over rdr-to for proxies.  For example,
it is much easier to use, requires less code, does not depend on
/dev/pf, works in-band without the asynchronous lookup (DIOCNATLOOK
ioctl), saves us from additional port allocations by the rdr/NAT code,
and even avoids potential collisions and race conditions that could
theoretically happen with the lookup.

Heads up: users will have to update their spamd PF rules from rdr-to
to divert-to.  spamd now also listens to 127.0.0.1 instead of "any"
(0.0.0.0) by default which should be fine with most setups but has to
be considered for some special configurations.

Based on a diff is almost two years old but got delayed several times
... beck@: "now is the time to get it in" :)

Tested by many
With help from okan@
OK okan@ beck@ millert@

Revision 1.127 / (download) - annotate - [select for diffs], Sat Apr 18 18:28:37 2015 UTC (9 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.126: +15 -18 lines
Diff to previous 1.126 (colored)

Convert many atoi() calls to strtonum(), adding range checks and failure
handling along the way.
Reviews by Brendan MacDonell, Jeremy Devenport, florian, doug, millert

Revision 1.126 / (download) - annotate - [select for diffs], Thu Mar 12 20:07:20 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.125: +103 -97 lines
Diff to previous 1.125 (colored)

Use poll(2) instead of select(2).  A pointer to the struct pollfd
is embedded in each struct con so the descriptors can't get out of
sync with the pfd[] array.  OK deraadt@

Revision 1.125 / (download) - annotate - [select for diffs], Sun Feb 22 14:55:40 2015 UTC (9 years, 3 months ago) by jsing
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.124: +5 -2 lines
Diff to previous 1.124 (colored)

Set the TLS ciphers to "compat" mode, restoring the previous behaviour.

Revision 1.124 / (download) - annotate - [select for diffs], Thu Feb 12 04:23:17 2015 UTC (9 years, 3 months ago) by jsing
Branch: MAIN
Changes since 1.123: +3 -1 lines
Diff to previous 1.123 (colored)

Change TLS_PROTOCOLS_DEFAULT to be TLSv1.2 only. Add a TLS_PROTOCOLS_ALL
that includes all currently supported protocols (TLSv1.0, TLSv1.1 and
TLSv1.2). Change all users of libtls to use TLS_PROTOCOLS_ALL so that they
maintain existing behaviour.

Discussed with tedu@ and reyk@.

Revision 1.123 / (download) - annotate - [select for diffs], Sat Feb 7 10:45:19 2015 UTC (9 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.122: +121 -11 lines
Diff to previous 1.122 (colored)

add STARTTLS support, using the shiny libtls.
Rationale: when you publish DANE records for certificate pinning, you MUST
offer TLS on the indicated service. Not offering TLS is verboten since
that would re-open the door for a MitM. This is obviously fundamentally
incompatible with having spamd in front of your mailservers - spamd kinda
is a MitM here, but intentional and utterly valid.
DANE is desirable because it allows one to not have to trust the broken
SSL CA model, and, depending on the mode chosen, even show the SSL cert
mafia the middle finger by not needing them at all.
ok reyk jsing bob

Revision 1.122 / (download) - annotate - [select for diffs], Fri Jan 16 06:39:50 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.121: +12 -8 lines
Diff to previous 1.121 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
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)

Revision 1.121 / (download) - annotate - [select for diffs], Tue Jan 13 23:22:33 2015 UTC (9 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.120: +9 -7 lines
Diff to previous 1.120 (colored)

Move debug printf for duplicate af to correct location.

Revision 1.120 / (download) - annotate - [select for diffs], Tue Jan 13 21:49:36 2015 UTC (9 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.119: +1 -2 lines
Diff to previous 1.119 (colored)

Remove bogus getopt.h include.

Revision 1.119 / (download) - annotate - [select for diffs], Tue Jan 13 21:42:59 2015 UTC (9 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.118: +86 -25 lines
Diff to previous 1.118 (colored)

Use address-family specific lists of addr/mask entries instead of
a union that can store either ipv4 or ipv6.  The old method used
4x as much memory as was really needed for ipv4.  The spamd-setup
protocol has changed from: tag;message;a/m;a/m;a/m...\n
to :tag;message;af;count;a/m;a/m;a/m...[af;count;a/m;a/m;a/m]\n
OK phessler@ "nice" beck@

Revision 1.118 / (download) - annotate - [select for diffs], Tue Dec 30 23:27:23 2014 UTC (9 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.117: +12 -24 lines
Diff to previous 1.117 (colored)

Use a 1MB realloc() increment instead of an 8KB one for the config
connection buffer.  Significantly speeds up spamd-setup for lage
blacklists.  Also free the buffer when we are done with it so memory
can be returned to the system (as it can grow quite large).
OK deraadt@

Revision 1.117 / (download) - annotate - [select for diffs], Mon Dec 29 20:39:27 2014 UTC (9 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.116: +10 -26 lines
Diff to previous 1.116 (colored)

Minor cleanup:
 o doreply() just calls build_reply()
 o remove a few dead stores and useless variables
 o use the asprintf() return value
OK deraadt@

Revision 1.116 / (download) - annotate - [select for diffs], Sun Nov 23 21:19:47 2014 UTC (9 years, 6 months ago) by guenther
Branch: MAIN
Changes since 1.115: +2 -3 lines
Diff to previous 1.115 (colored)

Delete a bunch of unnecessary #includes
Use <fcntl.h> instead of <sys/{file,fcntl}.h>

ok krw@

Revision 1.115 / (download) - annotate - [select for diffs], Thu Oct 9 02:43:43 2014 UTC (9 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.114: +2 -2 lines
Diff to previous 1.114 (colored)

obvious reallocarray() conversions

Revision 1.114 / (download) - annotate - [select for diffs], Wed Mar 26 13:09:02 2014 UTC (10 years, 2 months ago) by gsoares
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.113: +3 -1 lines
Diff to previous 1.113 (colored)

strdup() returns NULL if out of memory, we should check it.

OK beck@

Revision 1.113 / (download) - annotate - [select for diffs], Tue Nov 19 18:33:38 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.112: +15 -7 lines
Diff to previous 1.112 (colored)

repair format strings for time_t, and some missing protos
ok beck phessler

Revision 1.112 / (download) - annotate - [select for diffs], Tue Jun 19 17:43:40 2012 UTC (11 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.111: +7 -7 lines
Diff to previous 1.111 (colored)

use warn() instead of perror(), like the rest of the code does
from Liam J. Foy

Revision 1.111 / (download) - annotate - [select for diffs], Thu Apr 19 19:11:55 2012 UTC (12 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.110: +72 -33 lines
Diff to previous 1.110 (colored)

rate-limit accept(); small tweaks and such along the way from gilles,
millert, camield..

Revision 1.110 / (download) - annotate - [select for diffs], Wed Apr 18 18:15:44 2012 UTC (12 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.109: +7 -4 lines
Diff to previous 1.109 (colored)

merge some whitespace changes before bigger changes

Revision 1.109 / (download) - annotate - [select for diffs], Fri Apr 13 12:24:51 2012 UTC (12 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.108: +2 -3 lines
Diff to previous 1.108 (colored)

Don't assume that the new conffd is a unset in the fd_set, it could be a
recyle of a fd which is still set.
ok claudio

Revision 1.108 / (download) - annotate - [select for diffs], Thu Jan 14 00:44:12 2010 UTC (14 years, 4 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.107: +10 -2 lines
Diff to previous 1.107 (colored)

drop connections to confused clients who do repeated command failures -
typically when a client just flings commands at us without looking
for responses and then gets confused.

ok jsing@

Revision 1.107 / (download) - annotate - [select for diffs], Mon Jan 11 09:57:00 2010 UTC (14 years, 4 months ago) by beck
Branch: MAIN
Changes since 1.106: +8 -8 lines
Diff to previous 1.106 (colored)

KNF

Revision 1.106 / (download) - annotate - [select for diffs], Wed May 20 20:37:43 2009 UTC (15 years ago) by thib
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.105: +2 -3 lines
Diff to previous 1.105 (colored)

Do not fall back to using nobody if _user is missing, but
error out.

Add a new user _rwalld for rpc.rwalld, and use that instead
of nobody, also unconditionally drop to _rwalld not only
if rpc.rwalld was started with euid 0 (as root).

ok deraadt@

Revision 1.105 / (download) - annotate - [select for diffs], Mon Apr 20 17:42:21 2009 UTC (15 years, 1 month ago) by beck
Branch: MAIN
Changes since 1.104: +4 -4 lines
Diff to previous 1.104 (colored)


PR 6090 - from Olli Hauer <ohauer@gmx.de>

A number of small improvements:

- patch for empty lines and comments in alloweddomains_file
- remove some whitespaces at end of line.
- document comment and empty line handling
- Remove unused parameter 'r' from getopt in spamd.c, it is removed in the 'switch statement'
  but not in getopt.
  http://www.openbsd.org/cgi-bin/cvsweb/src/libexec/spamd/spamd.c.diff?r1=1.94;r2=1.95;f=h
- replace atoi with strtonum
- make debug output more usefull, display only what will be synced and not a second
  message which prints always "sync trapped %s"

- some cosemtic and whitespace fixes.

Revision 1.104 / (download) - annotate - [select for diffs], Fri Jul 11 15:05:59 2008 UTC (15 years, 10 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.103: +3 -2 lines
Diff to previous 1.103 (colored)

shut off an annoying gcc warning.

ok beck@

Revision 1.103 / (download) - annotate - [select for diffs], Sat Nov 3 19:16:07 2007 UTC (16 years, 7 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.102: +5 -1 lines
Diff to previous 1.102 (colored)



PR 5621 - spamd doesn't clear the last entry from an empty TRAP list,
noticed and patch from Piotr Sikora <piotr@sikora.nu>

Revision 1.102 / (download) - annotate - [select for diffs], Fri Apr 13 22:05:43 2007 UTC (17 years, 1 month ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.101: +13 -5 lines
Diff to previous 1.101 (colored)

fix helo to error out if no domain is provided
ok millert@

Revision 1.101 / (download) - annotate - [select for diffs], Mon Mar 26 16:40:56 2007 UTC (17 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.100: +11 -19 lines
Diff to previous 1.100 (colored)

use new license, ok deraadt@

Revision 1.100 / (download) - annotate - [select for diffs], Mon Mar 26 16:32:39 2007 UTC (17 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.99: +2 -1 lines
Diff to previous 1.99 (colored)

Copyright - I should share the blame.

Revision 1.99 / (download) - annotate - [select for diffs], Mon Mar 26 15:20:43 2007 UTC (17 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.98: +24 -17 lines
Diff to previous 1.98 (colored)


A couple of spamd improvements

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@

Revision 1.98 / (download) - annotate - [select for diffs], Wed Mar 7 11:30:43 2007 UTC (17 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.97: +4 -4 lines
Diff to previous 1.97 (colored)

sync usage(); ok deraadt

Revision 1.97 / (download) - annotate - [select for diffs], Tue Mar 6 23:38:36 2007 UTC (17 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.96: +46 -5 lines
Diff to previous 1.96 (colored)

Add -M option to specify a local address that is a lower priority MX
address than the primary one. spamd will trap hosts that contact this
address first without first contacting the primary.
- get it in, deraadt@

Revision 1.96 / (download) - annotate - [select for diffs], Tue Mar 6 01:59:43 2007 UTC (17 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.95: +31 -3 lines
Diff to previous 1.95 (colored)

Make the maximum number of connections dependant on kern.maxfiles rather
than a hardcoded value.
ok reyk@, deraadt@ with knfisms and saner variable names

Revision 1.95 / (download) - annotate - [select for diffs], Mon Mar 5 21:25:29 2007 UTC (17 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.94: +3 -9 lines
Diff to previous 1.94 (colored)

remove -r option that didn't work anyway.
ok jmc@, reyk@

Revision 1.94 / (download) - annotate - [select for diffs], Mon Mar 5 02:06:14 2007 UTC (17 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.93: +2 -2 lines
Diff to previous 1.93 (colored)

revert unintentional MAXCON change back to 800, accidentally did last
commit with the U of A value, which may not be safe on all GENERICs with
an unmodified kern.maxfiles

Revision 1.93 / (download) - annotate - [select for diffs], Sun Mar 4 03:19:41 2007 UTC (17 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.92: +41 -5 lines
Diff to previous 1.92 (colored)


Database synchronizaton for spamd/spamlogd

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@

Revision 1.92 / (download) - annotate - [select for diffs], Tue Feb 27 23:03:09 2007 UTC (17 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.91: +3 -4 lines
Diff to previous 1.91 (colored)

spacing

Revision 1.91 / (download) - annotate - [select for diffs], Tue Feb 27 23:00:54 2007 UTC (17 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.90: +2 -2 lines
Diff to previous 1.90 (colored)

fix -b breakage - make greylisting actually be on by default

Revision 1.90 / (download) - annotate - [select for diffs], Tue Feb 27 14:52:31 2007 UTC (17 years, 3 months ago) by jmc
Branch: MAIN
Changes since 1.89: +9 -6 lines
Diff to previous 1.89 (colored)

sort options and usage();

Revision 1.89 / (download) - annotate - [select for diffs], Tue Feb 27 02:10:58 2007 UTC (17 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.88: +6 -6 lines
Diff to previous 1.88 (colored)

Flag day for spamd -
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@

Revision 1.88 / (download) - annotate - [select for diffs], Fri Feb 23 22:40:50 2007 UTC (17 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.87: +29 -4 lines
Diff to previous 1.87 (colored)

Make spamd include the HELO/EHLO identification string sent by
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@

Revision 1.87 / (download) - annotate - [select for diffs], Fri Feb 23 19:36:23 2007 UTC (17 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.86: +2 -2 lines
Diff to previous 1.86 (colored)

continue collecting lint to be sold as a parsley substitute; ok beck

Revision 1.86 / (download) - annotate - [select for diffs], Fri Feb 23 19:22:07 2007 UTC (17 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.85: +7 -7 lines
Diff to previous 1.85 (colored)

greytrapping improvements
	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

Revision 1.85 / (download) - annotate - [select for diffs], Mon Nov 27 20:46:03 2006 UTC (17 years, 6 months ago) by beck
Branch: MAIN
Changes since 1.84: +6 -4 lines
Diff to previous 1.84 (colored)

Make spamd error out for a greylisted session only after the DATA
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.

Revision 1.84 / (download) - annotate - [select for diffs], Sun Oct 29 22:06:28 2006 UTC (17 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.83: +6 -8 lines
Diff to previous 1.83 (colored)

use setresuid/gid and check for failure, ok bob

Revision 1.83 / (download) - annotate - [select for diffs], Mon May 15 16:47:48 2006 UTC (18 years ago) by jcs
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.82: +9 -3 lines
Diff to previous 1.82 (colored)

add an -h option to override the hostname that is reported in the
SMTP banner

ok beck@

Revision 1.82 / (download) - annotate - [select for diffs], Tue Mar 14 22:49:41 2006 UTC (18 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.81: +2 -2 lines
Diff to previous 1.81 (colored)

spamd can show the wrong IP address to clients in a %A message because
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@

Revision 1.81 / (download) - annotate - [select for diffs], Wed Nov 30 20:44:07 2005 UTC (18 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.80: +16 -17 lines
Diff to previous 1.80 (colored)

some cleanups prompted by lint, no really nasty bugs; ok beck

Revision 1.80 / (download) - annotate - [select for diffs], Sat Nov 12 02:20:37 2005 UTC (18 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.79: +5 -5 lines
Diff to previous 1.79 (colored)

spacing

Revision 1.79 / (download) - annotate - [select for diffs], Thu Aug 4 09:48:27 2005 UTC (18 years, 10 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.78: +3 -3 lines
Diff to previous 1.78 (colored)

Fix handling of empty entries at the end of an address list; avoids
always skipping the last address.  ok beck@

Revision 1.78 / (download) - annotate - [select for diffs], Mon May 23 21:08:43 2005 UTC (19 years ago) by frantzen
Branch: MAIN
Changes since 1.77: +2 -1 lines
Diff to previous 1.77 (colored)

have to ignore SIGPIPE in the child too or a spammer can kill spamd just by
closing the connection while we're trying to write to it

Revision 1.77 / (download) - annotate - [select for diffs], Sat Apr 16 14:23:35 2005 UTC (19 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.76: +2 -2 lines
Diff to previous 1.76 (colored)

missing getopt choice; from dennis

Revision 1.76 / (download) - annotate - [select for diffs], Thu Apr 14 16:07:52 2005 UTC (19 years, 1 month ago) by beck
Branch: MAIN
Changes since 1.75: +16 -3 lines
Diff to previous 1.75 (colored)

Make spamd stutter at greylisted connections for a short period before talking
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@

Revision 1.75 / (download) - annotate - [select for diffs], Fri Mar 11 23:09:53 2005 UTC (19 years, 2 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.74: +58 -11 lines
Diff to previous 1.74 (colored)

"Greytrapping" for spamd - allow for spamd greylisting to maintain
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

Revision 1.74 / (download) - annotate - [select for diffs], Wed Nov 17 15:29:38 2004 UTC (19 years, 6 months ago) by beck
Branch: MAIN
Changes since 1.73: +12 -2 lines
Diff to previous 1.73 (colored)

- \r\n fix for QUIT command

- 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@

Revision 1.73 / (download) - annotate - [select for diffs], Tue Oct 5 15:20:30 2004 UTC (19 years, 8 months ago) by beck
Branch: MAIN
Changes since 1.72: +2 -2 lines
Diff to previous 1.72 (colored)

change default to 451 for greylisting, thanks to a number of
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@

Revision 1.72 / (download) - annotate - [select for diffs], Sat Sep 18 07:29:38 2004 UTC (19 years, 8 months ago) by beck
Branch: MAIN
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored)

This should be info, from mike@tric.ru
ok henning@

Revision 1.71 / (download) - annotate - [select for diffs], Tue Aug 17 09:38:07 2004 UTC (19 years, 9 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.70: +11 -1 lines
Diff to previous 1.70 (colored)

impliment QUIT, beck ok

Revision 1.70 / (download) - annotate - [select for diffs], Sun Aug 8 19:32:45 2004 UTC (19 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.69: +3 -3 lines
Diff to previous 1.69 (colored)

spacing

Revision 1.69 / (download) - annotate - [select for diffs], Sun Jul 4 22:45:41 2004 UTC (19 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.68: +2 -2 lines
Diff to previous 1.68 (colored)

typo; andrushock@korovino.net

Revision 1.68 / (download) - annotate - [select for diffs], Tue Jun 29 11:19:06 2004 UTC (19 years, 11 months ago) by mickey
Branch: MAIN
Changes since 1.67: +1 -3 lines
Diff to previous 1.67 (colored)

absolutely no need to include machine/endian.h after sys/types.h and sys/types.h after sys/param.h

Revision 1.67 / (download) - annotate - [select for diffs], Mon Jun 21 17:05:43 2004 UTC (19 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.66: +17 -9 lines
Diff to previous 1.66 (colored)

use getaddr/nameinfo for address resolution.  beck, henning ok

Revision 1.66 / (download) - annotate - [select for diffs], Sat Apr 3 01:37:18 2004 UTC (20 years, 2 months ago) by dhartmei
Branch: MAIN
Changes since 1.65: +15 -8 lines
Diff to previous 1.65 (colored)

fix logging. without -v, you get just the connection level, no mail data.
with -v, you get From/To/Subject at LOG_INFO, and the first ten body
lines at LOG_DEBUG. ok beck@

Revision 1.65 / (download) - annotate - [select for diffs], Fri Apr 2 23:48:35 2004 UTC (20 years, 2 months ago) by dhartmei
Branch: MAIN
Changes since 1.64: +25 -17 lines
Diff to previous 1.64 (colored)

nextstate() can get passed a read(2) chunk containing multiple lines,
so separate lines before logging headers/body. doesn't make logging
more verbose, just fixes the case where chunks contain multiple lines.
ok beck@

Revision 1.64 / (download) - annotate - [select for diffs], Wed Mar 17 14:42:20 2004 UTC (20 years, 2 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.63: +11 -11 lines
Diff to previous 1.63 (colored)

fix problem with counter and logging spotted by danh, where logging
would get messed up when the blacklist limit was hit.
tested by danh@ and me
ok cedric@

Revision 1.63 / (download) - annotate - [select for diffs], Tue Mar 16 09:19:25 2004 UTC (20 years, 2 months ago) by jmc
Branch: MAIN
Changes since 1.62: +2 -2 lines
Diff to previous 1.62 (colored)

sort options and escape a minus sign;

Revision 1.62 / (download) - annotate - [select for diffs], Mon Mar 15 21:53:39 2004 UTC (20 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.61: +28 -6 lines
Diff to previous 1.61 (colored)

Add -B option, with maxblack limit to limit the number of blacklist
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@

Revision 1.61 / (download) - annotate - [select for diffs], Sun Mar 14 23:09:44 2004 UTC (20 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.60: +6 -7 lines
Diff to previous 1.60 (colored)

make window size adjustement on sockets only after the DATA
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@

Revision 1.60 / (download) - annotate - [select for diffs], Sat Mar 13 17:46:15 2004 UTC (20 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.59: +22 -16 lines
Diff to previous 1.59 (colored)

Add signal handler to parent, so that when greylisting we don't need to
kill all three processes to make it go away. Adjust daemon() call and
logging appropriately.
ok henning@, millert@

Revision 1.59 / (download) - annotate - [select for diffs], Fri Mar 12 21:02:58 2004 UTC (20 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.58: +7 -4 lines
Diff to previous 1.58 (colored)

paranoia and cleanup, ensure we use free then NULL everywhere.
ok millert@ dhartmei@

Revision 1.58 / (download) - annotate - [select for diffs], Thu Mar 11 18:32:17 2004 UTC (20 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.57: +6 -6 lines
Diff to previous 1.57 (colored)

fix bug where custom 450 messages are not displayed,
found by yongari@kt-is.co.kr
ok dhartmei@, millert@

Revision 1.57 / (download) - annotate - [select for diffs], Wed Mar 10 00:33:39 2004 UTC (20 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.56: +2 -2 lines
Diff to previous 1.56 (colored)

fix missing space, also from
yongari@kt-is.co.kr
ok deraadt@

Revision 1.56 / (download) - annotate - [select for diffs], Wed Mar 10 00:32:54 2004 UTC (20 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.55: +16 -6 lines
Diff to previous 1.55 (colored)

add -b option to specify local bind address, sent by
yongari@kt-is.co.kr
ok deraadt@

Revision 1.55 / (download) - annotate - [select for diffs], Sat Feb 28 00:03:59 2004 UTC (20 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.54: +39 -47 lines
Diff to previous 1.54 (colored)

- ensure greylist entry expiry is not updated until actually whitelisted
  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@

Revision 1.54 / (download) - annotate - [select for diffs], Thu Feb 26 08:18:56 2004 UTC (20 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.53: +10 -7 lines
Diff to previous 1.53 (colored)

paranoia; beck ok

Revision 1.53 / (download) - annotate - [select for diffs], Thu Feb 26 07:28:55 2004 UTC (20 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.52: +186 -75 lines
Diff to previous 1.52 (colored)

Add -g option for greylisting support for spamd. The greylisting techinque
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@

Revision 1.52 / (download) - annotate - [select for diffs], Sun Nov 9 07:35:25 2003 UTC (20 years, 6 months ago) by dhartmei
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

add missing -v to getopt

Revision 1.51 / (download) - annotate - [select for diffs], Sat Nov 8 09:01:04 2003 UTC (20 years, 6 months ago) by jmc
Branch: MAIN
Changes since 1.50: +4 -2 lines
Diff to previous 1.50 (colored)

add -v and -w window to usage();

Revision 1.50 / (download) - annotate - [select for diffs], Wed Oct 22 21:31:38 2003 UTC (20 years, 7 months ago) by beck
Branch: MAIN
Changes since 1.49: +12 -7 lines
Diff to previous 1.49 (colored)

make logging less verbose by default - default logs connect, disconnect
and blacklist matches. Add -v (verbose) flag to allow other detailed
logging (subject, body, smtp dialogue, etc.) when it's needed.
ok dhartmei@ -> ok deraadt@

Revision 1.49 / (download) - annotate - [select for diffs], Fri Oct 3 17:05:50 2003 UTC (20 years, 8 months ago) by beck
Branch: MAIN
Changes since 1.48: +13 -2 lines
Diff to previous 1.48 (colored)

1) Don't loop on invalid commands
2) Allow multiple RCPT's
ok mpech@, helpful stress testing by Chris Nadovich <chris@jtan.com>

Revision 1.48 / (download) - annotate - [select for diffs], Fri Sep 26 16:07:29 2003 UTC (20 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.47: +3 -5 lines
Diff to previous 1.47 (colored)

can free(NULL)

Revision 1.47 / (download) - annotate - [select for diffs], Fri Sep 26 04:42:11 2003 UTC (20 years, 8 months ago) by beck
Branch: MAIN
Changes since 1.46: +8 -11 lines
Diff to previous 1.46 (colored)

make accept failures not globally fatal.
ok deraadt@

Revision 1.46 / (download) - annotate - [select for diffs], Fri Sep 26 01:58:55 2003 UTC (20 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.45: +3 -5 lines
Diff to previous 1.45 (colored)

free(NULL) allowed

Revision 1.45 / (download) - annotate - [select for diffs], Wed Sep 24 01:14:59 2003 UTC (20 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.44: +3 -2 lines
Diff to previous 1.44 (colored)

indent

Revision 1.44 / (download) - annotate - [select for diffs], Wed Sep 24 01:14:48 2003 UTC (20 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

crank max connections to 800 (really, there are poeple doing this)

Revision 1.43 / (download) - annotate - [select for diffs], Thu Sep 18 23:33:44 2003 UTC (20 years, 8 months ago) by avsm
Branch: MAIN
Changes since 1.42: +18 -19 lines
Diff to previous 1.42 (colored)

realloc spring cleaning, simplifies the code some
beck@ ok, deraadt@ ok an earlier version

Revision 1.42 / (download) - annotate - [select for diffs], Thu Sep 4 01:20:33 2003 UTC (20 years, 9 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

forgot to put w in optstring in last commit.

Revision 1.41 / (download) - annotate - [select for diffs], Wed Sep 3 21:22:19 2003 UTC (20 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.40: +8 -3 lines
Diff to previous 1.40 (colored)

permit the window/receive buffer to be adjustable.  default back to system
default.  in reponse to pr3435.  ok beck deraadt dhartmei

Revision 1.40 / (download) - annotate - [select for diffs], Tue Aug 26 18:30:03 2003 UTC (20 years, 9 months ago) by dhartmei
Branch: MAIN
Changes since 1.39: +4 -1 lines
Diff to previous 1.39 (colored)

re-add logging of matched blacklists lost in previous commit, ok deraadt@

Revision 1.39 / (download) - annotate - [select for diffs], Sun Aug 24 23:20:19 2003 UTC (20 years, 9 months ago) by dhartmei
Branch: MAIN
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

missing colon in syslog msg (cosmetic)

Revision 1.38 / (download) - annotate - [select for diffs], Sat Aug 23 21:22:34 2003 UTC (20 years, 9 months ago) by dhartmei
Branch: MAIN
Changes since 1.37: +79 -18 lines
Diff to previous 1.37 (colored)

add -s to specify stuttering delay, set receive buffer size to 1 byte
(causing a small TCP window size, tying up sender's resources), additional
states: keep connection until ten body lines have been received, improved
logging through syslog (envelope from/to, From:/To:/Subject: in header,
first lines of body) at various levels. ok deraadt@

Revision 1.37 / (download) - annotate - [select for diffs], Sat Aug 23 20:36:44 2003 UTC (20 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.36: +3 -2 lines
Diff to previous 1.36 (colored)

fix printf format for time_t.  notified by casha@e7.pl.  henning ok

Revision 1.36 / (download) - annotate - [select for diffs], Tue Jul 29 18:39:23 2003 UTC (20 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.35: +6 -7 lines
Diff to previous 1.35 (colored)

spaces

Revision 1.35 / (download) - annotate - [select for diffs], Wed Jun 11 14:24:46 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.34: +3 -3 lines
Diff to previous 1.34 (colored)

ansi cleanup; ok ian markus

Revision 1.34 / (download) - annotate - [select for diffs], Sat May 17 02:41:19 2003 UTC (21 years ago) by beck
Branch: MAIN
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

strsep does not work that way.
ok tedu@

Revision 1.33 / (download) - annotate - [select for diffs], Fri May 16 22:30:15 2003 UTC (21 years ago) by beck
Branch: MAIN
Changes since 1.32: +5 -5 lines
Diff to previous 1.32 (colored)

This was using the wrong buffer, and wrong lengths. fix it from me and
tedu,
ok tedu@

Revision 1.32 / (download) - annotate - [select for diffs], Tue Apr 15 07:16:14 2003 UTC (21 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.31: +6 -4 lines
Diff to previous 1.31 (colored)

toast some += snprintf

Revision 1.31 / (download) - annotate - [select for diffs], Sat Apr 12 23:38:01 2003 UTC (21 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.30: +7 -1 lines
Diff to previous 1.30 (colored)

rlimit handling code; aw@osn.de

Revision 1.30 / (download) - annotate - [select for diffs], Tue Apr 8 22:09:53 2003 UTC (21 years, 1 month ago) by vincent
Branch: MAIN
Changes since 1.29: +6 -3 lines
Diff to previous 1.29 (colored)

more logical handling of select() errors

ok millert@ deraadt@

Revision 1.29 / (download) - annotate - [select for diffs], Sun Mar 30 01:50:21 2003 UTC (21 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.28: +10 -3 lines
Diff to previous 1.28 (colored)

fix logging time to reflect reality. minus crack induced blank lines.
ok tholo@

Revision 1.28 / (download) - annotate - [select for diffs], Fri Mar 28 20:35:24 2003 UTC (21 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.27: +27 -12 lines
Diff to previous 1.27 (colored)

logging fix from tholo@
log which lists are matched, so you can tell what is actually working.

Revision 1.27 / (download) - annotate - [select for diffs], Fri Mar 28 17:52:24 2003 UTC (21 years, 2 months ago) by jason
Branch: MAIN
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

report how much time was wasted; ok beck

Revision 1.26 / (download) - annotate - [select for diffs], Thu Mar 20 01:39:36 2003 UTC (21 years, 2 months ago) by david
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

cmdline options and descriptions in alphabetical order in usage() and manpage
add arguments to the flags that take them in the DESCRIPTION
add "inet" to the rdr rule example to match etc/pf.conf example

ok dhartmei@ henning@

Revision 1.25 / (download) - annotate - [select for diffs], Thu Mar 13 21:20:42 2003 UTC (21 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.24: +5 -1 lines
Diff to previous 1.24 (colored)

make spamd-setup/spamd use/require a reserved source port for the
configuration connection.

Revision 1.24 / (download) - annotate - [select for diffs], Sun Mar 9 19:27:30 2003 UTC (21 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

typo. henning@

Revision 1.23 / (download) - annotate - [select for diffs], Sun Mar 9 19:22:25 2003 UTC (21 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.22: +15 -3 lines
Diff to previous 1.22 (colored)

Fix a few typos, Make spamd and spamd-setup use /etc/services to find
their ports. Adds "spamd" and "spamd-cfg" services to /etc/services.
Mostly from Daniel Lucq <daniel@lucq.org>.

Revision 1.22 / (download) - annotate - [select for diffs], Sat Mar 8 22:05:20 2003 UTC (21 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.21: +3 -1 lines
Diff to previous 1.21 (colored)

knf

Revision 1.21 / (download) - annotate - [select for diffs], Tue Mar 4 05:54:53 2003 UTC (21 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

ugh. default examples don't work since with an rdr to 127.0.0.1
you can't tell what socket you're talking to. avoid the whole
issue and put the configuration on port + 1,  todd@

Revision 1.20 / (download) - annotate - [select for diffs], Mon Mar 3 19:35:17 2003 UTC (21 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

oops, removed a char from rend

Revision 1.19 / (download) - annotate - [select for diffs], Mon Mar 3 14:47:37 2003 UTC (21 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.18: +7 -4 lines
Diff to previous 1.18 (colored)

always set ptr to NULL after free; from cloder

Revision 1.18 / (download) - annotate - [select for diffs], Mon Mar 3 00:51:40 2003 UTC (21 years, 3 months ago) by cloder
Branch: MAIN
Changes since 1.17: +10 -10 lines
Diff to previous 1.17 (colored)

More KNF.  Use a size_t in one place where it makes sense.
OK deraadt@

Revision 1.17 / (download) - annotate - [select for diffs], Sun Mar 2 23:55:11 2003 UTC (21 years, 3 months ago) by cloder
Branch: MAIN
Changes since 1.16: +38 -21 lines
Diff to previous 1.16 (colored)

Add ANSI prototypes for all functions.  Now compiles with
-ansi -Wstrict-prototypes, update the Makefile to reflect
that.

Revision 1.16 / (download) - annotate - [select for diffs], Sun Mar 2 23:04:35 2003 UTC (21 years, 3 months ago) by kjell
Branch: MAIN
Changes since 1.15: +24 -23 lines
Diff to previous 1.15 (colored)

KNF and one err->errx. ok deraadt@

Revision 1.15 / (download) - annotate - [select for diffs], Sun Mar 2 22:30:35 2003 UTC (21 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.14: +2 -1 lines
Diff to previous 1.14 (colored)

knf

Revision 1.14 / (download) - annotate - [select for diffs], Sun Mar 2 20:49:10 2003 UTC (21 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.13: +4 -2 lines
Diff to previous 1.13 (colored)

unbelievable; buffer mismanagement in new code

Revision 1.13 / (download) - annotate - [select for diffs], Sun Mar 2 20:40:15 2003 UTC (21 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.12: +8 -7 lines
Diff to previous 1.12 (colored)

knf

Revision 1.12 / (download) - annotate - [select for diffs], Sun Mar 2 20:32:05 2003 UTC (21 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.11: +85 -87 lines
Diff to previous 1.11 (colored)

knf

Revision 1.11 / (download) - annotate - [select for diffs], Sun Mar 2 19:22:00 2003 UTC (21 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.10: +420 -17 lines
Diff to previous 1.10 (colored)

Spamd changes to add blacklist awareness to spamd, new spamd-setup.pl
which configures individual blacklists sources and deals with whitelists.
Perl still needs some stylistic changes as suggested by bmc which will go
in shortly.
ok deraadt@

Revision 1.10 / (download) - annotate - [select for diffs], Tue Feb 11 01:41:10 2003 UTC (21 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored)

oops; beck

Revision 1.9 / (download) - annotate - [select for diffs], Thu Jan 30 09:47:16 2003 UTC (21 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.8: +18 -18 lines
Diff to previous 1.8 (colored)

revoke privs a bit later so spamd can bind() to ports < 1024

inspired by Nick Stott <nick at electric-pickle.net>
ok theo daniel

Revision 1.8 / (download) - annotate - [select for diffs], Fri Jan 24 23:39:28 2003 UTC (21 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.7: +4 -4 lines
Diff to previous 1.7 (colored)

plug potential memory leak; vincent ok

Revision 1.7 / (download) - annotate - [select for diffs], Sun Jan 5 23:10:16 2003 UTC (21 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.6: +12 -8 lines
Diff to previous 1.6 (colored)

bit more error checking; andrushock@korovino.net

Revision 1.6 / (download) - annotate - [select for diffs], Mon Dec 30 22:05:57 2002 UTC (21 years, 5 months ago) by mickey
Branch: MAIN
Changes since 1.5: +9 -5 lines
Diff to previous 1.5 (colored)

dynamically allocate the struct con[], according to the -c arg given or a default, being the max 200

Revision 1.5 / (download) - annotate - [select for diffs], Thu Dec 26 01:12:24 2002 UTC (21 years, 5 months ago) by mickey
Branch: MAIN
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

fix a more or less problem; deraadt@ ok

Revision 1.4 / (download) - annotate - [select for diffs], Mon Dec 23 04:04:24 2002 UTC (21 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

oops

Revision 1.3 / (download) - annotate - [select for diffs], Mon Dec 23 01:09:22 2002 UTC (21 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +26 -15 lines
Diff to previous 1.2 (colored)

not errx; andrushock@korovino.net

Revision 1.2 / (download) - annotate - [select for diffs], Sat Dec 21 18:19:33 2002 UTC (21 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +29 -13 lines
Diff to previous 1.1 (colored)

epipe and other misc stuff; daniel@benzedrine.cx

Revision 1.1 / (download) - annotate - [select for diffs], Sat Dec 21 01:41:54 2002 UTC (21 years, 5 months ago) by deraadt
Branch: MAIN

spamd: work in progress

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.