OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.69 / (download) - annotate - [select for diffs], Wed May 31 16:51:46 2023 UTC (12 months 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.68: +2 -1 lines
Diff to previous 1.68 (colored)

add missing include of time.h

spotted after a report on OpenSMTPD-portable.  While here include
sys/time.h in smtpd.h, as noted in event_init(3), since it includes
event.h.

ok millert@

Revision 1.68 / (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_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.67: +1 -13 lines
Diff to previous 1.67 (colored)

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

ok jung@

Revision 1.67 / (download) - annotate - [select for diffs], Wed May 26 18:08:55 2021 UTC (3 years ago) by eric
Branch: MAIN
Changes since 1.66: +7 -8 lines
Diff to previous 1.66 (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.66 / (download) - annotate - [select for diffs], Wed Apr 22 11:35:34 2020 UTC (4 years, 1 month ago) by eric
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
Changes since 1.65: +4 -1 lines
Diff to previous 1.65 (colored)

Check for the dispatcher name in the envelope validation function.
Fixes a possible crash and caching issue when manually moving an
envelope to the queue with smtpctl discover.

ok millert@

Revision 1.65 / (download) - annotate - [select for diffs], Sun Dec 30 23:09:58 2018 UTC (5 years, 5 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.64: +1 -2 lines
Diff to previous 1.64 (colored)

Delete unnecessary <libgen.h> #includes

ok deraadt@

Revision 1.64 / (download) - annotate - [select for diffs], Thu May 31 21:06:12 2018 UTC (6 years ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

remove 'where' parameter from all x*() functions in utils.c, it doesn't
really help us with anything, propagate the change in codebase

ok millert@

Revision 1.63 / (download) - annotate - [select for diffs], Mon May 14 15:23:05 2018 UTC (6 years ago) by gilles
Branch: MAIN
Changes since 1.62: +7 -48 lines
Diff to previous 1.62 (colored)

kill corrupt / uncorrupt queue mechanism as it has never been usable and it
will be made irrelevant when the new config comes up soon

ok eric@

Revision 1.62 / (download) - annotate - [select for diffs], Thu Feb 4 12:46:28 2016 UTC (8 years, 3 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.61: +14 -1 lines
Diff to previous 1.61 (colored)

When deleting a message, remove associated envelopes from the cache,
if any (it happens when a message transaction is cancelled).

ok gilles@ sunil@

Revision 1.61 / (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.60: +5 -5 lines
Diff to previous 1.60 (colored)

remove spaces after '!'

no binary change

ok millert

Revision 1.60 / (download) - annotate - [select for diffs], Mon Dec 14 10:22:12 2015 UTC (8 years, 5 months ago) by jung
Branch: MAIN
Changes since 1.59: +3 -3 lines
Diff to previous 1.59 (colored)

remove trailing whitespace

ok sunil gilles

Revision 1.59 / (download) - annotate - [select for diffs], Thu Nov 5 09:14:31 2015 UTC (8 years, 6 months ago) by sunil
Branch: MAIN
Changes since 1.58: +14 -1 lines
Diff to previous 1.58 (colored)

Implement smtpctl uncorrupt <msgid>

"uncorrupt" moves envelopes from corrupt bucket back to the queue
for further discovery by the daemon.

After correcting the corrupt envelopes, admin could now...

# smtpctl uncorrupt msgid
# smtpctl discover msgid

to schedule the messages.

Ok gilles@

Revision 1.58 / (download) - annotate - [select for diffs], Thu Nov 5 08:59:23 2015 UTC (8 years, 6 months ago) by sunil
Branch: MAIN
Changes since 1.57: +2 -2 lines
Diff to previous 1.57 (colored)

Do not terminate message walk on a corrupt envelope.

Ok gilles@

Revision 1.57 / (download) - annotate - [select for diffs], Thu Oct 29 10:25:36 2015 UTC (8 years, 7 months ago) by sunil
Branch: MAIN
Changes since 1.56: +50 -1 lines
Diff to previous 1.56 (colored)

Implement smtpctl discover <evpid|msgid>.

discover subcommand schedules envelopes manually moved to the queue.
It triggers a queue walk searching for envelopes with the given id,
schedules them and informs the user number of envelopes scheduled.
Admins no longer would need to restart the daemon to discover
manually moved messages.

Ok gilles@

Revision 1.56 / (download) - annotate - [select for diffs], Fri Oct 9 14:37:38 2015 UTC (8 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.55: +8 -2 lines
Diff to previous 1.55 (colored)

turn our local enqueuer setgid _smtpq and restrict access to offline queue,
the enqueuer will revoke group and regain real gid right after mkstemp.

this would have prevented the symlink/hardlink attacks against offline, and
it will avoid having to deal with new ways users can mess with it.

ok eric@, ok millert@

Revision 1.55 / (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.54: +2 -2 lines
Diff to previous 1.54 (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.54 / (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.53: +5 -4 lines
Diff to previous 1.53 (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.53 / (download) - annotate - [select for diffs], Mon Dec 8 08:19:36 2014 UTC (9 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.52: +3 -3 lines
Diff to previous 1.52 (colored)

no need for arc4random_uniform() here, arc4random() does the job

spotted by deraadt@, ok eric@

Revision 1.52 / (download) - annotate - [select for diffs], Tue Jul 8 15:45:32 2014 UTC (9 years, 10 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.51: +23 -12 lines
Diff to previous 1.51 (colored)

various queue improvements:

- add a "close" hook to the backend API.
- improve the sync() pattern in queue_fs: only sync at commit
  time and not for every envelope creation
- various fixes to the experimental external queue API.

Revision 1.51 / (download) - annotate - [select for diffs], Mon Jul 7 09:11:24 2014 UTC (9 years, 10 months ago) by eric
Branch: MAIN
Changes since 1.50: +3 -4 lines
Diff to previous 1.50 (colored)

Allow to enable profiling at runtime and fix timings output.

ok gilles@

Revision 1.50 / (download) - annotate - [select for diffs], Fri Apr 11 02:58:08 2014 UTC (10 years, 1 month ago) by jsg
Branch: MAIN
Changes since 1.49: +5 -1 lines
Diff to previous 1.49 (colored)

fix a use after free in an error path
ok gilles@

Revision 1.49 / (download) - annotate - [select for diffs], Fri Mar 14 05:27:00 2014 UTC (10 years, 2 months ago) by halex
Branch: MAIN
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored)

print the correct user name if SMTPD_QUEUE_USER is missing

ok tedu@

Revision 1.48 / (download) - annotate - [select for diffs], Thu Mar 13 20:39:27 2014 UTC (10 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.47: +1 -3 lines
Diff to previous 1.47 (colored)

When failing to find the required privsep user entry, it is not cool at
all to fall back to a different user entry.  It is decidedly unsafe.
ok tedu.

Revision 1.47 / (download) - annotate - [select for diffs], Sat Oct 26 12:27:59 2013 UTC (10 years, 7 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.46: +12 -12 lines
Diff to previous 1.46 (colored)

%i -> %d in format strings

Revision 1.46 / (download) - annotate - [select for diffs], Fri Jul 19 20:37:07 2013 UTC (10 years, 10 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.45: +248 -30 lines
Diff to previous 1.45 (colored)

Assorted queue improvements:
- cleanup the internal queue backend API and get rid of the QOP_* thing.
- implement a queue_proc backend
- rename queue_fsqueue.c to queue_fs
- enable support for queue encryption
- add an envelope cache
- better logging and error reporting

Revision 1.45 / (download) - annotate - [select for diffs], Fri Jul 19 11:14:08 2013 UTC (10 years, 10 months ago) by eric
Branch: MAIN
Changes since 1.44: +25 -3 lines
Diff to previous 1.44 (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.44 / (download) - annotate - [select for diffs], Fri May 24 17:03:14 2013 UTC (11 years ago) by eric
Branch: MAIN
Changes since 1.43: +116 -21 lines
Diff to previous 1.43 (colored)

sync with OpenSMTPD 5.3.2

ok gilles@

Revision 1.43 / (download) - annotate - [select for diffs], Wed Apr 17 15:02:38 2013 UTC (11 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored)

large time_t problems
ok gilles

Revision 1.42 / (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.41: +110 -79 lines
Diff to previous 1.41 (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.41 / (download) - annotate - [select for diffs], Fri Nov 23 09:25:44 2012 UTC (11 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.40: +31 -23 lines
Diff to previous 1.40 (colored)

Replace the qwalk API (to retreive on disk envelopes at runtime) with
a simple QOP_WALK queue operation. Some knf and formating fixes while
there.

ok gilles@

Revision 1.40 / (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.39: +2 -2 lines
Diff to previous 1.39 (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.39 / (download) - annotate - [select for diffs], Tue Oct 9 13:39:00 2012 UTC (11 years, 7 months ago) by eric
Branch: MAIN
Changes since 1.38: +17 -11 lines
Diff to previous 1.38 (colored)

fix a FILE* leak when using compression.

ok gilles@

Revision 1.38 / (download) - annotate - [select for diffs], Sat Sep 1 16:09:14 2012 UTC (11 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.37: +2 -55 lines
Diff to previous 1.37 (colored)

- remove crypto_backend
- remove support for encrypted queue, it will be reintroduced later after
  pouring more thinking into it

if you had it enabled, flush your queue before updating

Revision 1.37 / (download) - annotate - [select for diffs], Thu Aug 30 19:33:25 2012 UTC (11 years, 9 months ago) by chl
Branch: MAIN
Changes since 1.36: +19 -15 lines
Diff to previous 1.36 (colored)

switch compress_backend to use FILE * instead of file descriptors, like
crypto_backend

ok gilles@

Revision 1.36 / (download) - annotate - [select for diffs], Thu Aug 30 19:28:40 2012 UTC (11 years, 9 months ago) by chl
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

fix uninitialized variable which can be reach in case of failure.

ok gilles@

Revision 1.35 / (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.34: +38 -24 lines
Diff to previous 1.34 (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.34 / (download) - annotate - [select for diffs], Sun Aug 26 11:21:28 2012 UTC (11 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

- remove unused variable
- comment variables unused at this time

Revision 1.33 / (download) - annotate - [select for diffs], Sat Aug 25 23:35:09 2012 UTC (11 years, 9 months ago) by chl
Branch: MAIN
Changes since 1.32: +140 -5 lines
Diff to previous 1.32 (colored)

Add compress_backend, allowing compression of messages and envelopes in the queue.
To use it, just add "queue compress" in smtpd.conf. For now, only zlib is used.

lots of feedback from eric@ and gilles@

ok eric@ gilles@

Revision 1.32 / (download) - annotate - [select for diffs], Fri Aug 24 19:51:48 2012 UTC (11 years, 9 months ago) by eric
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

envelope_validate() don't take the evpid anymore.

Revision 1.31 / (download) - annotate - [select for diffs], Fri Aug 24 13:21:56 2012 UTC (11 years, 9 months ago) by chl
Branch: MAIN
Changes since 1.30: +3 -6 lines
Diff to previous 1.30 (colored)

In envelope ascii dump/load:
- remove loading of evpid.
- don't dump the msgid
- ignore msgid at load
- remove now unused functions ascii_{dump,load}_uint{32,64}_hex()

With inputs from eric@ and gilles@

ok gilles@ eric@

Revision 1.30 / (download) - annotate - [select for diffs], Fri Aug 24 13:13:13 2012 UTC (11 years, 9 months ago) by chl
Branch: MAIN
Changes since 1.29: +38 -6 lines
Diff to previous 1.29 (colored)

Don't pass struct envelope pointer in queue backend API, instead use envelope id and
an envelope ascii buffer.

ok eric@ gilles@

Revision 1.29 / (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.28: +19 -19 lines
Diff to previous 1.28 (colored)

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

ok eric@

Revision 1.28 / (download) - annotate - [select for diffs], Tue Jul 10 23:21:34 2012 UTC (11 years, 10 months ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.27: +3 -2 lines
Diff to previous 1.27 (colored)

backout the:
- remove the /envelopes subdirectory, envelopes are at the same level than
  the message file
- kill PATH_ENVELOPES define

but keep the:
- reduce the number of buckets from 0xfff to 0xff, this avoid performances
  of the queue to decrease when we start having tons of buckets

ok eric@ gilles@

Revision 1.27 / (download) - annotate - [select for diffs], Mon Jul 9 08:08:29 2012 UTC (11 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.26: +2 -3 lines
Diff to previous 1.26 (colored)

first step of simplifying fsqueue:

- remove the /envelopes subdirectory, envelopes are at the same level than
  the message file
- kill PATH_ENVELOPES define
- reduce the number of buckets from 0xfff to 0xff, this avoid performances
  of the queue to decrease when we start having tons of buckets

this diff introduces a change to the queue layout, you will want to empty
your queue before updating. more cleanup to come

ok eric@, ok chl@

Revision 1.26 / (download) - annotate - [select for diffs], Sun Jul 8 18:13:08 2012 UTC (11 years, 10 months ago) by chl
Branch: MAIN
Changes since 1.25: +39 -2 lines
Diff to previous 1.25 (colored)

remove enum queue_kind from queue_fsqueue.c.
incoming messages are now always stored in /incoming, whatever the queue_backend is.
remove QOP_FD_RW and fsqueue_message_fd_rw().
while there check return value of generated paths before calling rmtree()

with advice from gilles@ and eric@

ok gilles@ eric@

Revision 1.25 / (download) - annotate - [select for diffs], Mon Jul 2 17:00:05 2012 UTC (11 years, 11 months ago) by eric
Branch: MAIN
Changes since 1.24: +3 -9 lines
Diff to previous 1.24 (colored)

Lookup queue and scheduler backends by name, rather than enum.
Add a command-line option to specify the backend to use at runtime.

ok gilles@

Revision 1.24 / (download) - annotate - [select for diffs], Wed Jun 20 20:45:23 2012 UTC (11 years, 11 months ago) by eric
Branch: MAIN
Changes since 1.23: +23 -23 lines
Diff to previous 1.23 (colored)

Finally get rid of the queue_kind enum in the queue API. Keep that
internally in fsqueue backend for now, and let the fsqueue_message()
and fsqueue_envelope() dispatchers do the right thing.

Based on a diff by chl@

ok chl@ gilles@

Revision 1.23 / (download) - annotate - [select for diffs], Fri Jun 8 11:34:23 2012 UTC (11 years, 11 months ago) by chl
Branch: MAIN
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (colored)

add missing header needed by time()

ok eric@ gilles@

Revision 1.22 / (download) - annotate - [select for diffs], Sun Jun 3 19:52:56 2012 UTC (12 years ago) by eric
Branch: MAIN
Changes since 1.21: +8 -9 lines
Diff to previous 1.21 (colored)

Do not store the envelope id within the envelope, only the message id.
Make sure existing envelopes can be properly loaded.

ok chl@ gilles@

Revision 1.21 / (download) - annotate - [select for diffs], Fri Jun 1 11:42:34 2012 UTC (12 years ago) by eric
Branch: MAIN
Changes since 1.20: +10 -2 lines
Diff to previous 1.20 (colored)

on envelope creation, setup and reset the relevant envelope fields in
the wrapper function rather than in individual backends.

ok gilles@

Revision 1.20 / (download) - annotate - [select for diffs], Sat Jan 14 15:13:14 2012 UTC (12 years, 4 months ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.19: +2 -1 lines
Diff to previous 1.19 (colored)

Add missing header needed by PRI format string

ok gilles@ eric@

Revision 1.19 / (download) - annotate - [select for diffs], Fri Jan 13 21:58:35 2012 UTC (12 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.18: +1 -7 lines
Diff to previous 1.18 (colored)

queue_message_purge() and queue_message_delete() are actually the same
thing. Remove queue_message_purge() in favor of queue_message_delete
and simplify fsqueue_message_delete() implementation to move the
message dir to purge/

ok gilles@

Revision 1.18 / (download) - annotate - [select for diffs], Fri Dec 23 12:10:06 2011 UTC (12 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.17: +1 -2 lines
Diff to previous 1.17 (colored)

On envelope creation, get the message id in a saner way than the
current confusing hack.

ok gilles@

Revision 1.17 / (download) - annotate - [select for diffs], Mon Dec 19 19:57:25 2011 UTC (12 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.16: +26 -20 lines
Diff to previous 1.16 (colored)

fix/improve envelope_validate():
- return an informative error string if the envelope is invalid.
- take the envelope id as a parameter and make sure it matches.
- do not expect the errorline to start with an SMTP response code,
  as this is not always the case: a temporary failure with mda would
  cause the envelope to be marked as corrupted. Instead, just make sure
  that all string fields are actual strings to prevent overflows later.

ok gilles@ chl@

Revision 1.16 / (download) - annotate - [select for diffs], Fri Dec 16 17:35:00 2011 UTC (12 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.15: +5 -9 lines
Diff to previous 1.15 (colored)

simplify

ok chl@ gilles@

Revision 1.15 / (download) - annotate - [select for diffs], Wed Dec 14 17:55:55 2011 UTC (12 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.14: +9 -25 lines
Diff to previous 1.14 (colored)

make queue_fsqueue backend consistent with the backend scheme.

ok gilles@

Revision 1.14 / (download) - annotate - [select for diffs], Tue Nov 15 23:06:39 2011 UTC (12 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.13: +61 -2 lines
Diff to previous 1.13 (colored)

Qwalk, our API to linearly walk over the persistent queue, did not take the
queue_backend into account and assumed a filesystem with a specific layout.

This commit does plenty of things:

- make qwalk an abstraction in the queue_backend API, and impose queue
  drivers to implement qwalk_open(), qwalk() and qwalk_close();

- move previous qwalk_open(), qwalk() and qwalk_close() to the fsqueue
  driver since they were fsqueue specific ...

- make qwalk API work with msgid/evpid instead of pathnames since we're
  going to use the queue_backend API to load envelopes by evpid anyway;

- makes smtpd use *solely* the queue_backend API when manipulating the
  queue. pathnames were removed from smtpd.h and moved into the fsqueue
  which means we can now store a queue anywhere ... as long as we write
  the ten functions or so required for a queue driver ;-)

ok eric@, ok chl@

Revision 1.13 / (download) - annotate - [select for diffs], Sun Oct 23 13:03:04 2011 UTC (12 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.12: +7 -1 lines
Diff to previous 1.12 (colored)

introduce Q_CORRUPT and queue_backend operation to move a message from
schedule queue to corrupt queue upon envelope loading failure.

tested by me, ok eric@

Revision 1.12 / (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.11: +35 -4 lines
Diff to previous 1.11 (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.11 / (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.10: +10 -10 lines
Diff to previous 1.10 (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.10 / (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.9: +24 -30 lines
Diff to previous 1.9 (colored)

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

discussed with and ok gilles@

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

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

Revision 1.8 / (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.7: +15 -17 lines
Diff to previous 1.7 (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.7 / (download) - annotate - [select for diffs], Thu Apr 14 23:26:16 2011 UTC (13 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.6: +7 -1 lines
Diff to previous 1.6 (colored)

- implement missing operations for fsqueue:
	fsqueue_envelope_create(), fsqueue_message_purge()
- kill deprecated functions in queue_shared.c

At this point fsqueue backend is almost complete, all that is left to do is
to move the qwalk() API inside the queue_backend API, then make sure smtpd
is no longer calling anything queue related directly.

Revision 1.6 / (download) - annotate - [select for diffs], Thu Apr 14 20:11:08 2011 UTC (13 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.5: +9 -5 lines
Diff to previous 1.5 (colored)

fsqueue queue backend will implement a filesystem queue:
- fsqueue->setup() performs the queue initialization;
- fsqueue->message() controls messages;
- fsqueue->envelope() controls envelopes;

This commit brings the following to fsbackend:
fsqueue_setup(), fsqueue_message_delete(), fsqueue_envelope_load(),
fsqueue_envelope_update(), fsqueue_envelope_delete().

It also makes smtpd use the queue_backend API for these operations.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Apr 14 17:06:43 2011 UTC (13 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.4: +58 -265 lines
Diff to previous 1.4 (colored)

smtpd makes too many assumptions about the structure and layout of its
disk-based queue, it makes it near impossible to make changes to it without
editing twenty files... how am i going to implement mongodb support ? :-)

bring a new queue_backend API which hides the details of the disk-based
queue to smtpd. it is not "plugged in" yet and I'm filling the holes.

Revision 1.4, Sat Oct 9 22:07:56 2010 UTC (13 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.3: +1 -1 lines
FILE REMOVED

no longer compiled, i will reintroduce them later, lots of stuff needs to
be done before we can write queue backends anyway ...

Revision 1.3 / (download) - annotate - [select for diffs], Tue Jun 1 23:06:23 2010 UTC (14 years ago) by jacekm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.2: +0 -0 lines
Diff to previous 1.2 (colored)

new queue, again; gcc2 compile tested by deraadt

Revision 1.2, Tue Jun 1 19:47:09 2010 UTC (14 years ago) by jacekm
Branch: MAIN
Changes since 1.1: +1 -1 lines
FILE REMOVED

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

Revision 1.1 / (download) - annotate - [select for diffs], Mon May 31 23:38:56 2010 UTC (14 years ago) by jacekm
Branch: MAIN

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.

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.