OpenBSD CVS

CVS log for src/usr.sbin/smtpd/Attic/mfa.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.83, Tue May 20 08:09:04 2014 UTC (10 years ago) by eric
Branch: MAIN
CVS Tags: HEAD
Changes since 1.82: +1 -1 lines
FILE REMOVED

remove dead files

Revision 1.82 / (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.81: +21 -24 lines
Diff to previous 1.81 (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.81 / (download) - annotate - [select for diffs], Sun Oct 27 11:01:47 2013 UTC (10 years, 7 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.80: +137 -11 lines
Diff to previous 1.80 (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.80 / (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.79: +2 -1 lines
Diff to previous 1.79 (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.79 / (download) - annotate - [select for diffs], Fri Jul 19 16:02:00 2013 UTC (10 years, 10 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.78: +11 -9 lines
Diff to previous 1.78 (colored)

Move the filter infrastructure forward.

Revision 1.78 / (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.77: +3 -5 lines
Diff to previous 1.77 (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.77 / (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.76: +1 -2 lines
Diff to previous 1.76 (colored)

Remove useless sc_pid from struct smtpd.

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

sync with OpenSMTPD 5.3.2

ok gilles@

Revision 1.75 / (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.74: +122 -288 lines
Diff to previous 1.74 (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.74 / (download) - annotate - [select for diffs], Fri Nov 23 13:54:12 2012 UTC (11 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.73: +15 -12 lines
Diff to previous 1.73 (colored)

knf

Revision 1.73 / (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.72: +3 -3 lines
Diff to previous 1.72 (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.72 / (download) - annotate - [select for diffs], Thu Oct 25 14:06:08 2012 UTC (11 years, 7 months ago) by eric
Branch: MAIN
Changes since 1.71: +6 -2 lines
Diff to previous 1.71 (colored)

send the semantically correct msg when RCPT fails, even if the exact value
does not matter.

spotted by chl@

ok gilles@ chl@

Revision 1.71 / (download) - annotate - [select for diffs], Sat Sep 29 11:02:41 2012 UTC (11 years, 8 months ago) by eric
Branch: MAIN
Changes since 1.70: +1 -2 lines
Diff to previous 1.70 (colored)

some mfa_session cleanups.

- move mfa_session() prototype to smtpd.h
- make mfa session use a tree
- make static functions static
- merge mfa_session_init() into mfa_session()

ok chl@

Revision 1.70 / (download) - annotate - [select for diffs], Thu Sep 27 17:58:56 2012 UTC (11 years, 8 months ago) by chl
Branch: MAIN
Changes since 1.69: +4 -8 lines
Diff to previous 1.69 (colored)

simplify calloc() + strlcpy()/memcpy() dance with xmemdup()
use xcalloc() helper
remove newly unused variable

ok gilles@ eric@

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

Set envelope expirancy in lka before sending the envelope to mfa.
The goal is to eventually have only the lka see the rules.

ok gilles@ chl@

Revision 1.68 / (download) - annotate - [select for diffs], Sun Sep 16 16:43:28 2012 UTC (11 years, 8 months ago) by chl
Branch: MAIN
Changes since 1.67: +1 -3 lines
Diff to previous 1.67 (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.67 / (download) - annotate - [select for diffs], Wed Jan 18 13:41:54 2012 UTC (12 years, 4 months ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.66: +67 -3 lines
Diff to previous 1.66 (colored)

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

ok gilles@ eric@

Revision 1.66 / (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.65: +3 -2 lines
Diff to previous 1.65 (colored)

when receiving an unexpected imsg, print its name.

with help and ideas from eric@

ok eric@ gilles@

Revision 1.65 / (download) - annotate - [select for diffs], Thu Nov 10 17:37:08 2011 UTC (12 years, 6 months ago) by chl
Branch: MAIN
Changes since 1.64: +2 -2 lines
Diff to previous 1.64 (colored)

Use STDIN_FILENO instead of magic constant 0

ok gilles@

Revision 1.64 / (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.63: +8 -8 lines
Diff to previous 1.63 (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.63 / (download) - annotate - [select for diffs], Sun Oct 9 18:39:53 2011 UTC (12 years, 7 months ago) by eric
Branch: MAIN
Changes since 1.62: +3 -1 lines
Diff to previous 1.62 (colored)

show messages sent between processes in debug mode

ok gilles@ chl@

Revision 1.62 / (download) - annotate - [select for diffs], Tue Sep 27 18:53:24 2011 UTC (12 years, 8 months ago) by chl
Branch: MAIN
Changes since 1.61: +3 -2 lines
Diff to previous 1.61 (colored)

check closefrom() return value
use STDERR_FILENO instead of hard coded value

ok gilles@

Revision 1.61 / (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.60: +13 -1 lines
Diff to previous 1.60 (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.60 / (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.59: +121 -18 lines
Diff to previous 1.59 (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.59 / (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.58: +22 -25 lines
Diff to previous 1.58 (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.58 / (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.57: +18 -18 lines
Diff to previous 1.57 (colored)

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

discussed with and ok gilles@

Revision 1.57 / (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.56: +14 -14 lines
Diff to previous 1.56 (colored)

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

Revision 1.56 / (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.55: +5 -5 lines
Diff to previous 1.55 (colored)

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

Revision 1.55 / (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.54: +1 -4 lines
Diff to previous 1.54 (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.54 / (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.53: +1 -3 lines
Diff to previous 1.53 (colored)

remove all unused headers

Revision 1.53 / (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.52: +7 -35 lines
Diff to previous 1.52 (colored)

a bit of .h cleanups, no functionnal change

Revision 1.52 / (download) - annotate - [select for diffs], Fri Oct 29 09:16:07 2010 UTC (13 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.51: +1 -2 lines
Diff to previous 1.51 (colored)

smtpd no longer knows a map called "secrets" which holds credentials for
authenticated relaying. one can create many maps holding credentials and
name them however he/she wants, just like any other map.

teach smtpd how to select a credentials map at the rule-level allowing a
setup to relay through the same MX with different credentials depending
on the source.

smtpd.conf.5 updated to reflect changes with help from jmc@

Revision 1.51 / (download) - annotate - [select for diffs], Thu Oct 28 21:15:50 2010 UTC (13 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.50: +3 -1 lines
Diff to previous 1.50 (colored)

teach smtpd how to handle per-rule delays for message expiry, this allows
some rules to have a longer expiry delay than the default:

	accept for [...] relay expire 8d  # will stay 8 days in queue

I added the man page bits so I don't forget but I need to reword it a bit

Revision 1.50 / (download) - annotate - [select for diffs], Sat Oct 9 22:05:35 2010 UTC (13 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.49: +68 -28 lines
Diff to previous 1.49 (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.49 / (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.48: +3 -2 lines
Diff to previous 1.48 (colored)

check event_dispatch() return value

ok jacekm@

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

new queue, again; gcc2 compile tested by deraadt

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

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

Revision 1.46 / (download) - annotate - [select for diffs], Mon May 31 23:38:56 2010 UTC (14 years ago) by jacekm
Branch: MAIN
Changes since 1.45: +28 -68 lines
Diff to previous 1.45 (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.45 / (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.44: +1 -7 lines
Diff to previous 1.44 (colored)

Remove unusable ifdef DEBUG code.

Revision 1.44 / (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.43: +38 -232 lines
Diff to previous 1.43 (colored)

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

Revision 1.43 / (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.42: +10 -1 lines
Diff to previous 1.42 (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.42 / (download) - annotate - [select for diffs], Sun Oct 18 20:41:21 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.41: +2 -1 lines
Diff to previous 1.41 (colored)

fix a bug that was introduced by my changes in ruleset matching and which
caused an envelope to be saved with action A_INVALID when it matches
either A_RELAY or A_RELAYVIA.

reported by various people

Revision 1.41 / (download) - annotate - [select for diffs], Mon Oct 12 22:34:37 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.40: +2 -1 lines
Diff to previous 1.40 (colored)

- fix a null deref which could happen after a couple iterations of the
  aliases/virtual domains resolution code.

- fix a logic bug which caused virtual domains not to be correctly
  handled after one iteration of the aliases resolution code.

- introduce a few helper functions to help clean up and simplify the
  lka code.

- simplify the IS_EXT/IS_MAILBOX/IS_RELAY macros so they manipulate a
  struct path * instead of the mess of dereferences we were passing them.

Revision 1.40 / (download) - annotate - [select for diffs], Wed Oct 7 18:19:39 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.39: +1 -88 lines
Diff to previous 1.39 (colored)

now that mfa no longer does ruleset matching, parent no longer needs to
send it the ruleset configuration, and mfa no longer needs to interpret
it and load it in memory. kill kill kill. as an added bonus: removes 88
lines of code :-)

Revision 1.39 / (download) - annotate - [select for diffs], Wed Oct 7 18:09:12 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.38: +23 -12 lines
Diff to previous 1.38 (colored)

currently both mfa and lka perform ruleset matching for their own purposes.
make lka the only caller of ruleset_match(), mfa request match through imsg
which will shrink its code and help me implement virtual domains properly.

idea discussed with jacekm@

Revision 1.38 / (download) - annotate - [select for diffs], Wed Oct 7 17:30:41 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.37: +1 -7 lines
Diff to previous 1.37 (colored)

since the bounce code rewrite, we no longer need to perform ruleset match
and aliases resolution on the sender before envelope is written in queue:

- mfa_test_mail() no longer calls ruleset_match()
- lka_verify_mail() no longer resolves sender and set rule action
- lka_resolve_mail() becomes dead code so just kill it

ok jacekm@

Revision 1.37 / (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.36: +5 -5 lines
Diff to previous 1.36 (colored)

imsg_get sets errno so use fatal instead of fatalx.

Revision 1.36 / (download) - annotate - [select for diffs], Sat Jun 6 04:14:21 2009 UTC (15 years ago) by pyr
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.35: +27 -19 lines
Diff to previous 1.35 (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.35 / (download) - annotate - [select for diffs], Fri Jun 5 20:43:57 2009 UTC (15 years ago) by pyr
Branch: MAIN
Changes since 1.34: +7 -7 lines
Diff to previous 1.34 (colored)

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

Revision 1.34 / (download) - annotate - [select for diffs], Mon Jun 1 23:15:48 2009 UTC (15 years ago) by gilles
Branch: MAIN
Changes since 1.33: +5 -39 lines
Diff to previous 1.33 (colored)

yet another cleanup in mfa/lka, don't roll their own loops to release maps
and rules when config.c provides us with purge_config(), PURGE_MAPS and
PURGE_RULES. kills lots of lines with no functionnal change. ok jacekm@

Revision 1.33 / (download) - annotate - [select for diffs], Mon Jun 1 22:51:47 2009 UTC (15 years ago) by gilles
Branch: MAIN
Changes since 1.32: +16 -115 lines
Diff to previous 1.32 (colored)

add new file ruleset.c with code related to the ruleset matching, and kill
the two or three "almost" identical versions of ruleset matching loops from
lka and mfa by having one unified function in ruleset.c; ok jacekm@

while at it, bring maildir support back to life; trivial one-liner by me

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

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

Revision 1.31 / (download) - annotate - [select for diffs], Sun May 24 14:38:56 2009 UTC (15 years ago) by jacekm
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (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.30 / (download) - annotate - [select for diffs], Thu May 21 01:07:13 2009 UTC (15 years ago) by gilles
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

fix sockaddr_storage lenght check in mfa_check_source()

Revision 1.29 / (download) - annotate - [select for diffs], Wed May 20 16:07:26 2009 UTC (15 years ago) by gilles
Branch: MAIN
Changes since 1.28: +41 -2 lines
Diff to previous 1.28 (colored)

previous commit to add reload support was missing some code, this diffs
contains the missing parts + a memleak plug

Revision 1.28 / (download) - annotate - [select for diffs], Wed May 20 14:36:55 2009 UTC (15 years ago) by gilles
Branch: MAIN
Changes since 1.27: +5 -3 lines
Diff to previous 1.27 (colored)

replace a TAILQ_FOREACH loop with a TAILQ_FIRST loop when releasing entries
of the tailq, this is how it must be done.

Revision 1.27 / (download) - annotate - [select for diffs], Wed May 20 14:29:44 2009 UTC (15 years ago) by gilles
Branch: MAIN
Changes since 1.26: +82 -2 lines
Diff to previous 1.26 (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.26 / (download) - annotate - [select for diffs], Tue May 19 11:24:24 2009 UTC (15 years ago) by jacekm
Branch: MAIN
Changes since 1.25: +23 -9 lines
Diff to previous 1.25 (colored)

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

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

use the nitems() macro where appropriate

ok gilles@, jacekm@

Revision 1.24 / (download) - annotate - [select for diffs], Tue Apr 28 23:11:25 2009 UTC (15 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.23: +4 -3 lines
Diff to previous 1.23 (colored)

smtp auth happened to work by luck because delivery to mbox action was the
first action of an enum and we allocated a struct using calloc, but we did
not properly initialize the action for authenticated users.

while at it, change the name of path action flags so that we know at first
sight that they are path related.

this diff fixes the immediate issue but still needs work.
ok jacekm@, "we'll work out a long term solution"

Revision 1.23 / (download) - annotate - [select for diffs], Tue Apr 28 21:27:25 2009 UTC (15 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.22: +1 -20 lines
Diff to previous 1.22 (colored)

let mta, mda, and mfa become idle - no functional change; ok gilles@

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

check message_id received from smtp uses valid format.

Revision 1.21 / (download) - annotate - [select for diffs], Fri Apr 24 08:32:12 2009 UTC (15 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.20: +8 -9 lines
Diff to previous 1.20 (colored)

kill unnecessary struct message_recipient; ok gilles@

Revision 1.20 / (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.19: +5 -5 lines
Diff to previous 1.19 (colored)

correct some fatal(x) calls and error strings

ok gilles@ jacekm@

Revision 1.19 / (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.18: +12 -19 lines
Diff to previous 1.18 (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.18 / (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.17: +9 -9 lines
Diff to previous 1.17 (colored)

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

Revision 1.17 / (download) - annotate - [select for diffs], Sun Mar 8 19:11:22 2009 UTC (15 years, 2 months ago) by gilles
Branch: MAIN
Changes since 1.16: +1 -3 lines
Diff to previous 1.16 (colored)

shrink struct message a bit by removing a couple fields which are no longer
used and by moving the rcpt count in struct session where it really belongs

while at it, remove some unused splay tree generation in mfa

Revision 1.16 / (download) - annotate - [select for diffs], Sun Mar 8 17:54:20 2009 UTC (15 years, 2 months ago) by gilles
Branch: MAIN
Changes since 1.15: +3 -5 lines
Diff to previous 1.15 (colored)

~/.forward files handling was fixed recently so that it is the privileged
process that does the opening, this commit does some cleanup, and fixes a
bug I experienced today which was caused by a use-after-free.

I did some testing to make sure a user cannot cause smtpd to deadlock, or
loop, with broken setups (self-referencing forwards/aliases, empty files,
broken files...), but if you are playing with aliases/forwards PLEASE let
me know of any bug you run into.

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

add missing headers

ok gilles@

Revision 1.14 / (download) - annotate - [select for diffs], Wed Feb 18 22:39:12 2009 UTC (15 years, 3 months ago) by jacekm
Branch: MAIN
Changes since 1.13: +64 -14 lines
Diff to previous 1.13 (colored)

- add basic syntax checking to mfa
- decline source routing at MAIL FROM, strip at RCPT TO

ok gilles@

Revision 1.13 / (download) - annotate - [select for diffs], Wed Feb 18 16:42:30 2009 UTC (15 years, 3 months ago) by jacekm
Branch: MAIN
Changes since 1.12: +37 -54 lines
Diff to previous 1.12 (colored)

IMSG_MFA_RCPT handlers are almost identical, put common code in new
mfa_test_rcpt; ok gilles@

Revision 1.12 / (download) - annotate - [select for diffs], Tue Feb 17 21:38:47 2009 UTC (15 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.11: +1 -3 lines
Diff to previous 1.11 (colored)

- remove two debug messages

Revision 1.11 / (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.10: +2 -1 lines
Diff to previous 1.10 (colored)

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

Revision 1.10 / (download) - annotate - [select for diffs], Tue Jan 27 22:48:29 2009 UTC (15 years, 4 months ago) by gilles
Branch: MAIN
Changes since 1.9: +89 -6 lines
Diff to previous 1.9 (colored)

first bricks of enqueue code which allows smtpctl to submit mail to queue
without "talking" smtp to listeners. currently, a big part of the server
side code is done (and requires a cleanup), next step is to get it usable
properly from a mail user agent.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Jan 4 17:45:58 2009 UTC (15 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.8: +2 -3 lines
Diff to previous 1.8 (colored)

When matching a recipient domain to a rule, do not use strcasecmp, but use
new hostname_match() function which recognizes * as a wildcard. We can now
do: accept for domain "*.example.org" to match all subdomains.

idea from Nicholas Marriott <nicholas.marriott@gmail.com>, hostname_match()
from me in place of his fnmatch() calls.

ok jacekm@

Revision 1.8 / (download) - annotate - [select for diffs], Sun Jan 4 16:40:58 2009 UTC (15 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.7: +4 -4 lines
Diff to previous 1.7 (colored)

- change name of "masked" member in struct netaddr, it was misleading
- allow "from all" so that the ugly "accept from { 0.0.0.0/0, ::/0 }"
construct becomes a nice looking "accept from all"

ok jacekm@

Revision 1.7 / (download) - annotate - [select for diffs], Sun Jan 4 14:46:14 2009 UTC (15 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.6: +5 -5 lines
Diff to previous 1.6 (colored)

cleanup; ok gilles@

Revision 1.6 / (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.5: +127 -4 lines
Diff to previous 1.5 (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.5 / (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.4: +1 -4 lines
Diff to previous 1.4 (colored)

remove unnecessary includes; ok gilles@

Revision 1.4 / (download) - annotate - [select for diffs], Sat Dec 20 00:18:03 2008 UTC (15 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.3: +3 -1 lines
Diff to previous 1.3 (colored)

- import first bricks of SMTP AUTH support. currently only AUTH PLAIN is
	supported, AUTH LOGIN will follow soon. AUTH will only work if a
	listen directive has "enable auth" keywords, AND session is safe
	(ssmtp or starttls).

Revision 1.3 / (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.2: +13 -15 lines
Diff to previous 1.2 (colored)

IMSG_* namespace cleanup.

ok gilles@

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.