OpenBSD CVS

CVS log for src/usr.sbin/smtpd/smtp.c


[BACK] Up to [local] / src / usr.sbin / smtpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.174 / (download) - annotate - [select for diffs], Tue May 16 17:48:52 2023 UTC (12 months, 3 weeks ago) by op
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.173: +13 -9 lines
Diff to previous 1.173 (colored)

some fatal -> fatalx to improved logging

errno doesn't generally contains anything useful after libtls functions,
and in most cases it's explicitly cleared to avoid misuse, so change a
few fatal() calls to fatalx() when logging libtls failures.  Also, add
the real error string, via tls_error() or tls_config_error(), that was
missing before.

ok millert@

Revision 1.173 / (download) - annotate - [select for diffs], Fri Feb 18 16:57:36 2022 UTC (2 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.172: +7 -1 lines
Diff to previous 1.172 (colored)

Revert changes to use the new libtls signer api
There are bugs in the new libtls signer that can lead to a crash.
OK tb@ jsing@

Revision 1.172 / (download) - annotate - [select for diffs], Sat Feb 12 18:22:04 2022 UTC (2 years, 3 months ago) by eric
Branch: MAIN
Changes since 1.171: +2 -8 lines
Diff to previous 1.171 (colored)

use new libtls signer api

ok tb@

Revision 1.171 / (download) - annotate - [select for diffs], Mon Jun 14 17:58:16 2021 UTC (2 years, 11 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.170: +1 -16 lines
Diff to previous 1.170 (colored)

add required headers for smtpd.h and remove unnecessary ones in other files.

ok jung@

Revision 1.170 / (download) - annotate - [select for diffs], Wed May 26 18:08:55 2021 UTC (3 years ago) by eric
Branch: MAIN
Changes since 1.169: +5 -6 lines
Diff to previous 1.169 (colored)

replaces calls to err(3)/errx(3) with fatal()/fatalx() from log.c
for code that runs in the daemon.

ok florian@ millert@

Revision 1.169 / (download) - annotate - [select for diffs], Fri Apr 9 16:43:43 2021 UTC (3 years, 2 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.168: +15 -3 lines
Diff to previous 1.168 (colored)

allow to specify tls ciphers and protocols on listeners

ok tb@

Revision 1.168 / (download) - annotate - [select for diffs], Wed Mar 10 17:25:59 2021 UTC (3 years, 2 months ago) by eric
Branch: MAIN
Changes since 1.167: +1 -3 lines
Diff to previous 1.167 (colored)

do not request client certificate unless required

issue hit by florian@
diff by jsing@

ok tb@

Revision 1.167 / (download) - annotate - [select for diffs], Fri Mar 5 12:37:32 2021 UTC (3 years, 3 months ago) by eric
Branch: MAIN
Changes since 1.166: +78 -34 lines
Diff to previous 1.166 (colored)

Start porting smtpd to libtls.

Note that it changes the way SNI works: The certificate to use is now
selected by looking at the names found in the certificates themselves,
rather than the names of the pki entries in the configuration file.
The set of certificates for a tls listener must be defined explicitly by
using the pki listener option multiple times.

ok tb@

Revision 1.166 / (download) - annotate - [select for diffs], Sat Aug 10 16:07:01 2019 UTC (4 years, 10 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.165: +27 -1 lines
Diff to previous 1.165 (colored)

this introduces experimental proxy v2 support which is fairly isolated to a
single proxy.c file, importing it to work in tree

initial work from Antoine Kaufmann <toni@famkaufmann.info>

Revision 1.165 / (download) - annotate - [select for diffs], Fri Jun 28 13:32:51 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.164: +2 -2 lines
Diff to previous 1.164 (colored)

When system calls indicate an error they return -1, not some arbitrary
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.

Revision 1.164 / (download) - annotate - [select for diffs], Sun Dec 23 16:37:53 2018 UTC (5 years, 5 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.163: +1 -3 lines
Diff to previous 1.163 (colored)

remove dead code

ok gilles@

Revision 1.163 / (download) - annotate - [select for diffs], Tue Dec 11 13:40:30 2018 UTC (5 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.162: +3 -3 lines
Diff to previous 1.162 (colored)

do some imsg renaming to make them more clear

Revision 1.162 / (download) - annotate - [select for diffs], Thu Dec 6 12:09:50 2018 UTC (5 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.161: +3 -2 lines
Diff to previous 1.161 (colored)

bring the first bits of DATA filtering plumbing but bypass it for now

ok eric@

Revision 1.161 / (download) - annotate - [select for diffs], Sat Nov 3 14:39:45 2018 UTC (5 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.160: +2 -5 lines
Diff to previous 1.160 (colored)

only apply filter rules to filtered interfaces

Revision 1.160 / (download) - annotate - [select for diffs], Sat Nov 3 13:42:24 2018 UTC (5 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.159: +2 -1 lines
Diff to previous 1.159 (colored)

bring plumbing for builtin filters

ok millert@, eric@, jung@

Revision 1.159 / (download) - annotate - [select for diffs], Wed Jul 25 16:00:48 2018 UTC (5 years, 10 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.158: +1 -2 lines
Diff to previous 1.158 (colored)

Implement a generic interface to forward resolver queries to the lka
process.  Use it for the reverse lookups required by smtp and mta.

Until now, DNS-related lookups were implemented using ad-hoc IMSGs
between the lka and other processes. It turns out to be confusing and
difficult to maintain/extend.  So we want to replace this with a better
set of IMSGs matching the standard resolver interface.

ok gilles@

Revision 1.158 / (download) - annotate - [select for diffs], Mon Jun 18 18:14:39 2018 UTC (5 years, 11 months ago) by gilles
Branch: MAIN
Changes since 1.157: +32 -23 lines
Diff to previous 1.157 (colored)

split smtp_accept() in two parts: the accept part, the session init part,
while at it allow smtp_session() to receive a pre-allocated struct io

ok millert@
diff contributed by Antoine Kaufmann

Revision 1.157 / (download) - annotate - [select for diffs], Tue Nov 21 12:20:34 2017 UTC (6 years, 6 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.156: +41 -52 lines
Diff to previous 1.156 (colored)

no need to check the sending process in imsg handlers when there is no
ambiguity: just use a single switch.

ok gilles@ sunil@

Revision 1.156 / (download) - annotate - [select for diffs], Mon May 22 13:43:15 2017 UTC (7 years ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.155: +8 -2 lines
Diff to previous 1.155 (colored)

- filters are currently broken, do not allow using them until we're done

Revision 1.155 / (download) - annotate - [select for diffs], Fri Mar 25 15:06:58 2016 UTC (8 years, 2 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.154: +3 -3 lines
Diff to previous 1.154 (colored)

Nuke session_socket_blockmode() and session_socket_linger(). Use
the identical io_set_blocking() and io_set_linger().

Since both are always called to turn off blocking or lingering,
nuke the parameter and associated enum in favour of "just doing the
right thing".

While passing remove the unneeded last parameter to the remaining
fcntl(F_GETFL).

Finally, rename the functions to io_set_nonblocking() and
io_set_nolinger() for clarity.

No functional change.

Started with a sweep of fcntl() usage inspired by guenther@.

ok gilles@

Revision 1.154 / (download) - annotate - [select for diffs], Sat Feb 13 20:43:07 2016 UTC (8 years, 3 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.153: +3 -14 lines
Diff to previous 1.153 (colored)

handle enqueuer socket as a regular listener that can be configured with
"listen on socket". this simplifies a bit of code, removes some special
cases and will allow attaching filters & masking source just as on lo0.

diff from Peter Bisroev <peter@int19h.net>
ok gilles@, jung@

Revision 1.153 / (download) - annotate - [select for diffs], Sat Feb 13 09:28:13 2016 UTC (8 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.152: +6 -13 lines
Diff to previous 1.152 (colored)

remove some noop leftover code from an earlier cleanup

diff from Peter Bisroev <peter@int19h.net>

Revision 1.152 / (download) - annotate - [select for diffs], Fri Jan 8 21:31:06 2016 UTC (8 years, 5 months ago) by jung
Branch: MAIN
Changes since 1.151: +2 -2 lines
Diff to previous 1.151 (colored)

adjust a debug message to use decimal instead of hex

ok gilles millert

Revision 1.151 / (download) - annotate - [select for diffs], Mon Dec 28 22:08:30 2015 UTC (8 years, 5 months ago) by jung
Branch: MAIN
Changes since 1.150: +3 -3 lines
Diff to previous 1.150 (colored)

remove spaces after '!'

no binary change

ok millert

Revision 1.150 / (download) - annotate - [select for diffs], Sun Dec 13 09:52:44 2015 UTC (8 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.149: +20 -2 lines
Diff to previous 1.149 (colored)

refactor a bit to move the SNI handling away from smtp_session into smtp

ok sunil@, jung@

Revision 1.149 / (download) - annotate - [select for diffs], Sat Dec 12 17:16:56 2015 UTC (8 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.148: +2 -2 lines
Diff to previous 1.148 (colored)

allow overriding the default cipher-suite

ok jung@, sunil@, millert@

Revision 1.148 / (download) - annotate - [select for diffs], Sat Dec 12 12:22:25 2015 UTC (8 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.147: +3 -1 lines
Diff to previous 1.147 (colored)

add bits so local enqueuer can run filters when they are enabled

Revision 1.147 / (download) - annotate - [select for diffs], Sat Dec 12 11:31:29 2015 UTC (8 years, 5 months ago) by sunil
Branch: MAIN
Changes since 1.146: +2 -1 lines
Diff to previous 1.146 (colored)

Implement senders map.

senders table allows to restrict the addresses that an authenticated
user can use in the SMTP dialogue.

Ok gilles@

Revision 1.146 / (download) - annotate - [select for diffs], Sat Dec 12 09:54:48 2015 UTC (8 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.145: +4 -3 lines
Diff to previous 1.145 (colored)

display CA name in log debug

Revision 1.145 / (download) - annotate - [select for diffs], Fri Dec 11 20:14:14 2015 UTC (8 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.144: +8 -10 lines
Diff to previous 1.144 (colored)

fix a logic error in smtp_can_accept() which caused smtpd to accept less
concurrent sessions than it really could.

ok millert@, ok jung@

Revision 1.144 / (download) - annotate - [select for diffs], Mon Nov 30 12:49:35 2015 UTC (8 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.143: +3 -3 lines
Diff to previous 1.143 (colored)

mechanical rename of some IMSG constants

ok sunil@, ok jung@

Revision 1.143 / (download) - annotate - [select for diffs], Tue Jan 20 17:37:54 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.142: +2 -2 lines
Diff to previous 1.142 (colored)

use <limits.h> comprehensively.  For now try to push <> includes to
each .c file, and out of the .h files.  To avoid overinclude.
ok gilles, in principle.  If this has been done right, -portable should
become easier to maintain.

Revision 1.142 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:21 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.141: +2 -1 lines
Diff to previous 1.141 (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.141 / (download) - annotate - [select for diffs], Wed Nov 5 19:38:09 2014 UTC (9 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.140: +2 -2 lines
Diff to previous 1.140 (colored)

stop prepending the user id in local enqueuing Received line

Revision 1.140 / (download) - annotate - [select for diffs], Sun Oct 12 11:49:38 2014 UTC (9 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.139: +4 -4 lines
Diff to previous 1.139 (colored)

local host is not "localhost", local host is env->sc_hostname

Revision 1.139 / (download) - annotate - [select for diffs], Tue Jul 8 14:38:17 2014 UTC (9 years, 11 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.138: +1 -30 lines
Diff to previous 1.138 (colored)

remove dead code. these imsgs are handled in pony.c.

Revision 1.138 / (download) - annotate - [select for diffs], Tue Jul 8 07:59:31 2014 UTC (9 years, 11 months ago) by sobrado
Branch: MAIN
Changes since 1.137: +2 -2 lines
Diff to previous 1.137 (colored)

fix typos.

ok jmc@

Revision 1.137 / (download) - annotate - [select for diffs], Tue Apr 29 19:13:13 2014 UTC (10 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.136: +2 -2 lines
Diff to previous 1.136 (colored)

Implement RSA privilege separation for OpenSMTPD, based on my previous
implementation for relayd(8).  The smtpd(8) pony processes (mta
client, smtp server) don't keep the private keys in memory but send
their private key operations as imsgs to the "lookup"/mta process.
It's worth mentioning that this prevents acidental private key leakage
as it could have been caused by "Heartbleed".

ok gilles@

Revision 1.136 / (download) - annotate - [select for diffs], Sat Apr 19 13:52:49 2014 UTC (10 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.135: +4 -4 lines
Diff to previous 1.135 (colored)

(cast) void two strlcpy() and a snprintf() that cannot truncate

Revision 1.135 / (download) - annotate - [select for diffs], Wed Apr 9 18:55:19 2014 UTC (10 years, 2 months ago) by eric
Branch: MAIN
Changes since 1.134: +0 -8 lines
Diff to previous 1.134 (colored)

Zap the mfa process. It is not currently doing anything, and content filtering
will be done at session level anyway.

ok gilles@

Revision 1.134 / (download) - annotate - [select for diffs], Fri Apr 4 16:10:42 2014 UTC (10 years, 2 months ago) by eric
Branch: MAIN
Changes since 1.133: +24 -92 lines
Diff to previous 1.133 (colored)

Merge the mda, mta and smtp processes into a single unprivileged
process managing message reception, delivery and transfer.  Mostly
mechanical, but very intrusive as it required to rewamp all IMSG to
fix ambiguities.

with and ok gilles@

Revision 1.133 / (download) - annotate - [select for diffs], Tue Feb 4 13:44:41 2014 UTC (10 years, 4 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.132: +40 -74 lines
Diff to previous 1.132 (colored)

pki code cleanup

- rename "struct ssl" and "cert" to "struct pki" and "cert" to "pki_name"
- inherit pki conf on fork instead of passing it through imsg at startup
- implement SNI on smtp listeners

Revision 1.132 / (download) - annotate - [select for diffs], Tue Feb 4 09:05:06 2014 UTC (10 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.131: +1 -3 lines
Diff to previous 1.131 (colored)

get rid of fdlimit()

Revision 1.131 / (download) - annotate - [select for diffs], Thu Dec 5 15:05:53 2013 UTC (10 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.130: +1 -0 lines
Diff to previous 1.130 (colored)

missing init

Revision 1.130 / (download) - annotate - [select for diffs], Wed Nov 6 10:01:29 2013 UTC (10 years, 7 months ago) by eric
Branch: MAIN
Changes since 1.129: +5 -2 lines
Diff to previous 1.129 (colored)

Much much improved config parser and related changes.
Simplify code and do not impose an order on conditions and rule options.

Format changes that may require smtpd.conf update for some setups:

- SSL certificates are no longer automatically loaded, but must be
  explicitely declared using the "pki" keyword.
- "certificate" option becomes "pki" in listener and accept rules.
- "ssl://" becomes "secure://" in relay via rules.
- "helo" becomes "hostnames" in relay rules

New features:

- accept rules do not need an explicit action, in which case alias table
  or .forward must provide one.
- new "forward-only" action to force relaying and reject rcpts that expand
  as local delivery.
- "!" (negation) modifier on rule matching conditions.
- new "recipient" rule matching condition.
- new "verify" option on listeners and relay rules to reject invalid
  certificates.

Other changes:

- remember the helo name advertised on incoming mail and use it for sending
  bounces.
- bump envelope version (existing envelopes are updated on-the-fly).

Revision 1.129 / (download) - annotate - [select for diffs], Sun Oct 27 11:01:47 2013 UTC (10 years, 7 months ago) by eric
Branch: MAIN
Changes since 1.128: +1 -2 lines
Diff to previous 1.128 (colored)

Make the filter infrastructure move forward.
This is a work-in-progress and it's not supposed to be useable for now.

Revision 1.128 / (download) - annotate - [select for diffs], Sun Oct 27 07:56:25 2013 UTC (10 years, 7 months ago) by eric
Branch: MAIN
Changes since 1.127: +2 -1 lines
Diff to previous 1.127 (colored)

Create the control socket in the parent process to abort early if
another smtpd instance is running.  Close the inherited socket in
every forked process but control.

Revision 1.127 / (download) - annotate - [select for diffs], Fri Jul 19 11:14:08 2013 UTC (10 years, 10 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.126: +4 -3 lines
Diff to previous 1.126 (colored)

Get rid of env->sc_pw and env->sc_pwqueue.  Early queue initialization
now happens in queue_init(), and backends take the queue passwd as
parameter in their init function.

Remove useless SMTPD_FILTER_USER while there.

Revision 1.126 / (download) - annotate - [select for diffs], Fri Jul 19 07:49:08 2013 UTC (10 years, 10 months ago) by eric
Branch: MAIN
Changes since 1.125: +1 -2 lines
Diff to previous 1.125 (colored)

Remove useless sc_pid from struct smtpd.

Revision 1.125 / (download) - annotate - [select for diffs], Fri May 24 17:03:14 2013 UTC (11 years ago) by eric
Branch: MAIN
Changes since 1.124: +3 -3 lines
Diff to previous 1.124 (colored)

sync with OpenSMTPD 5.3.2

ok gilles@

Revision 1.124 / (download) - annotate - [select for diffs], Mon Mar 11 17:40:11 2013 UTC (11 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.123: +3 -2 lines
Diff to previous 1.123 (colored)

handle ECONNABORTED errors from accept().  In many code blocks they can be
ignored silently and without aborting, much like EINTR and EWOULDBLOCK are.
ok's from various maintainers of these directories...

Revision 1.123 / (download) - annotate - [select for diffs], Sat Jan 26 09:37:23 2013 UTC (11 years, 4 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.122: +133 -245 lines
Diff to previous 1.122 (colored)

Sync with our smtpd repo:

* first bricks of ldap and sqlite support (not finished but both working)
* new table API to replace map API, all lookups are done through tables
* improved handling of temporary errors throughout the daemon
* improved scheduler and mta logic: connection reuse, optimizes batches
* improved queue: more tolerant to admin errors, new layout, less disk-IO
* improved memory usage under high load
* SSL certs/keys isolated to lookup process to avoid facing network
* VIRTUAL support improved, fully virtual setups possible now
* runtime tracing of processes through smtpctl trace
* ssl_privsep.c sync-ed with relayd
* ssl.c no longer contains smtpd specific interfaces
* smtpd-specific ssl bits moved to ssl_smtpd.c
* update mail address in copyright

FLUSH YOUR QUEUE. FLUSH YOUR QUEUE. FLUSH YOUR QUEUE. FLUSH YOUR QUEUE.

smtpd.conf(5) simplified, it will require adaptations

ok eric@

Revision 1.122 / (download) - annotate - [select for diffs], Fri Nov 23 10:55:25 2012 UTC (11 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.121: +17 -10 lines
Diff to previous 1.121 (colored)

knf

ok gilles@

Revision 1.121 / (download) - annotate - [select for diffs], Mon Nov 12 14:58:53 2012 UTC (11 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.120: +10 -10 lines
Diff to previous 1.120 (colored)

Cleanups and improvements:

* Log more events (especially client session) and use a better scheme
  for that: each messages is prefixed with a token to easily identify
  its class:
    - info/warn/debug: general server messages
    - smtp-in: smtp client connections
    - relay: status update for relayed messages
    - delivery: status update for local deliveries

* Implement "smtpctl monitor" to display updates of selected internal
  counters.

* When reloading the on-disk queue at startup do not commit a message
  if no envelope was submitted for that message.

* Remove unused stuff in the config parser.

ok gilles@

Revision 1.120 / (download) - annotate - [select for diffs], Sun Oct 7 15:46:38 2012 UTC (11 years, 8 months ago) by chl
Branch: MAIN
Changes since 1.119: +2 -3 lines
Diff to previous 1.119 (colored)

convert iobuf_queue()'s to iobuf_fqueue(). (idea from gilles@)
introduce iobuf_xinit() and iobuf_xfqueue(). (idea from eric@)

ok gilles@

Revision 1.119 / (download) - annotate - [select for diffs], Wed Oct 3 16:43:19 2012 UTC (11 years, 8 months ago) by chl
Branch: MAIN
Changes since 1.118: +3 -5 lines
Diff to previous 1.118 (colored)

don't try to cope with iobuf_init() failure, make it fatal() instead.

from eric@ input

ok gilles@

Revision 1.118 / (download) - annotate - [select for diffs], Tue Oct 2 12:37:38 2012 UTC (11 years, 8 months ago) by chl
Branch: MAIN
Changes since 1.117: +11 -6 lines
Diff to previous 1.117 (colored)

check iobuf_init() return value.

ok gilles@ eric@

Revision 1.117 / (download) - annotate - [select for diffs], Sat Sep 29 22:16:46 2012 UTC (11 years, 8 months ago) by chl
Branch: MAIN
Changes since 1.116: +10 -17 lines
Diff to previous 1.116 (colored)

use xstrdup() helper

ok eric@ gilles@

Revision 1.116 / (download) - annotate - [select for diffs], Wed Sep 19 18:20:36 2012 UTC (11 years, 8 months ago) by eric
Branch: MAIN
Changes since 1.115: +1 -2 lines
Diff to previous 1.115 (colored)

Remove DF_ENQUEUE flag. It is mostly unused and logically broken.
Ignore it in existing envelopes until it gets completely dropped.
Change "smtpctl show queue" to display the address family of the
envelope source instead of the ENQUEUE flag.

ok gilles@

Revision 1.115 / (download) - annotate - [select for diffs], Mon Sep 17 18:36:14 2012 UTC (11 years, 8 months ago) by eric
Branch: MAIN
Changes since 1.114: +2 -2 lines
Diff to previous 1.114 (colored)

increment the session counter when a session is created.
fix a bug where local sessions were not accounted for.

ok gilles@

Revision 1.114 / (download) - annotate - [select for diffs], Mon Sep 17 08:32:00 2012 UTC (11 years, 8 months ago) by eric
Branch: MAIN
Changes since 1.113: +1 -3 lines
Diff to previous 1.113 (colored)

fix pasto

prompted by gilles@

Revision 1.113 / (download) - annotate - [select for diffs], Sun Sep 16 19:16:23 2012 UTC (11 years, 8 months ago) by gilles
Branch: MAIN
Changes since 1.112: +23 -5 lines
Diff to previous 1.112 (colored)

we need to ensure we have at least two descriptors per-client accepted, or
we will hit an imsg_read() fatal (EAGAIN) when a client sends DATA, and we
don't have a descriptor for it.

Revision 1.112 / (download) - annotate - [select for diffs], Sun Sep 16 16:43:29 2012 UTC (11 years, 8 months ago) by chl
Branch: MAIN
Changes since 1.111: +1 -3 lines
Diff to previous 1.111 (colored)

Factorize log_imsg() in imsg_dispatch() instead of in each imsg_callback()'s
and put it out of profiling, so it's not accounted.

While there, for PROC_PARENT:
- set smtpd_process for PROC_PARENT
- use setproctitle() like other processes

ok gilles@

Revision 1.111 / (download) - annotate - [select for diffs], Sat Sep 15 15:12:11 2012 UTC (11 years, 8 months ago) by eric
Branch: MAIN
Changes since 1.110: +6 -15 lines
Diff to previous 1.110 (colored)

When enqueueing from the local socket, the input address is faked as "::1".
This is confusing and even broken, as systems running with ipv6 disabled on
lo0 will not be able to enqueue mails using the local socket.

So instead, use AF_LOCAL and print it as "local" in envelopes/maps.  Add it
to the "localhost" and "all" maps accordingly, and fix the ruleset matching.

ok gilles@ chl@

Revision 1.110 / (download) - annotate - [select for diffs], Fri Sep 14 16:38:53 2012 UTC (11 years, 8 months ago) by eric
Branch: MAIN
Changes since 1.109: +6 -8 lines
Diff to previous 1.109 (colored)

Check limits before allocating the session.
While there, move smtp_resume() in the if block; it makes more sense.

ok gilles@

Revision 1.109 / (download) - annotate - [select for diffs], Wed Aug 29 16:26:17 2012 UTC (11 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.108: +1 -2 lines
Diff to previous 1.108 (colored)

Introduce the crypto_backend API and provide support for... encrypted queue
using the new API. By default, OpenSMTPD does not provide queue encryption,
but it can be enabled with "queue encryption [args]" and will transparently
encrypt/decrypt envelopes/messages as they hit the queue.

By default, it will use Blowfish in CBC mode with a different random IV for
each envelope and message. User provided key is expanded using sha256 but a
different cipher and digest may be specified in smtpd.conf

Queue encryption is compatible with compression and if both options are set
it will do them in correct order and transparently.

tested by chl@, a few users and myself
ok chl@ and I

Revision 1.108 / (download) - annotate - [select for diffs], Sat Aug 25 22:03:26 2012 UTC (11 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.107: +2 -6 lines
Diff to previous 1.107 (colored)

- add myself to the copyright in control.c, i've done quite a few changes
there in the last few years ;-)
- get rid of availdesc(): getdtablecount() is so much more reliable
- get rid of env->sc_maxconn, we can be much smarter with getdtablecount()
	and getdtablesize()
- disable accept when we hit the control process fd reserve
- disable accept when we fail
- enable accept when we're back below the limit

this is not the full fd exhaustion diff, i'll merge changes from relayd
tomorrow, this was only required to get rid of the env->sc_maxconn and
availdesc() mess

"reads alright" eric@

Revision 1.107 / (download) - annotate - [select for diffs], Sat Aug 25 21:33:33 2012 UTC (11 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.106: +39 -26 lines
Diff to previous 1.106 (colored)

- stop accepting clients if we hit our fd reserve limit (or if we fail)
- resume if we go below the fd reserve

with feedback and ok eric@

Revision 1.106 / (download) - annotate - [select for diffs], Sat Aug 25 10:23:12 2012 UTC (11 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.105: +4 -4 lines
Diff to previous 1.105 (colored)

- introduce struct stat_value
- statistics can now have a type (counter, timestamp, timeval, timespec and
  possibly others in the future)
- stat_increment() / stat_decrement() now take an increment/decrement value
  and are at the moment only of type counter
- stat_set() now takes a stat_value
- provide helpers to convert raw values to stat_value

ok eric@, ok chl@

while at it fix a rq_queue_dump() call using a bogus timestamp in scheduler
ramqueue.

Revision 1.105 / (download) - annotate - [select for diffs], Sun Aug 19 14:16:58 2012 UTC (11 years, 9 months ago) by chl
Branch: MAIN
Changes since 1.104: +4 -4 lines
Diff to previous 1.104 (colored)

coding style: replace all occurences of u_int* with uint*

ok eric@

Revision 1.104 / (download) - annotate - [select for diffs], Sat Aug 18 18:18:23 2012 UTC (11 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.103: +21 -4 lines
Diff to previous 1.103 (colored)

- introduce stat_backend, an API for pluggable statistic backends
  > statistics are no longer static structures in shared memory
  > statistics are only set, smtpd never uses them in its logic
  > each statistic is a key/value where key can be any (dynamic) string
- convert all uses of the former API to use the new one
- implement stat_ramstat that keeps non-persistent stats in ram structure

ok eric@, ok chl@

Revision 1.103 / (download) - annotate - [select for diffs], Thu Aug 9 09:48:02 2012 UTC (11 years, 10 months ago) by eric
Branch: MAIN
Changes since 1.102: +2 -2 lines
Diff to previous 1.102 (colored)

Improve the message flows to completely isolate operations on the
queue backend within the queue process.

The scheduler sends envelope ids to the queue process which loads
the envelope and forward the request to the agent responsible for
the delivery.  The result is sent by the agent to the queue which
updates the storage before notifying the scheduler.

Bounces are created and enqueued (from the client side) by the
queue process, rather than the scheduler.

ok gilles@

Revision 1.102 / (download) - annotate - [select for diffs], Fri Jun 1 14:55:09 2012 UTC (12 years ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.101: +3 -1 lines
Diff to previous 1.101 (colored)

allow to pause some subsystems at startup.

ok gilles@ chl@

Revision 1.101 / (download) - annotate - [select for diffs], Tue Jan 31 21:05:26 2012 UTC (12 years, 4 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.100: +5 -5 lines
Diff to previous 1.100 (colored)

fix an issue observed this week-end while flooding ajacoutot@ :

we keep track of available fd's to prevent scheduling of messages if we
know that we are going to fail. however, since the envelope is not
removed from the scheduler, it will be rescheduled right away leading to
a busy loop in the scheduler. we know flag the mda/mta processes as BUSY
and do not schedule envelopes that target a BUSY process.

also, fix a potential bug that could lead to a use after free when doing
a batch/message/host traversal of schedulable envelopes.

while at it fix misuse of env->sc_opts as env->sc_flags, was not really
causing any issue as the misuse was constant ...

Revision 1.100 / (download) - annotate - [select for diffs], Sun Jan 29 11:37:32 2012 UTC (12 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.99: +15 -18 lines
Diff to previous 1.99 (colored)

Rewrite io code in smtp and mta using the iobuf/ioev interface to have
a better separation between io and protocol logic.  As a side-effect,
it fixes a couple of long-standing issues in the io path, and
hopefully add fresh ones instead.  Kill client.c in the process.

ok gilles@

Revision 1.99 / (download) - annotate - [select for diffs], Wed Jan 18 13:41:54 2012 UTC (12 years, 4 months ago) by chl
Branch: MAIN
Changes since 1.98: +6 -1 lines
Diff to previous 1.98 (colored)

Add new filters callbacks for:
- network events (CONNECT/CLOSE)
- commands (QUIT/RSET)

ok gilles@ eric@

Revision 1.98 / (download) - annotate - [select for diffs], Fri Jan 13 14:27:55 2012 UTC (12 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.97: +2 -2 lines
Diff to previous 1.97 (colored)

remove the status field from struct envelope, move it to the smtp
session, and cleanup the DS_* flags.

ok gilles@ chl@

Revision 1.97 / (download) - annotate - [select for diffs], Thu Jan 12 18:06:18 2012 UTC (12 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.96: +1 -34 lines
Diff to previous 1.96 (colored)

Remove dead code for config reloading for now. It is not functionnal
and confusing.

ok gilles@

Revision 1.96 / (download) - annotate - [select for diffs], Tue Dec 13 23:55:00 2011 UTC (12 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.95: +9 -1 lines
Diff to previous 1.95 (colored)

*finally* make use of certificate authority file if available !

bits from relayd, ok chl@, ok eric@

Revision 1.95 / (download) - annotate - [select for diffs], Mon Dec 12 17:17:55 2011 UTC (12 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.94: +6 -6 lines
Diff to previous 1.94 (colored)

display proc name rather than function name in debug message

ok gilles@ chl@

Revision 1.94 / (download) - annotate - [select for diffs], Mon Nov 14 19:23:41 2011 UTC (12 years, 6 months ago) by chl
Branch: MAIN
Changes since 1.93: +3 -2 lines
Diff to previous 1.93 (colored)

when receiving an unexpected imsg, print its name.

with help and ideas from eric@

ok eric@ gilles@

Revision 1.93 / (download) - annotate - [select for diffs], Sun Oct 23 09:30:07 2011 UTC (12 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.92: +12 -12 lines
Diff to previous 1.92 (colored)

fsqueue no longer stores envelopes by dumping the structure, instead use a
couple of load/dump functions to convert to and from a human readable fmt.
while at it kill struct delivery and merge back its fields to the envelope.

this basically means we shouldn't require users to flush their queues every
time we make a change to struct envelope.

work is not done, but we're at a better state than the binary fsqueue so
we'll improve it in-tree.

has been running on my own box for the last 12 hours or so
ok eric@, chl@

Revision 1.92 / (download) - annotate - [select for diffs], Sun Oct 9 18:39:54 2011 UTC (12 years, 8 months ago) by eric
Branch: MAIN
Changes since 1.91: +3 -7 lines
Diff to previous 1.91 (colored)

show messages sent between processes in debug mode

ok gilles@ chl@

Revision 1.91 / (download) - annotate - [select for diffs], Thu Sep 1 20:17:47 2011 UTC (12 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.90: +2 -2 lines
Diff to previous 1.90 (colored)

move a log_debug() call to a less annoying spot so that it does not get
called for each single line of DATA exchanged between smtp and mfa

Revision 1.90 / (download) - annotate - [select for diffs], Thu Sep 1 19:56:49 2011 UTC (12 years, 9 months ago) by eric
Branch: MAIN
Changes since 1.89: +7 -15 lines
Diff to previous 1.89 (colored)

Introduce a small set of functions to manage stat counters in a
simpler and hopefully saner way.

ok gilles@ chl@

Revision 1.89 / (download) - annotate - [select for diffs], Wed Aug 31 18:56:30 2011 UTC (12 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.88: +2 -1 lines
Diff to previous 1.88 (colored)

add support for per-line DATA callbacks, this allows filters to take their
decisions *while* the message is being received by the client.

Revision 1.88 / (download) - annotate - [select for diffs], Mon Aug 29 18:49:29 2011 UTC (12 years, 9 months ago) by chl
Branch: MAIN
Changes since 1.87: +2 -1 lines
Diff to previous 1.87 (colored)

add missing header needed by signal()

ok gilles@

Revision 1.87 / (download) - annotate - [select for diffs], Sat Aug 27 22:32:41 2011 UTC (12 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.86: +4 -3 lines
Diff to previous 1.86 (colored)

initial support for a session-time filtering API

currently only HELO/EHLO, MAIL, RCPT are supported, however ... I have
voluntarily disabled filters at smtpd.conf level so people don't play with
it until the API has stabilized a bit

discussed with several people in private, no one opposed the feature

Revision 1.86 / (download) - annotate - [select for diffs], Mon May 16 21:05:52 2011 UTC (13 years ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.85: +12 -12 lines
Diff to previous 1.85 (colored)

murder struct path and make sure smtpd uses simpler structures that do not
bring a shitload of unnecessary information everywhere. this required many
parts of smtpd to be refactored and more specifically envelope expansion.

in the process lots of code got simplified, and the envelope expansion code
has been isolated to lka_session.c with some longstanding bugs fixed.

Diff has been tested by many with no major regression reported.
armani@ spotted a bug in a setup where a domain is listed a both primary
and virtual, I will fix that in-tree as it's becoming painful to maintain
this diff out.

Revision 1.85 / (download) - annotate - [select for diffs], Sun May 1 12:57:11 2011 UTC (13 years, 1 month ago) by eric
Branch: MAIN
Changes since 1.84: +36 -40 lines
Diff to previous 1.84 (colored)

the smtpd env is meant to be global, so do not pass it all around.

discussed with and ok gilles@

Revision 1.84 / (download) - annotate - [select for diffs], Sun Apr 17 13:36:07 2011 UTC (13 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.83: +22 -21 lines
Diff to previous 1.83 (colored)

cleanups, cosmethic changes, functions that should be static are now static
no functionnal change

Revision 1.83 / (download) - annotate - [select for diffs], Sun Apr 17 11:39:23 2011 UTC (13 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.82: +2 -2 lines
Diff to previous 1.82 (colored)

a structure describing an envelope should be called struct envelope, not
struct message ...

Revision 1.82 / (download) - annotate - [select for diffs], Fri Apr 15 17:01:05 2011 UTC (13 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.81: +2 -3 lines
Diff to previous 1.81 (colored)

kill message_id and message_uid

smtpd now has an evpid associated to each delivery message, the evpid is an
u_int64_t where the upper 32 bits are the msgid, and the 32 bits are the
envelope unique identifier for that message. this results in lots of space
saved in both disk-based and ram-based queues, but also simplifies a lot of
code.

change has been stressed on my desktop, and has ran on my MX for the entire
afternoon without a regression.

Revision 1.81 / (download) - annotate - [select for diffs], Tue Mar 15 19:24:55 2011 UTC (13 years, 2 months ago) by gilles
Branch: MAIN
Changes since 1.80: +8 -1 lines
Diff to previous 1.80 (colored)

let smtpd use user-provided Diffie-Hellman parameters for ephemeral key
exchange. if no DH parameters are found, fallback to builtin parameters
as was done until now.

since we now accept user-provided DH parameters, make smtpd more strict
and fatal() if the parameters are bogus.

bump the key size of the DH parameters from 512bits to 1024bits, it might
be bumped further after some more research.

thanks to mikeb@ for his suggestions

diff ok mikeb@ , man ok jmc@

Revision 1.80 / (download) - annotate - [select for diffs], Wed Mar 9 20:59:22 2011 UTC (13 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.79: +8 -1 lines
Diff to previous 1.79 (colored)

smtpctl show stats displays inet4/inet6 repartition for incoming sessions

Revision 1.79 / (download) - annotate - [select for diffs], Sun Nov 28 14:35:58 2010 UTC (13 years, 6 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.78: +1 -7 lines
Diff to previous 1.78 (colored)

remove all unused headers

Revision 1.78 / (download) - annotate - [select for diffs], Sun Nov 28 13:56:43 2010 UTC (13 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.77: +3 -1 lines
Diff to previous 1.77 (colored)

a bit of .h cleanups, no functionnal change

Revision 1.77 / (download) - annotate - [select for diffs], Wed Nov 24 23:27:04 2010 UTC (13 years, 6 months ago) by todd
Branch: MAIN
Changes since 1.76: +4 -1 lines
Diff to previous 1.76 (colored)

add *maxactive stats
"ok and no need to keep them for yourself" gilles@

Revision 1.76 / (download) - annotate - [select for diffs], Sat Oct 9 22:05:35 2010 UTC (13 years, 8 months ago) by gilles
Branch: MAIN
Changes since 1.75: +74 -41 lines
Diff to previous 1.75 (colored)

backout the "new" queue code commited 4 months ago. it has many good ideas,
is way more optimized than what we had earlier and there's definitely stuff
we want to keep, however it is early optimization that doesn't account for
many features and makes them hard (if not impossible) to write without
ugly workarounds that ruin the purpose of the optimizations.

the backout goes to 30 May's right before the commit and catches up on all
the non-queue related commits that happened since then.

i'll work on reintroducing the ideas from this queue when the basic
features we expect from a MTA are implemented.

suggested on tech@ about a week ago, no objections, several "please make
smtpd move forward" mails from hackers and tech readers.

Revision 1.75 / (download) - annotate - [select for diffs], Wed Jun 2 19:16:53 2010 UTC (14 years ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.74: +3 -2 lines
Diff to previous 1.74 (colored)

check event_dispatch() return value

ok jacekm@

Revision 1.74 / (download) - annotate - [select for diffs], Tue Jun 1 23:06:23 2010 UTC (14 years ago) by jacekm
Branch: MAIN
Changes since 1.73: +42 -74 lines
Diff to previous 1.73 (colored)

new queue, again; gcc2 compile tested by deraadt

Revision 1.73 / (download) - annotate - [select for diffs], Tue Jun 1 19:47:09 2010 UTC (14 years ago) by jacekm
Branch: MAIN
Changes since 1.72: +73 -40 lines
Diff to previous 1.72 (colored)

New queue doesn't compile on gcc2, back out.  Spotted by deraadt@

Revision 1.72 / (download) - annotate - [select for diffs], Mon May 31 23:38:56 2010 UTC (14 years ago) by jacekm
Branch: MAIN
Changes since 1.71: +41 -74 lines
Diff to previous 1.71 (colored)

Rewrite entire queue code.

Major goals:

1) Fix bad performance caused by the runner process doing full queue
read in 1s intervals.  My Soekris can now happily accept >50 msg/s
while having multi-thousand queue; before, one hundred queue would
bring the system to its knees.

2) Introduce Qmail-like scheduler that doesn't write as much to the
disk so that it needs less code for servicing error conditions,
which in some places can be tricky to get right.

3) Introduce separation between the scheduler and the backend; these
two queue aspects shouldn't be too tied too each other.  This means
that eg. storing queue in SQL requires rewrite of just queue_backend.c.

4) Make on-disk queue format architecture independent, and more
easily extensible, to reduce number of flag days in the future.

Minor goals:

ENOSPC no longer prevents delivery attempts, fixed session limiting
for relayed mail, improved batching of "relay via" mails, human-readable
mailq output, "show queue raw" command, clearer logging, sending
of single bounce about multiple recipients, exact delay= computation,
zero delay between deliveries while within session limit (currently
1s delay between re-scheduling is enforced), mta no longer requests
content fd, corrected session limit for bounce submissions, tiny
<100B queue files instead of multi-KB, detect loops before accepting
mail, reduce traffic on imsg channels by killing enormous struct
submit_status.

Revision 1.71 / (download) - annotate - [select for diffs], Wed May 19 20:57:10 2010 UTC (14 years ago) by gilles
Branch: MAIN
Changes since 1.70: +3 -1 lines
Diff to previous 1.70 (colored)

cleanup-only commit, removes unrequired includes, no functionnal change

Revision 1.70 / (download) - annotate - [select for diffs], Wed Apr 21 18:54:43 2010 UTC (14 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.69: +8 -13 lines
Diff to previous 1.69 (colored)

Runner process is just a helper for queue, so tear down its imsg
channels to parent, mda, mta, lka, smtp, and control.  This leaves
just the channel to queue, which forwards imsgs on runner's behalf
and redirects any replies back to it.

OK gilles@

Revision 1.69 / (download) - annotate - [select for diffs], Wed Apr 21 08:29:01 2010 UTC (14 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.68: +1 -7 lines
Diff to previous 1.68 (colored)

Remove unusable ifdef DEBUG code.

Revision 1.68 / (download) - annotate - [select for diffs], Tue Apr 20 15:34:56 2010 UTC (14 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.67: +186 -478 lines
Diff to previous 1.67 (colored)

Kill *2400* lines of code by abstracting common bits of the imsg handlers.

Revision 1.67 / (download) - annotate - [select for diffs], Sun Jan 3 14:37:37 2010 UTC (14 years, 5 months ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.66: +10 -1 lines
Diff to previous 1.66 (colored)

Implement "log verbose" and "log brief" to enable or disable verbose debug
logging on runtime.

Based on claudio@'s work on ripd, ospfd, ospf6d, dvmrpd, ldpd, bgpd.

With help/ideas/testing from gilles@ jacekm@ todd@

ok jacekm@

Revision 1.66 / (download) - annotate - [select for diffs], Mon Dec 14 19:49:22 2009 UTC (14 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.65: +5 -1 lines
Diff to previous 1.65 (colored)

Set initial session limit so that IMSG_SMTP_ENQUEUE can be satisfied even
in absence of all other real listening sockets.

Spotted by todd@

Revision 1.65 / (download) - annotate - [select for diffs], Sun Dec 13 22:02:55 2009 UTC (14 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.64: +113 -139 lines
Diff to previous 1.64 (colored)

Use safe fd limits in smtp, lka, queue, and control.  Removes a
possibility for fd-starvation fatal when under heavy load.

Revision 1.64 / (download) - annotate - [select for diffs], Sun Nov 8 21:40:05 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.63: +4 -4 lines
Diff to previous 1.63 (colored)

- make aliases expansion use a rb tree instead of a tail queue, the code
  doesn't take advantage of the new structure yet, but this was a needed
  change for upcoming improvements.
- introduce aliasestree_{lookup,insert,remove} to the aliases api
- rename queue_generate_id() to generate_uid() and move it to utils.c as
  it is used all over the place and not only in queue

tree idea discussed with jacekm@, if you update rebuild aliases db, make
clean and flush queue

Revision 1.63 / (download) - annotate - [select for diffs], Sun Oct 25 21:06:06 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.62: +2 -1 lines
Diff to previous 1.62 (colored)

tag should also be copied from listener to message when the message is
enqueued through smtpctl

Revision 1.62 / (download) - annotate - [select for diffs], Fri Sep 18 00:04:26 2009 UTC (14 years, 8 months ago) by jacekm
Branch: MAIN
Changes since 1.61: +10 -7 lines
Diff to previous 1.61 (colored)

Remove useless Received line added at the /usr/sbin/sendmail stage, it
was not correctly formatted anyway.  Recording of sender uid has
been moved to the server process (getpeereid), which means it is not
subject to forgery.
Based on problem report by Michael Lechtermann <michael@lechtermann.net>

Revision 1.61 / (download) - annotate - [select for diffs], Thu Sep 3 08:19:13 2009 UTC (14 years, 9 months ago) by jacekm
Branch: MAIN
Changes since 1.60: +7 -7 lines
Diff to previous 1.60 (colored)

imsg_get sets errno so use fatal instead of fatalx.

Revision 1.60 / (download) - annotate - [select for diffs], Thu Aug 6 16:46:57 2009 UTC (14 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.59: +2 -2 lines
Diff to previous 1.59 (colored)

- change all occurences of T_DAEMON_BATCH,MESSAGE to T_BOUNCE_BATCH/MESSAGE
- make sure T_BOUNCE_MESSAGE is no longer OR-ed to T_MDA/MTA_MESSAGE
- define F_MESSAGE_BOUNCE flag and make sure bounce sessions set it
- teach smtpctl show queue how to recognize a bounce message

Revision 1.59 / (download) - annotate - [select for diffs], Thu Aug 6 13:40:45 2009 UTC (14 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.58: +105 -2 lines
Diff to previous 1.58 (colored)

This commit reworks the entire mailer daemon support to actually make it
work for real. As an added bonus, it simplifies it, makes it follow the
same code path as regular messages and kills quite some code from mta,
mda and store. There's still some work needed but the most painful part
is behind us now ;)

ok jacekm@

Revision 1.58 / (download) - annotate - [select for diffs], Sun Jun 7 05:56:25 2009 UTC (15 years ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.57: +3 -3 lines
Diff to previous 1.57 (colored)

Change the way fds passed over a socket are retreived on the receiving side.

Currently the receiver fetches an imsg via imsg_get() and if he expects
an fd, he then calls imsg_get_fd() to fetch the next fd queued on the
imsgbuf from which the imsg came.

This changes hides the fd queueing mechanism to the API user.  When closing
an imsg with an fd, the message is flagged so that the receiving end knows
it must dequeue the fd in imsg_get() and return it with the imsg structure.
This way there is no (less) possible screw up from imsg_get_fd() not being
called directly after imsg_get() by the user. The retreived imsg is
self-contained.

ok pyr@, "I like that" henning@

Revision 1.57 / (download) - annotate - [select for diffs], Sat Jun 6 04:14:21 2009 UTC (15 years ago) by pyr
Branch: MAIN
Changes since 1.56: +30 -19 lines
Diff to previous 1.56 (colored)

Sync with relayd:
Stop pushing event handling in the imsg framework.
Instead, provide a small glue layer on top of both imsg and libevent.
This finally clearly separates event handling and imsg construction.

Sidetrack bonus: remove the mega-ugly hack of having a dummy imsg_event_add
stub in smtpctl.
ok jaceckm@

Revision 1.56 / (download) - annotate - [select for diffs], Fri Jun 5 20:43:57 2009 UTC (15 years ago) by pyr
Branch: MAIN
Changes since 1.55: +6 -6 lines
Diff to previous 1.55 (colored)

make smtpd's imsg lib ready, just like relayd and ospfd.
ok gilles@, jacekm@

Revision 1.55 / (download) - annotate - [select for diffs], Tue Jun 2 22:23:36 2009 UTC (15 years ago) by gilles
Branch: MAIN
Changes since 1.54: +19 -13 lines
Diff to previous 1.54 (colored)

make env->sc_listeners and env->sc_ssl pointers, one step further toward
configuration reloading without killing active sessions; ok jacekm@

Revision 1.54 / (download) - annotate - [select for diffs], Mon Jun 1 14:38:45 2009 UTC (15 years ago) by jacekm
Branch: MAIN
Changes since 1.53: +11 -4 lines
Diff to previous 1.53 (colored)

Don't destroy listening socket when pause/resume request is received,
use event_del/event_add instead; ok gilles@

Revision 1.53 / (download) - annotate - [select for diffs], Mon Jun 1 13:20:56 2009 UTC (15 years ago) by jacekm
Branch: MAIN
Changes since 1.52: +26 -41 lines
Diff to previous 1.52 (colored)

Fix EV_READ/EV_WRITE testing inside IMSG handlers. Based on similar change
to the routing daemons by claudio@; ok gilles@

Revision 1.52 / (download) - annotate - [select for diffs], Mon May 25 14:00:36 2009 UTC (15 years ago) by jacekm
Branch: MAIN
Changes since 1.51: +1 -16 lines
Diff to previous 1.51 (colored)

merge smtp_listener_setup into its only caller; ok gilles@

Revision 1.51 / (download) - annotate - [select for diffs], Sun May 24 15:47:31 2009 UTC (15 years ago) by jacekm
Branch: MAIN
Changes since 1.50: +12 -8 lines
Diff to previous 1.50 (colored)

Parent process shouldn't be base64-decoding untrusted strings, move
this code to privsep smtp process; ok gilles@

Revision 1.50 / (download) - annotate - [select for diffs], Sun May 24 14:38:56 2009 UTC (15 years ago) by jacekm
Branch: MAIN
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

Parent process forks 3 types of processes, track them all in a single tree
using newly introduced child struct.

Manage process titles centrally in struct smtpd.

ok gilles@

Revision 1.49 / (download) - annotate - [select for diffs], Sun May 24 14:22:23 2009 UTC (15 years ago) by jacekm
Branch: MAIN
Changes since 1.48: +8 -18 lines
Diff to previous 1.48 (colored)

Instead of keeping stats private to each process, and querying every
process individually whenever stats need to be fetched, keep stats
in MAP_ANON shared memory allocated by parent.

This means control has direct access to stats and can respond very
quickly without troubling any other daemon processes.

ok gilles@

Revision 1.48 / (download) - annotate - [select for diffs], Wed May 20 14:29:44 2009 UTC (15 years ago) by gilles
Branch: MAIN
Changes since 1.47: +19 -2 lines
Diff to previous 1.47 (colored)

first step towards configuration reload in smtpd, smtpctl reload will parse
the configuration file again and replace current configuration with new one
in all processes. what we don't support yet is graceful restart, clients in
sessions at the moment of the reload will have a temp failure thrown at 'em
which is ok RFC-wise but which we will try to improve anyway.

tested with various setups, "diff reads good" jacekm@

Revision 1.47 / (download) - annotate - [select for diffs], Tue May 19 11:24:24 2009 UTC (15 years ago) by jacekm
Branch: MAIN
Changes since 1.46: +16 -1 lines
Diff to previous 1.46 (colored)

Verify the amount of IMSG payload is exactly as expected; ok gilles@

Revision 1.46 / (download) - annotate - [select for diffs], Mon May 18 20:23:35 2009 UTC (15 years ago) by jacekm
Branch: MAIN
Changes since 1.45: +10 -14 lines
Diff to previous 1.45 (colored)

Complete rework of bufferevent event masking allowing for  more
strictness:
- Drop clients attempting command pipelining; protects the daemon
from all kinds of abuse.
- Replace F_EVLOCKED flag with F_WRITEONLY which has cleaner sematics:
when up, session must not be destroyed nor read from, but may be
written to.
- Write callback becomes a central place for enabling EV_READ.
- Delay bufferevent creation until after ssl handshake is completed.

A bunch of session error stats were added to smtpctl's "show stats".
These could help spotting event masking errors in the future.

ok gilles@

Revision 1.45 / (download) - annotate - [select for diffs], Thu May 14 15:05:12 2009 UTC (15 years ago) by eric
Branch: MAIN
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored)

use the nitems() macro where appropriate

ok gilles@, jacekm@

Revision 1.44 / (download) - annotate - [select for diffs], Sun May 10 11:29:40 2009 UTC (15 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.43: +2 -1 lines
Diff to previous 1.43 (colored)

assert copyright; ok gilles@

Revision 1.43 / (download) - annotate - [select for diffs], Sat May 9 18:59:09 2009 UTC (15 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored)

fix function names in log_debug

Revision 1.42 / (download) - annotate - [select for diffs], Sat May 9 17:04:55 2009 UTC (15 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.41: +10 -10 lines
Diff to previous 1.41 (colored)

- New API to handle all DNS query types (A, MX, PTR) asynchronously.

- Improve RFC compliance: CNAMEs are resolved, equal preference MXs
are randomized, relaying via MX that has equal/lower preference
than local server is prevented, decision on when to treat domain
name as implicit MX is better.

ok gilles@

Revision 1.41 / (download) - annotate - [select for diffs], Tue Apr 28 22:38:22 2009 UTC (15 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.40: +1 -4 lines
Diff to previous 1.40 (colored)

fix a bug where client with unresolvable revdns is never greeted; ok gilles@

Revision 1.40 / (download) - annotate - [select for diffs], Tue Apr 28 21:55:16 2009 UTC (15 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.39: +7 -10 lines
Diff to previous 1.39 (colored)

make S_DATAREQUEST state similar to S_{MAIL,RCPT}REQUEST; ok gilles@

Revision 1.39 / (download) - annotate - [select for diffs], Mon Apr 27 16:22:17 2009 UTC (15 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.38: +4 -2 lines
Diff to previous 1.38 (colored)

fix unlikely fd leak; ok gilles@

Revision 1.38 / (download) - annotate - [select for diffs], Fri Apr 24 09:38:11 2009 UTC (15 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.37: +53 -82 lines
Diff to previous 1.37 (colored)

Enclose common imsg handling code in a function, which additionally
does some sanity checking. Fix a bug that could lead to fatal under
rare circumstances, exposed by this newly added check; ok gilles@

Revision 1.37 / (download) - annotate - [select for diffs], Fri Apr 24 08:35:48 2009 UTC (15 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.36: +1 -2 lines
Diff to previous 1.36 (colored)

use same timeout at each session state, and make use of
bufferevent_settimeout instead of rolling our own; ok gilles@

Revision 1.36 / (download) - annotate - [select for diffs], Tue Apr 21 14:37:32 2009 UTC (15 years, 1 month ago) by eric
Branch: MAIN
Changes since 1.35: +6 -6 lines
Diff to previous 1.35 (colored)

correct some fatal(x) calls and error strings

ok gilles@ jacekm@

Revision 1.35 / (download) - annotate - [select for diffs], Mon Apr 20 17:07:01 2009 UTC (15 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.34: +1 -9 lines
Diff to previous 1.34 (colored)

Rewrite smtp session timeouts; use evtimer_* from event(3) instead
of regularly walking session tree in search of idle clients. Gives
the smtp process a chance to become idle.

As a bonus, add smtp.sessions.timeout counter to "smtpctl show stats".

ok gilles@

Revision 1.34 / (download) - annotate - [select for diffs], Thu Apr 16 15:35:06 2009 UTC (15 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.33: +58 -1 lines
Diff to previous 1.33 (colored)

Total rewrite of the sendmail interface. Adds support for -t, -v,
and -F cmdline args. Also, date and Message-Id headers are added
when missing.

The main trouble with the current enqueue code is that it requires
dealing with problems in the control process that are already solved
in the smtp process, ie. duplicating a lot of code which interacts
with untrusted clients. This diff solves this by making sendmail
obtain a SMTP socket from smtp via smtpd.sock, and using that socket
to deliver the message. For smtpd it looks as if connection was
made from the network, only difference being the F_MESSAGE_ENQUEUED
message flag, handy when differentation between local and remote
deliveries is wanted.

Most of the features come from the femail program, created by henning@.

Additional testing by Nigel J. Taylor.

ok gilles@, henning@ happy with smtpd using femail code

Revision 1.33 / (download) - annotate - [select for diffs], Thu Apr 9 19:49:34 2009 UTC (15 years, 2 months ago) by jacekm
Branch: MAIN
Changes since 1.32: +4 -6 lines
Diff to previous 1.32 (colored)

change syntax of the "listen on" and "relay via" directives:
1) kill the ssmtp keyword in "ssmtp listen on ...";
2) kill the use keyword in "... use certificate foo";
3) tls no longer implicit, user must explicitely use the tls or smtps option.
4) for "relay via", move the tls/smtps options to right after the
port specification; makes it similar to "listen on".

These directives:

  ssmtp listen on fxp0 use ceritifate "foo"
  accept for all relay via tls "mx.bar.com"

now become:

  listen on fxp0 smtps certificate "foo"
  accept for all relay via "mx.bar.com" tls

ok gilles@

Revision 1.32 / (download) - annotate - [select for diffs], Sun Mar 29 14:18:20 2009 UTC (15 years, 2 months ago) by jacekm
Branch: MAIN
Changes since 1.31: +11 -11 lines
Diff to previous 1.31 (colored)

turn some log_debugs into log_warns or even fatals; "looks ok" gilles@

Revision 1.31 / (download) - annotate - [select for diffs], Sun Mar 15 19:32:10 2009 UTC (15 years, 2 months ago) by gilles
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

since we are going to share code in smtp sessions and mta sessions, we need
to also share the statistics structure, still being worked on

Revision 1.30 / (download) - annotate - [select for diffs], Sun Mar 15 18:12:15 2009 UTC (15 years, 2 months ago) by gilles
Branch: MAIN
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored)

save 4 bytes per message by moving the datafp field of struct message to
struct session where it really belongs.

Revision 1.29 / (download) - annotate - [select for diffs], Mon Feb 23 00:51:32 2009 UTC (15 years, 3 months ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.28: +2 -1 lines
Diff to previous 1.28 (colored)

add missing headers needed by time()

ok jacekm@ gilles@

Revision 1.28 / (download) - annotate - [select for diffs], Sun Feb 22 19:07:33 2009 UTC (15 years, 3 months ago) by chl
Branch: MAIN
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored)

add missing headers

ok gilles@

Revision 1.27 / (download) - annotate - [select for diffs], Sun Feb 22 11:44:29 2009 UTC (15 years, 3 months ago) by form
Branch: MAIN
Changes since 1.26: +7 -5 lines
Diff to previous 1.26 (colored)

replace MAX* constants by sizeof where possible

ok jacekm@

Revision 1.26 / (download) - annotate - [select for diffs], Wed Feb 18 00:29:52 2009 UTC (15 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.25: +1 -2 lines
Diff to previous 1.25 (colored)

previous commit was incomplete, this fixes ssmtp

Revision 1.25 / (download) - annotate - [select for diffs], Wed Feb 18 00:17:39 2009 UTC (15 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.24: +16 -14 lines
Diff to previous 1.24 (colored)

smtp_accept() now requests from lka that it performs the hostname lookup
and inserts the session into the session tree. session_init() is called
only when we receive the resolution answer.

this fixes a race condition that would sometimes cause the hostname to
appear as "<unknown>" in headers just because dns was lagging, and it
unbreaks ssmtp support which suffered from th very same race condition.

Revision 1.24 / (download) - annotate - [select for diffs], Tue Feb 17 21:53:55 2009 UTC (15 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.23: +5 -6 lines
Diff to previous 1.23 (colored)

after a message has been commited to queue, do not incondtionnally clear
the message id and uid immediately. only do it if session has been flagged
with F_QUIT, otherwise session_pickup() will do it when in state S_DONE.

this fixes a bug reported by pea@ where the message id was not displayed
in the "message accepted for delivery" line.

Revision 1.23 / (download) - annotate - [select for diffs], Sun Feb 15 10:32:23 2009 UTC (15 years, 3 months ago) by jacekm
Branch: MAIN
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (colored)

New config.c that allows for process cloning. Done by pyr@ for
relayd at n2k9, and adapted to smtpd; ok gilles@

Revision 1.22 / (download) - annotate - [select for diffs], Fri Jan 30 21:40:21 2009 UTC (15 years, 4 months ago) by gilles
Branch: MAIN
Changes since 1.21: +3 -2 lines
Diff to previous 1.21 (colored)

improve statistics for smtp process. not only collect the current sessions
count, but also the total sessions count, ssmtp sessions (both current and
total) and starttls sessions (both current and total)

# ./smtpctl/smtpctl show stats|grep smtp.sessions
smtp.sessions = 0
smtp.sessions.active = 0
smtp.sessions.ssmtp = 0
smtp.sessions.ssmtp.active = 0
smtp.sessions.starttls = 0
smtp.sessions.starttls.active = 0
#

Revision 1.21 / (download) - annotate - [select for diffs], Fri Jan 30 21:22:33 2009 UTC (15 years, 4 months ago) by gilles
Branch: MAIN
Changes since 1.20: +10 -4 lines
Diff to previous 1.20 (colored)

clear the F_EVLOCK flag earlier to prevent the error event handler from
being called again with F_EVLOCK set. this fixes a bug where disconnect
after smtpd sends greeting and before entering any command failed to go
into session_destroy().

while at it, rename the "smtp.clients" statistic to "smtp.sessions" and
add counters to struct s_smtp so that I can add ssmtp and starttls with
my next commit ;)

Revision 1.20 / (download) - annotate - [select for diffs], Fri Jan 30 17:34:58 2009 UTC (15 years, 4 months ago) by gilles
Branch: MAIN
Changes since 1.19: +10 -2 lines
Diff to previous 1.19 (colored)

bump descriptors limit to the max and set the maximum connections count to
three quarters of that limit (a session typically has 3 descriptors). when
we hit that limit, we stop accepting connections, and when client closes a
session, we start accepting connections again. this prevents us from going
into a session that is likely to fail because of scarce resources.

idea discussed with jacekm@, code mostly ripped from relayd

Revision 1.19 / (download) - annotate - [select for diffs], Fri Jan 30 16:37:52 2009 UTC (15 years, 4 months ago) by gilles
Branch: MAIN
Changes since 1.18: +47 -18 lines
Diff to previous 1.18 (colored)

fix a very annoying events masking issue which would cause a fatal() to be
hit under certain conditions; while tracking the bug I ran into other bugs
which were kind of related and could cause us to hit a fatal() too.

fix by me, but with lots of testing and investigation with jacekm@,
ok jacekm@

Revision 1.18 / (download) - annotate - [select for diffs], Thu Jan 29 21:59:15 2009 UTC (15 years, 4 months ago) by jacekm
Branch: MAIN
Changes since 1.17: +11 -1 lines
Diff to previous 1.17 (colored)

Implement "smtpctl show stats"; ok gilles@

Revision 1.17 / (download) - annotate - [select for diffs], Wed Jan 28 19:38:46 2009 UTC (15 years, 4 months ago) by gilles
Branch: MAIN
Changes since 1.16: +4 -11 lines
Diff to previous 1.16 (colored)

when pausing listeners, do not simply disable their events as new
clients would still be able to connect. instead, at pause time we
close and remove the listeners, and at resume time we request the
parent to reconfigure all listeners.

discussed with pyr@

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jan 4 22:35:09 2009 UTC (15 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.15: +83 -3 lines
Diff to previous 1.15 (colored)

- smtp can now pause/resume the accepting of incoming messages
- smtpctl recognizes "pause incoming" and "resume incoming"
- setup imsg communication between control process and smtp process

Revision 1.15 / (download) - annotate - [select for diffs], Sun Jan 4 00:58:59 2009 UTC (15 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.14: +21 -2 lines
Diff to previous 1.14 (colored)

aliases/forwards expansion was not done correctly and a race could
cause delivery to happen before expansion is over, causing some of
the recipients to never receive the mail. change how the mfa, lka,
queue and smtp processes communicate to ensure smtp never receives
an acknowledgment before ALL expanded envelopes are on disk. While
at it, lka was doing work which belongs in mfa, fix that also.

this is based on an idea from a talk with jacekm@, change not over
but already better than what we had.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Jan 1 16:15:47 2009 UTC (15 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.13: +1 -4 lines
Diff to previous 1.13 (colored)

remove unnecessary includes; ok gilles@

Revision 1.13 / (download) - annotate - [select for diffs], Fri Dec 26 10:28:31 2008 UTC (15 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

parse.y doesn't allow listen backlog configuration, so "bzero default" is used.
Hardcode it instead: 5 is a popular choice across the tree; ok gilles@

Revision 1.12 / (download) - annotate - [select for diffs], Mon Dec 22 13:18:58 2008 UTC (15 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.11: +5 -3 lines
Diff to previous 1.11 (colored)

s->s_msg.session_hostname must hold resolved hostname as well; ok gilles@

Revision 1.11 / (download) - annotate - [select for diffs], Sun Dec 21 18:51:08 2008 UTC (15 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.10: +3 -2 lines
Diff to previous 1.10 (colored)

- missing prototype + smtp.c was misusing session_auth_pickup()
- unlike starttls, ssmtp sets the F_SECURE flag on session before helo/ehlo
	handlers are called. this means that if we clear all flags in helo/
	helo handlers, we prevent smtpd from advertising AUTH as it will do
	so only for F_SECURE sessions. This commits unbreaks SMTP AUTH with
	smtp sessions. Problem spotted by James Turner <james@bsdgroup.org>

Revision 1.10 / (download) - annotate - [select for diffs], Sun Dec 21 02:18:46 2008 UTC (15 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

- AUTH PLAIN may receive credentials as a parameter to AUTH or on a
	following line, this commit brings support for the latter which was
	not supported yet.
- AUTH LOGIN is now supported, allowing smtp auth support on clients that
	do not support AUTH PLAIN (ie: my mobile phone for instance ;)

Revision 1.9 / (download) - annotate - [select for diffs], Sat Dec 13 23:19:34 2008 UTC (15 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.8: +8 -7 lines
Diff to previous 1.8 (colored)

IMSG_* namespace cleanup.

ok gilles@

Revision 1.8 / (download) - annotate - [select for diffs], Wed Dec 3 17:58:00 2008 UTC (15 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.7: +21 -3 lines
Diff to previous 1.7 (colored)

- fix event masking issues in smtp process which could lead to a fatal() if
	queue process did not answer fast enough to an imsg. spotted by
	Jacek Masiulaniec <jacekm@dobremiasto.net>
- queue layout was mostly to bootstrap the project, it does not behave good
	under load, it does complex things to stay in a recoverable state
	and it probably didnt do it too well. New queue code is simpler,
	smaller and allows for atomic submissions (a mail can never be in a
	state where it needs to be recovered). It still needs some work but
	works better than previous code, no regression.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Nov 24 22:30:19 2008 UTC (15 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.6: +2 -3 lines
Diff to previous 1.6 (colored)

- not really a bug since we don't use other descriptor flags, but in
	smtp_setup_events() and mta_connect(), our fcntl() use clears
	flags. use session_socket_blockmode() instead, it makes more
	sense anyway. From Jacek Masiulaniec <jacekm@dobremiasto.net>

Revision 1.6 / (download) - annotate - [select for diffs], Mon Nov 17 21:56:18 2008 UTC (15 years, 6 months ago) by chl
Branch: MAIN
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (colored)

add missing header needed by time(), ctime_r() and tzset().

ok gilles@

Revision 1.5 / (download) - annotate - [select for diffs], Thu Nov 13 23:24:19 2008 UTC (15 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored)

- rephrase the "cannot load cert" warning that is output at startup when a
	listen directive has no matching certificate. it sounds like a
	critical failure when it just means "no tls support".
- minor log_debug() addition in smtp.c

Revision 1.4 / (download) - annotate - [select for diffs], Tue Nov 11 02:14:58 2008 UTC (15 years, 7 months ago) by tedu
Branch: MAIN
Changes since 1.3: +5 -10 lines
Diff to previous 1.3 (colored)

some small improvements.  ok gilles

Revision 1.3 / (download) - annotate - [select for diffs], Tue Nov 11 01:08:08 2008 UTC (15 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.2: +1 -4 lines
Diff to previous 1.2 (colored)

- queue process no longer schedules messages which do not have flag
	F_MESSAGE_COMPLETE
- submit recipients to the queue as we read them from RCPT instead of
	submiting them all at once when DATA is over. this prevents us
	from having to keep a potentially large number of recipients in
	memory during the whole session.
- remove all code that dealt with the recipients queue of a message as
	it is no longer used.
- several small changes to make sure the server is always in a recoverable
	state in case of an unexpected shutdown.

Revision 1.2 / (download) - annotate - [select for diffs], Wed Nov 5 12:14:45 2008 UTC (15 years, 7 months ago) by sobrado
Branch: MAIN
Changes since 1.1: +2 -0 lines
Diff to previous 1.1 (colored)

add a few missing id tags; there are a bunch of files, and developers
will probably miss this change when working on more important matters,
so it is probably better to sort them now.  there is a risk of losing
the tags if a change needs to be reverted too.

written with excellent advice from jmc@

ok gilles@

Revision 1.1 / (download) - annotate - [select for diffs], Sat Nov 1 21:35:28 2008 UTC (15 years, 7 months ago) by gilles
Branch: MAIN

smtpd is a smtp server implementation for OpenBSD. It is a work in progress
which still lacks many features. bringing it in tree will help working on it
more easily.

"at this stage it should go in" henning@, "move ahead" deraadt@

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.