OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.248 / (download) - annotate - [select for diffs], Sat Jan 20 09:01:03 2024 UTC (4 months, 2 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.247: +7 -6 lines
Diff to previous 1.247 (colored)

Use imsg_get_fd() to access the fd passed via imsgs.

Most of the conversion is simple there is just log_imsg() that can
no longer display the fd since imsg_get_fd() can only be called once.
OK op@

Revision 1.247 / (download) - annotate - [select for diffs], Mon Jun 14 17:58:15 2021 UTC (2 years, 11 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, 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.246: +1 -18 lines
Diff to previous 1.246 (colored)

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

ok jung@

Revision 1.246 / (download) - annotate - [select for diffs], Wed May 26 18:08:55 2021 UTC (3 years ago) by eric
Branch: MAIN
Changes since 1.245: +4 -5 lines
Diff to previous 1.245 (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.245 / (download) - annotate - [select for diffs], Wed Apr 21 07:54:10 2021 UTC (3 years, 1 month ago) by eric
Branch: MAIN
Changes since 1.244: +1 -7 lines
Diff to previous 1.244 (colored)

unplug unused certificate verification code, now that this is done by libtls.

ok tb@ millert@

Revision 1.244 / (download) - annotate - [select for diffs], Thu Dec 31 08:27:15 2020 UTC (3 years, 5 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.243: +5 -5 lines
Diff to previous 1.243 (colored)

Rename the pony process to dispatcher and klondike to crypto.

From gilles@
OK millert@ giovanni@

Revision 1.243 / (download) - annotate - [select for diffs], Sat Dec 21 10:23:37 2019 UTC (4 years, 5 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.242: +2 -6 lines
Diff to previous 1.242 (colored)

do not pass rdns, fcrdns, ss_src and ss_dest with IMSG_FILTER_SMTP_BEGIN,
but gather the information from the link-connect reporting event instead.
this removes redundant code and makes it easier to prepare for smtp-out.

Revision 1.242 / (download) - annotate - [select for diffs], Wed Dec 18 07:57:51 2019 UTC (4 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.241: +7 -2 lines
Diff to previous 1.241 (colored)

teach relay action how to do domain-based relay host, this allows declaring
a single relay action with a mapping of relay hosts per domain.

ok eric@

Revision 1.241 / (download) - annotate - [select for diffs], Thu Dec 12 22:10:47 2019 UTC (4 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.240: +4 -2 lines
Diff to previous 1.240 (colored)

filter protocol has an initial handshake within which smtpd tells filters
about a few global configuration informations. this makes smtpd tell proc
filters for which subsystem they are registered allowing them to register
only events that are relevant.

Revision 1.240 / (download) - annotate - [select for diffs], Wed Aug 28 15:50:36 2019 UTC (4 years, 9 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.239: +13 -1 lines
Diff to previous 1.239 (colored)

Add a link-greeting report. This allows us to get the active domain name
in use for the current request.

OK gilles@

Revision 1.239 / (download) - annotate - [select for diffs], Fri Jul 26 06:30:13 2019 UTC (4 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.238: +8 -7 lines
Diff to previous 1.238 (colored)

even though RSET can be issued outside a tx, RFC states it's noop outside a
transaction so rename link-reset to tx-reset and only issue the smtp report
when a reset _actually_ has a side-effect.

note that rset is implicit on a message commit or rollback, so tx-reset get
issued even though there was no explicit RSET. the filters are MUCH simpler
to write when you don't need to track every event that can reset a tx :-)

Revision 1.238 / (download) - annotate - [select for diffs], Thu Jul 11 21:40:03 2019 UTC (4 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.237: +16 -2 lines
Diff to previous 1.237 (colored)

introduce link-auth to the smtp reporting stream so that filters may know
if a link has been authenticated successfully or not and for which user

Revision 1.237 / (download) - annotate - [select for diffs], Thu Jul 11 21:04:59 2019 UTC (4 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.236: +4 -2 lines
Diff to previous 1.236 (colored)

modify link-identify so it reports if HELO or EHLO was used

Revision 1.236 / (download) - annotate - [select for diffs], Thu Jul 11 20:58:54 2019 UTC (4 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.235: +11 -1 lines
Diff to previous 1.235 (colored)

introduce link-reset to let smtpd report resets happening in a session

Revision 1.235 / (download) - annotate - [select for diffs], Thu Jun 27 05:14:49 2019 UTC (4 years, 11 months ago) by martijn
Branch: MAIN
Changes since 1.234: +13 -1 lines
Diff to previous 1.234 (colored)

Allow filters to log information through stderr. This simplifies and
unifies the way filters need to get their logging to the right location.

Log-messages are read line by line and are logged at LOG_ERR level via
the lookup process.

OK gilles@

Revision 1.234 / (download) - annotate - [select for diffs], Thu Jun 13 11:45:34 2019 UTC (4 years, 11 months ago) by eric
Branch: MAIN
Changes since 1.233: +2 -1 lines
Diff to previous 1.233 (colored)

extend the resolver interface to delegate res_query() calls to the lka.

ok gilles@ sunil@

Revision 1.233 / (download) - annotate - [select for diffs], Sat Jan 5 09:43:39 2019 UTC (5 years, 5 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.232: +10 -1 lines
Diff to previous 1.232 (colored)

introduce smtp 'timeout' reporting event to notify filters that a timeout
occured during the smtp session

Revision 1.232 / (download) - annotate - [select for diffs], Fri Dec 28 11:40:29 2018 UTC (5 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.231: +9 -9 lines
Diff to previous 1.231 (colored)

remove the tag workaround for table_create() and table_find(),
now that static tables handle their updates internally.

ok gilles@

Revision 1.231 / (download) - annotate - [select for diffs], Wed Dec 26 20:13:43 2018 UTC (5 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.230: +6 -6 lines
Diff to previous 1.230 (colored)

reorder parameters for consistency

Revision 1.230 / (download) - annotate - [select for diffs], Wed Dec 26 14:15:12 2018 UTC (5 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.229: +8 -8 lines
Diff to previous 1.229 (colored)

get rid of the unused dict argument in table lookup and fetch api.

ok gilles@

Revision 1.229 / (download) - annotate - [select for diffs], Sun Dec 23 16:37:53 2018 UTC (5 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.228: +1 -152 lines
Diff to previous 1.228 (colored)

remove dead code

ok gilles@

Revision 1.228 / (download) - annotate - [select for diffs], Fri Dec 21 14:33:52 2018 UTC (5 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.227: +36 -4 lines
Diff to previous 1.227 (colored)

bring in new grammar for filters, allowing filter chains and plugging of
different filters & chains on different interfaces.

in this diff, proc filters are still disabled as they're missing on very
important piece of logic.

ok eric@

Revision 1.227 / (download) - annotate - [select for diffs], Thu Dec 13 17:08:10 2018 UTC (5 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.226: +30 -30 lines
Diff to previous 1.226 (colored)

in event reports, use a struct timeval instead of time_t since we want more
than second precision

discussed with eric@

Revision 1.226 / (download) - annotate - [select for diffs], Wed Dec 12 21:27:49 2018 UTC (5 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.225: +13 -1 lines
Diff to previous 1.225 (colored)

add tx-data reporting event

Revision 1.225 / (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.224: +6 -6 lines
Diff to previous 1.224 (colored)

do some imsg renaming to make them more clear

Revision 1.224 / (download) - annotate - [select for diffs], Tue Dec 11 13:29:52 2018 UTC (5 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.223: +41 -155 lines
Diff to previous 1.223 (colored)

factor smtp-in and smtp-out reporting code

Revision 1.223 / (download) - annotate - [select for diffs], Tue Dec 11 11:29:44 2018 UTC (5 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.222: +15 -1 lines
Diff to previous 1.222 (colored)

report filter responses to smtp

Revision 1.222 / (download) - annotate - [select for diffs], Tue Dec 11 08:40:56 2018 UTC (5 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.221: +22 -1 lines
Diff to previous 1.221 (colored)

generate an event when a helo name identifies a link

Revision 1.221 / (download) - annotate - [select for diffs], Sun Dec 9 17:37:15 2018 UTC (5 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.220: +2 -4 lines
Diff to previous 1.220 (colored)

no longer pass rdns in all filtering requests, they can be retrieved from
the filter session.

Revision 1.220 / (download) - annotate - [select for diffs], Sun Dec 9 16:37:51 2018 UTC (5 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.219: +6 -2 lines
Diff to previous 1.219 (colored)

add client and listener address, as well as client rDNS and FCrDNS lookup
result to the filter_session structure upon filter session allocation. it
will allow me to simplify all filter hooks.

Revision 1.219 / (download) - annotate - [select for diffs], Fri Dec 7 08:05:59 2018 UTC (5 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.218: +7 -1 lines
Diff to previous 1.218 (colored)

Refactor certificate initialization and verification.
Factorize code duplicated in smtp_session.c and mta_session.c
Implement a simple callback interface, with proper request management
and simplified imsg protocol.

Only add the necessary parts for now.
Exisiting code path will be adapted later.

input from gilles@ sunil@
ok gilles@

Revision 1.218 / (download) - annotate - [select for diffs], Thu Dec 6 16:05:04 2018 UTC (5 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.217: +6 -3 lines
Diff to previous 1.217 (colored)

link-connect event report had an empty fcrdns field, but now that eric@ has
plugged fcrdns in the smtp_session we can fill the field with a value

Revision 1.217 / (download) - annotate - [select for diffs], Thu Dec 6 15:32:06 2018 UTC (5 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.216: +51 -1 lines
Diff to previous 1.216 (colored)

introduce tx-mail and tx-rcpt report events

Revision 1.216 / (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.215: +38 -5 lines
Diff to previous 1.215 (colored)

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

ok eric@

Revision 1.215 / (download) - annotate - [select for diffs], Fri Nov 30 15:33:40 2018 UTC (5 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.214: +105 -10 lines
Diff to previous 1.214 (colored)

prepare for smtp-out reporting and while at it, make a few changes to the
report format

Revision 1.214 / (download) - annotate - [select for diffs], Thu Nov 8 13:21:00 2018 UTC (5 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.213: +20 -3 lines
Diff to previous 1.213 (colored)

when reporting tx events, report tx id
when reporting tx commit, report data size
report tx-envelope events

Revision 1.213 / (download) - annotate - [select for diffs], Sat Nov 3 13:56:49 2018 UTC (5 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.212: +4 -2 lines
Diff to previous 1.212 (colored)

check-rdns builtin filter, to be improved

Revision 1.212 / (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.211: +13 -1 lines
Diff to previous 1.211 (colored)

bring plumbing for builtin filters

ok millert@, eric@, jung@

Revision 1.211 / (download) - annotate - [select for diffs], Fri Nov 2 17:20:22 2018 UTC (5 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.210: +4 -2 lines
Diff to previous 1.210 (colored)

report rDNS in link connect event

Revision 1.210 / (download) - annotate - [select for diffs], Fri Nov 2 16:50:23 2018 UTC (5 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.209: +6 -5 lines
Diff to previous 1.209 (colored)

pass struct sockaddr_storage instead of ss_to_text() in reporting

Revision 1.209 / (download) - annotate - [select for diffs], Thu Nov 1 14:48:49 2018 UTC (5 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.208: +81 -1 lines
Diff to previous 1.208 (colored)

teach smtp process how to report smtp events to lka and teach lka how to
report these events to a proc

ok millert@

Revision 1.208 / (download) - annotate - [select for diffs], Thu Nov 1 10:13:25 2018 UTC (5 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.207: +11 -2 lines
Diff to previous 1.207 (colored)

allow smtpd to fork processes at startup and maintain a socketpair with
them.

ok jung@, eric@

Revision 1.207 / (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.206: +6 -3 lines
Diff to previous 1.206 (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.206 / (download) - annotate - [select for diffs], Sat Jun 16 19:41:26 2018 UTC (5 years, 11 months ago) by gilles
Branch: MAIN
Changes since 1.205: +12 -12 lines
Diff to previous 1.205 (colored)

rework the table API so that it takes a struct smtpd * context in parameter
of functions creating, looking up or destroying tables.

this is a first step in cleaning up parse.y so it doesn't have side effects
outside of parse_config(), bringing nothing but making code cleaner.

ok millert@

Revision 1.205 / (download) - annotate - [select for diffs], Thu May 31 21:06:12 2018 UTC (6 years ago) by gilles
Branch: MAIN
Changes since 1.204: +6 -6 lines
Diff to previous 1.204 (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.204 / (download) - annotate - [select for diffs], Tue May 29 20:43:07 2018 UTC (6 years ago) by eric
Branch: MAIN
Changes since 1.203: +2 -4 lines
Diff to previous 1.203 (colored)

no need to parse and dump the relayhost in the lookup process.

ok gilles@

Revision 1.203 / (download) - annotate - [select for diffs], Thu May 24 11:38:24 2018 UTC (6 years ago) by gilles
Branch: MAIN
Changes since 1.202: +32 -1 lines
Diff to previous 1.202 (colored)

switch smtpd to new grammar

ok eric@

Revision 1.202 / (download) - annotate - [select for diffs], Wed Jan 3 11:12:21 2018 UTC (6 years, 5 months ago) by sunil
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.201: +2 -6 lines
Diff to previous 1.201 (colored)

Use crypt_checkpass(3) instead of crypt(3).

Based on a diff from Edgar Pettijohn.
Ok gilles@ eric@

Revision 1.201 / (download) - annotate - [select for diffs], Mon Nov 27 08:35:59 2017 UTC (6 years, 6 months ago) by sunil
Branch: MAIN
Changes since 1.200: +8 -4 lines
Diff to previous 1.200 (colored)

Show correct command execution status by checking against update
operation return value.

Issue reported by 'Zelest' (Jesper Wallin).
Suggestions and ok eric@ gilles@.

Revision 1.200 / (download) - annotate - [select for diffs], Tue Nov 21 12:20:34 2017 UTC (6 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.199: +236 -257 lines
Diff to previous 1.199 (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.199 / (download) - annotate - [select for diffs], Wed May 17 14:00:06 2017 UTC (7 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.198: +3 -5 lines
Diff to previous 1.198 (colored)

Introduce more use of freezero().  Also, remove ptr conditionals before
many functions which are free(NULL)-compat
ok gilles

Revision 1.198 / (download) - annotate - [select for diffs], Mon Jan 9 09:53:23 2017 UTC (7 years, 5 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.197: +3 -3 lines
Diff to previous 1.197 (colored)

smtpd joins the 7 other daemons that share the same log.c file.

The only major difference was the "log_trace" concept that is only
used by smtpd - move it from log.c into util.c and make it a local
concept.  This also needed to rename the global "verbose" variable to
"tracing" in a few places.

OK krw@ gilles@ eric@

Revision 1.197 / (download) - annotate - [select for diffs], Thu Sep 8 12:06:43 2016 UTC (7 years, 9 months ago) by eric
Branch: MAIN
Changes since 1.196: +7 -12 lines
Diff to previous 1.196 (colored)

Streamline the daemon shutdown sequence.

Only the parent process handles SIGTERM and SIGINT.  Upon receiving one
of those, it closes all imsg sockets and waitpid() for the children. It
fatal()s if one of the sockets is closed unexpectedly.  Other processes
exit() "normally" when one of the imsg sockets is closed.

ok gilles@ sunil@

Revision 1.196 / (download) - annotate - [select for diffs], Sun Sep 4 16:10:31 2016 UTC (7 years, 9 months ago) by eric
Branch: MAIN
Changes since 1.195: +3 -4 lines
Diff to previous 1.195 (colored)

The smtpd processes are not expected to ever leave their event loop.
So stop pretending that the *_shutdown() functions could ever be called
in this context, and just fatal() if event_dispatch() returns.

ok gilles@ sunil@ giovanni@

Revision 1.195 / (download) - annotate - [select for diffs], Sat Sep 3 15:54:14 2016 UTC (7 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.194: +2 -2 lines
Diff to previous 1.194 (colored)

in lka specifically, use initgroups() so that users may share files between
smtpd and another daemon by adding supplementary groups

ok eric@

Revision 1.194 / (download) - annotate - [select for diffs], Thu Sep 1 10:54:25 2016 UTC (7 years, 9 months ago) by eric
Branch: MAIN
Changes since 1.193: +1 -2 lines
Diff to previous 1.193 (colored)

remove noop function

ok sunil@

Revision 1.193 / (download) - annotate - [select for diffs], Sat May 28 21:21:20 2016 UTC (8 years ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.192: +2 -13 lines
Diff to previous 1.192 (colored)

Implement the fork+exec pattern in smtpd.

The parent process forks child processes and re-exec each of them with
an additional "-x <proc>" argument.  During the early setup phase, the
parent process sends ipc socket pairs to interconnect the child
processes as needed, and it passes the queue encryption key to the
queue if necessary. When this is done, all processes have their
environment set as in the fork-only case, and they can start doing
their work as before.

ok gilles@ jung@

Revision 1.192 / (download) - annotate - [select for diffs], Fri Jan 22 13:10:41 2016 UTC (8 years, 4 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.191: +9 -1 lines
Diff to previous 1.191 (colored)

in lka process, revoke proc/exec pledges after privsep-ed table backends
are forked at startup

i thought i had committed this already, diff has been okayed several weeks
ago...

ok jung@, ok millert@, ok sunil@

Revision 1.191 / (download) - annotate - [select for diffs], Mon Jan 4 13:36:32 2016 UTC (8 years, 5 months ago) by jung
Branch: MAIN
Changes since 1.190: +2 -2 lines
Diff to previous 1.190 (colored)

add proc and exec to pledge in lka, required to run external add-ons outside of
the daemon memory space, makes -extras tables work again

reported by Tim van der Molen on misc@opensmtpd.org

verified together with sunil

ok gilles

Revision 1.190 / (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.189: +4 -4 lines
Diff to previous 1.189 (colored)

remove spaces after '!'

no binary change

ok millert

Revision 1.189 / (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.188: +3 -3 lines
Diff to previous 1.188 (colored)

remove trailing whitespace

ok sunil gilles

Revision 1.188 / (download) - annotate - [select for diffs], Sat Dec 12 20:02:31 2015 UTC (8 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.187: +12 -7 lines
Diff to previous 1.187 (colored)

remove CA from pki and no longer allow specifying a CA with 'pki' keyword.
introduce 'ca' keyword to allow specifying a custom CA.
making CA part of pki was a bad idea and several people hit use-cases that
plain couldn't work.

instead of:
    pki foobar.org ca "/etc/mail/CA.pem"

use now:
    ca foobar.org certificate "/etc/mail/CA.pem"


ok sunil@, jung@

Revision 1.187 / (download) - annotate - [select for diffs], Sat Dec 12 14:06:08 2015 UTC (8 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.186: +4 -1 lines
Diff to previous 1.186 (colored)

if no certificate matches name AND fallback hint was given, search for a
global certificate

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

remove empty line

Revision 1.185 / (download) - annotate - [select for diffs], Sat Dec 12 13:48:50 2015 UTC (8 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.184: +27 -24 lines
Diff to previous 1.184 (colored)

move the cert verify code to its own function outside the imsg handling
code, no functional change but this makes code easier to read, and will
ease implementing DANE later on.

Revision 1.184 / (download) - annotate - [select for diffs], Sat Dec 12 13:25:18 2015 UTC (8 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.183: +30 -96 lines
Diff to previous 1.183 (colored)

smtp / mta have been factored in the same process months ago, factor the
code that handles the same imsg's too

ok sunil@, ok jung@

Revision 1.183 / (download) - annotate - [select for diffs], Sat Dec 12 11:31:28 2015 UTC (8 years, 5 months ago) by sunil
Branch: MAIN
Changes since 1.182: +18 -1 lines
Diff to previous 1.182 (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.182 / (download) - annotate - [select for diffs], Sat Dec 12 10:55:21 2015 UTC (8 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.181: +13 -1 lines
Diff to previous 1.181 (colored)

prepare for asynchronous certificate verify, needed for a mechanical
cleanup and later on for DANE support

Revision 1.181 / (download) - annotate - [select for diffs], Fri Dec 11 21:44:00 2015 UTC (8 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.180: +3 -3 lines
Diff to previous 1.180 (colored)

rename field member + whitespaces

Revision 1.180 / (download) - annotate - [select for diffs], Mon Nov 30 14:05:34 2015 UTC (8 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.179: +40 -1 lines
Diff to previous 1.179 (colored)

bring lka_mailaddrmap(), currently unused, required by sendermap/masquerade

ok jung@

Revision 1.179 / (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.178: +15 -15 lines
Diff to previous 1.178 (colored)

mechanical rename of some IMSG constants

ok sunil@, ok jung@

Revision 1.178 / (download) - annotate - [select for diffs], Wed Oct 14 22:01:43 2015 UTC (8 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.177: +2 -2 lines
Diff to previous 1.177 (colored)

whitespaces

Revision 1.177 / (download) - annotate - [select for diffs], Wed Oct 14 19:39:16 2015 UTC (8 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.176: +4 -1 lines
Diff to previous 1.176 (colored)

pledge() pony and lookup

ok deraadt@

Revision 1.172.4.1 / (download) - annotate - [select for diffs], Fri Oct 2 01:33:33 2015 UTC (8 years, 8 months ago) by gilles
Branch: OPENBSD_5_6
Changes since 1.172: +3 -1 lines
Diff to previous 1.172 (colored) next main 1.173 (colored)

Errata 031:
fix multiple security and reliability issues found during an audit by
Qualys Security

Revision 1.175.2.1 / (download) - annotate - [select for diffs], Fri Oct 2 01:28:43 2015 UTC (8 years, 8 months ago) by gilles
Branch: OPENBSD_5_7
Changes since 1.175: +3 -1 lines
Diff to previous 1.175 (colored) next main 1.176 (colored)

Errata 017:
fix multiple security and reliability issues found during an audit by
Qualys Security

Revision 1.175.6.1 / (download) - annotate - [select for diffs], Fri Oct 2 00:55:02 2015 UTC (8 years, 8 months ago) by gilles
Branch: OPENBSD_5_8
Changes since 1.175: +3 -1 lines
Diff to previous 1.175 (colored) next main 1.176 (colored)

Errata 004:
fix multiple security and reliability issues found during an audit by
Qualys Security

Revision 1.176 / (download) - annotate - [select for diffs], Fri Oct 2 00:28:30 2015 UTC (8 years, 8 months ago) by gilles
Branch: MAIN
Changes since 1.175: +3 -1 lines
Diff to previous 1.175 (colored)

reset static pointer to NULL after we free it, just in case another bug
leads us to reuse it.

Revision 1.175 / (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_7_BASE
Branch point for: OPENBSD_5_8, OPENBSD_5_7
Changes since 1.174: +2 -2 lines
Diff to previous 1.174 (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.174 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:20 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.173: +2 -1 lines
Diff to previous 1.173 (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.173 / (download) - annotate - [select for diffs], Wed Sep 3 07:42:47 2014 UTC (9 years, 9 months ago) by giovanni
Branch: MAIN
Changes since 1.172: +6 -2 lines
Diff to previous 1.172 (colored)


if crypt(3) fails return an authentication error
ok gilles@

Revision 1.172 / (download) - annotate - [select for diffs], Thu Jul 10 15:54:55 2014 UTC (9 years, 11 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE
Branch point for: OPENBSD_5_6
Changes since 1.171: +14 -13 lines
Diff to previous 1.171 (colored)

make the control process broadcast verbose/profile admin requests directly,
rather than going through the parent process. simplify code in the meantime.

Revision 1.171 / (download) - annotate - [select for diffs], Tue Jul 8 13:49:09 2014 UTC (9 years, 11 months ago) by eric
Branch: MAIN
Changes since 1.170: +6 -6 lines
Diff to previous 1.170 (colored)

Update the table API: lookup functions can take an optional parameters
dictionnary (currently not set). While there, add a helper for forking
external backends, and remove unused table functions.

ok gilles@

Revision 1.170 / (download) - annotate - [select for diffs], Thu May 22 20:31:03 2014 UTC (10 years ago) by gilles
Branch: MAIN
Changes since 1.169: +2 -2 lines
Diff to previous 1.169 (colored)

when we reduced the number of iovec's we passed through an imsg, the iovec
declaration was not bumped down causing us to pass extra junk leading to a
crash in the pki lookup code. i'm amazed no one else crashed on that :-/

reported by Olivier Antoine who kindly provided access to his box

Revision 1.169 / (download) - annotate - [select for diffs], Thu May 1 15:50:20 2014 UTC (10 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.168: +1 -8 lines
Diff to previous 1.168 (colored)

Move RSA keys from "lka" to a new dedicated "ca" process because lka
is handling some async requests and shouldn't be busy with sync RSA.

ok gilles@

Revision 1.168 / (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.167: +8 -7 lines
Diff to previous 1.167 (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.167 / (download) - annotate - [select for diffs], Tue Apr 15 08:32:45 2014 UTC (10 years, 1 month ago) by eric
Branch: MAIN
Changes since 1.166: +2 -2 lines
Diff to previous 1.166 (colored)

reply with correct imsg when using non-system auth.

reported by Stefan Sieg

ok gilles@

Revision 1.166 / (download) - annotate - [select for diffs], Wed Apr 9 15:23:49 2014 UTC (10 years, 2 months ago) by eric
Branch: MAIN
Changes since 1.165: +2 -1 lines
Diff to previous 1.165 (colored)

need to change imsg type before forwarding.

reported by jturner@
ok gilles@

Revision 1.165 / (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.164: +40 -45 lines
Diff to previous 1.164 (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.164 / (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.163: +25 -171 lines
Diff to previous 1.163 (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.163 / (download) - annotate - [select for diffs], Tue Feb 4 09:50:31 2014 UTC (10 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.162: +2 -2 lines
Diff to previous 1.162 (colored)

add base64_encode/base64_decode helpers

Revision 1.162 / (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.161: +1 -7 lines
Diff to previous 1.161 (colored)

get rid of fdlimit()

Revision 1.161 / (download) - annotate - [select for diffs], Wed Nov 20 09:22:42 2013 UTC (10 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.160: +2 -2 lines
Diff to previous 1.160 (colored)

Rework the mda and scheduler to use the holdq mechanism instead of
tempfail for limiting the number of pending deliveries to the same
user.  This allows to reach optimal delivery time even in case of
burst, while keeping the number of inflight envelopes low.

Revision 1.160 / (download) - annotate - [select for diffs], Mon Nov 18 12:24:26 2013 UTC (10 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.159: +11 -3 lines
Diff to previous 1.159 (colored)

Allow overriding the local ca

Revision 1.159 / (download) - annotate - [select for diffs], Wed Nov 13 08:39:33 2013 UTC (10 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.158: +6 -2 lines
Diff to previous 1.158 (colored)

Fix case-folding issue with pki names. They are case-insensitive.
Make sure a pki entry exists when used in a listen or relay rule.

Revision 1.158 / (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.157: +29 -1 lines
Diff to previous 1.157 (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.157 / (download) - annotate - [select for diffs], Mon Oct 28 17:02:08 2013 UTC (10 years, 7 months ago) by eric
Branch: MAIN
Changes since 1.156: +4 -10 lines
Diff to previous 1.156 (colored)

Report the ssl certificate verification status in the mail header.
Log ssl certificate validation errors.
Fix several ssl-related leaks.

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

missing m_end()

Revision 1.155 / (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.154: +2 -1 lines
Diff to previous 1.154 (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.154 / (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.153: +3 -2 lines
Diff to previous 1.153 (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.153 / (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.152: +1 -2 lines
Diff to previous 1.152 (colored)

Remove useless sc_pid from struct smtpd.

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

sync with OpenSMTPD 5.3.2

ok gilles@

Revision 1.151 / (download) - annotate - [select for diffs], Fri Apr 12 18:22:49 2013 UTC (11 years, 1 month ago) by eric
Branch: MAIN
Changes since 1.150: +2 -2 lines
Diff to previous 1.150 (colored)

replace MAX_LINE_SIZE and SMTP_LINE_MAX with SMTPD_MAXLINESIZE for
consistency and clarity.  Remove useless and confusing extra byte in
a few arrays based on this define.

ok gilles@

Revision 1.150 / (download) - annotate - [select for diffs], Thu Feb 14 12:30:49 2013 UTC (11 years, 3 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.149: +3 -3 lines
Diff to previous 1.149 (colored)

- smtpctl trace expand, enables tracing of aliases expansion
- replace "users" keyword with "userbase" when providing alternate userbase
- disambiguise expansion nodes when expanding across domains and userbases
- allow use of '=' instead of '=>' when declaring a mapping

ok eric@

Revision 1.149 / (download) - annotate - [select for diffs], Tue Feb 5 11:45:18 2013 UTC (11 years, 4 months ago) by gilles
Branch: MAIN
Changes since 1.148: +8 -7 lines
Diff to previous 1.148 (colored)

- handle getaddrinfo() error as LKA_TEMPFAIL
- handle getsockname() error in smtp_connected()
- accept '/' as part of user-part, expand to ':' as done by qmail
- fix wrong check in mda leading to bogus Return-Path header
- fix aliases parsing when there's a white space between key and separator
- some cosmethic cleanup

Revision 1.148 / (download) - annotate - [select for diffs], Mon Jan 28 11:09:53 2013 UTC (11 years, 4 months ago) by gilles
Branch: MAIN
Changes since 1.147: +6 -10 lines
Diff to previous 1.147 (colored)

- introduce 'smtpctl trace lookup' to trace lookup process
- improve logging of the transfer process

trace by me, logging by eric

Revision 1.147 / (download) - annotate - [select for diffs], Sat Jan 26 09:37:23 2013 UTC (11 years, 4 months ago) by gilles
Branch: MAIN
Changes since 1.146: +640 -144 lines
Diff to previous 1.146 (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.146 / (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.145: +7 -7 lines
Diff to previous 1.145 (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.145 / (download) - annotate - [select for diffs], Sun Oct 14 11:58:23 2012 UTC (11 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.144: +26 -1 lines
Diff to previous 1.144 (colored)

introduce map_file.c which will deprecate map_stdio.c

The idea is to have a file-backed map but to have smtpd(8) cache the maps
so that it cannot be partially read if edited while mail is received. The
file is read and converted to a static map (map_static.c), changes aren't
visible to smtpd until an explicit: smtpctl update map  which reads file,
builds a new static map and invalidates the former.

partial-read issue discussed with beck@ and halex@
idea to convert internally to a static map by eric@

diff ok eric@ and chl@

Revision 1.144 / (download) - annotate - [select for diffs], Sat Oct 13 08:01:47 2012 UTC (11 years, 7 months ago) by eric
Branch: MAIN
Changes since 1.143: +6 -4 lines
Diff to previous 1.143 (colored)

Make map_lookup() and make_compare() set errno on failure to distinguish
between "no match" and "internal error" (e.g. missing or broken db file).
Adapt alias expansion and ruleset matching code to check for such errors,
in which case the current processing is aborted, and a temporary failure
is reported to the smtp session.

ok gilles@

Revision 1.143 / (download) - annotate - [select for diffs], Sun Sep 30 14:28:15 2012 UTC (11 years, 8 months ago) by gilles
Branch: MAIN
Changes since 1.142: +2 -2 lines
Diff to previous 1.142 (colored)

- add decision to the rule so that we can actually perform a reject match
  ie:

	reject from 192.168.1.0/24 for domain "openbsd.org"
	accept from 192.168.0.0/16 for domain "openbsd.org" deliver to mbox

it was documented but not working.

ok eric@ & chl@

Revision 1.142 / (download) - annotate - [select for diffs], Sat Sep 29 10:35:00 2012 UTC (11 years, 8 months ago) by eric
Branch: MAIN
Changes since 1.141: +2 -10 lines
Diff to previous 1.141 (colored)

finally remove rule member from struct envelope.

"wow!" gilles@

Revision 1.141 / (download) - annotate - [select for diffs], Fri Sep 28 14:03:00 2012 UTC (11 years, 8 months ago) by chl
Branch: MAIN
Changes since 1.140: +8 -19 lines
Diff to previous 1.140 (colored)

use xmemdup() and xcalloc() helpers

ok eric@

Revision 1.140 / (download) - annotate - [select for diffs], Fri Sep 21 10:22:29 2012 UTC (11 years, 8 months ago) by eric
Branch: MAIN
Changes since 1.139: +1 -2 lines
Diff to previous 1.139 (colored)

Move ruleset_match() prototype to smtpd.h and make the envelope const.
Adapt a lot of functions in chain to use const args where required.

ok gilles@

Revision 1.139 / (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.138: +2 -1 lines
Diff to previous 1.138 (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.138 / (download) - annotate - [select for diffs], Wed Sep 19 11:57:35 2012 UTC (11 years, 8 months ago) by eric
Branch: MAIN
Changes since 1.137: +3 -2 lines
Diff to previous 1.137 (colored)

remove IS_RELAY and IS_MAILBOX macros.

ok gilles@

Revision 1.137 / (download) - annotate - [select for diffs], Tue Sep 18 13:42:39 2012 UTC (11 years, 8 months ago) by eric
Branch: MAIN
Changes since 1.136: +2 -4 lines
Diff to previous 1.136 (colored)

simple lka cleanups:

- fix lka* function prototypes in smtpd.h
- make static functions static
- merge lka_session_init() into lka_session()
- make lka_session.c use tree.c to store sessions

ok gilles@

Revision 1.136 / (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.135: +1 -3 lines
Diff to previous 1.135 (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.135 / (download) - annotate - [select for diffs], Sat Aug 25 22:52:19 2012 UTC (11 years, 9 months ago) by eric
Branch: MAIN
Changes since 1.134: +11 -1 lines
Diff to previous 1.134 (colored)

lka must not start servicing requests until it has received its full config
from parent.  Disable imsg from other processes until then.  Fix some races
when the mta tries to lookup an auth map too early, for example.

ok gilles@ chl@

Revision 1.134 / (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.133: +3 -2 lines
Diff to previous 1.133 (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.133 / (download) - annotate - [select for diffs], Sat May 12 15:31:43 2012 UTC (12 years, 1 month ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.132: +8 -4 lines
Diff to previous 1.132 (colored)

- 'secret' -> 'credentials' in some logs
- log_warn() admin that a map that's needed by an envelope is no longer in
  the configuration file

Revision 1.132 / (download) - annotate - [select for diffs], Sat May 12 15:29:16 2012 UTC (12 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.131: +18 -13 lines
Diff to previous 1.131 (colored)

- rename all occurences of K_SECRET to K_CREDENTIALS
- rename all occurences of struct map_secret to map_credentials
- do not fatal if the credentials map has disappeared, instead make the
  auth fail with a lookup failure. the mail will be temporary failed so
  it stays in queue until admin fixes smtpd.conf, removes mail, or lets
  it expires

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

when receiving an unexpected imsg, print its name.

with help and ideas from eric@

ok eric@ gilles@

Revision 1.130 / (download) - annotate - [select for diffs], Sun Oct 23 15:36:53 2011 UTC (12 years, 7 months ago) by eric
Branch: MAIN
Changes since 1.129: +2 -2 lines
Diff to previous 1.129 (colored)

a few important fixes:

- use correct endianness when dumping/loading port
- use the right flag set when dumping/loading flags
- keep and use the authmap name when needed, rather than an id that
  might change when smtpd is restarted
- dump/load the authmap name with the envelope
- remove the rule struct from rq_batch as only the relay info is useful

ok gilles@

Revision 1.129 / (download) - annotate - [select for diffs], Sun Oct 23 09:30:06 2011 UTC (12 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.128: +3 -3 lines
Diff to previous 1.128 (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.128 / (download) - annotate - [select for diffs], Sun Oct 9 18:39:53 2011 UTC (12 years, 8 months ago) by eric
Branch: MAIN
Changes since 1.127: +3 -1 lines
Diff to previous 1.127 (colored)

show messages sent between processes in debug mode

ok gilles@ chl@

Revision 1.127 / (download) - annotate - [select for diffs], Mon May 16 21:05:51 2011 UTC (13 years ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.126: +22 -534 lines
Diff to previous 1.126 (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.126 / (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.125: +64 -65 lines
Diff to previous 1.125 (colored)

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

discussed with and ok gilles@

Revision 1.125 / (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.124: +30 -30 lines
Diff to previous 1.124 (colored)

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

Revision 1.124 / (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.123: +2 -2 lines
Diff to previous 1.123 (colored)

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

Revision 1.123 / (download) - annotate - [select for diffs], Mon Nov 29 15:25:55 2010 UTC (13 years, 6 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.122: +2 -2 lines
Diff to previous 1.122 (colored)

replace the fork-based-non-blocking-resolver-hack by shiny async resolver
written by eric@. it is still experimental but still better than what we
had earlier so ... we'll improve in tree :)

diff by me with *lots* of help from eric@, tested by todd and I (and a
few people out there)

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

remove all unused headers

Revision 1.121 / (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.120: +3 -14 lines
Diff to previous 1.120 (colored)

a bit of .h cleanups, no functionnal change

Revision 1.120 / (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.119: +3 -2 lines
Diff to previous 1.119 (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.119 / (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.118: +156 -203 lines
Diff to previous 1.118 (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.118 / (download) - annotate - [select for diffs], Mon Sep 20 09:01:09 2010 UTC (13 years, 8 months ago) by gilles
Branch: MAIN
Changes since 1.117: +19 -15 lines
Diff to previous 1.117 (colored)

- fix a regression caused by latest commit (long story made short: do not
  attempt to expand the local delivery buffer when relaying mail, it was
  kind of ok before but no longer is)
- use the same buffer for local deliveries to files and commands

tested by jmc@ and I

Revision 1.117 / (download) - annotate - [select for diffs], Sun Sep 12 22:38:31 2010 UTC (13 years, 8 months ago) by gilles
Branch: MAIN
Changes since 1.116: +91 -103 lines
Diff to previous 1.116 (colored)

oga@ spotted a bug in lka_expand() which caused it to miscalculate the
length of its expand buffer. this commit introduces a new lka_expand()
that has been simplified, that fixes the bug and that is more robust.
callers of lka_expand() can now determine that it has failed and throw
the recipient at session time.

lka_expand() rewrite by oga@, changes around it by me, tested on a few
different setups but no feedback from tech@ so ... let me know if it's
breaking something for you

Revision 1.116 / (download) - annotate - [select for diffs], Wed Sep 8 13:46:18 2010 UTC (13 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.115: +20 -4 lines
Diff to previous 1.115 (colored)

add support for sender expansion in smtpd.conf:

	%U for sender localpart
	%D for sender domainpart

diff sent to tech@ by Gregory Edigarov <greg@bestnet.kharkov.ua>, timeout
by jacekm@, ok by me

Revision 1.115 / (download) - annotate - [select for diffs], Fri Jun 4 11:15:25 2010 UTC (14 years ago) by jacekm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.114: +2 -2 lines
Diff to previous 1.114 (colored)

Use correct imsg type in error reply.

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

check event_dispatch() return value

ok jacekm@

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

new queue, again; gcc2 compile tested by deraadt

Revision 1.112 / (download) - annotate - [select for diffs], Tue Jun 1 19:47:08 2010 UTC (14 years ago) by jacekm
Branch: MAIN
Changes since 1.111: +151 -181 lines
Diff to previous 1.111 (colored)

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

Revision 1.111 / (download) - annotate - [select for diffs], Tue Jun 1 02:19:56 2010 UTC (14 years ago) by jacekm
Branch: MAIN
Changes since 1.110: +2 -2 lines
Diff to previous 1.110 (colored)

Don't interpret garbage on stack; problem seemingly exposed by my
queue rewrite.  Proper fix after gilles wakes up.

Revision 1.110 / (download) - annotate - [select for diffs], Tue Jun 1 02:08:56 2010 UTC (14 years ago) by jacekm
Branch: MAIN
Changes since 1.109: +3 -3 lines
Diff to previous 1.109 (colored)

Fix one case of not sending smtp session id on error.

Revision 1.109 / (download) - annotate - [select for diffs], Mon May 31 23:38:56 2010 UTC (14 years ago) by jacekm
Branch: MAIN
Changes since 1.108: +179 -149 lines
Diff to previous 1.108 (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.108 / (download) - annotate - [select for diffs], Thu May 27 15:36:04 2010 UTC (14 years ago) by gilles
Branch: MAIN
Changes since 1.107: +5 -16 lines
Diff to previous 1.107 (colored)

when a rule has two conditions (ie: accept for { domain foo, domain bar } )
expand to two rules each having its own condition rather than one rule
with a tail queue of conditions. this simplifies code a bit and removes a
couple hacks.

basic testing by oga and me

Revision 1.107 / (download) - annotate - [select for diffs], Tue Apr 27 09:49:23 2010 UTC (14 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.106: +6 -6 lines
Diff to previous 1.106 (colored)

initial work at fixing aliases support:
- kill struct alias, struct expandnode is used instead
- introduce map_parse_alias() and map_parse_virtual()
- aliases and virtual code no longer assume db(3) but use the map API which
  lets them become backend agnostic AND value-checked. this actually makes
  the code simpler by removing all values parsing from aliases.c
- rename K_SECRETS -> K_SECRET, K_ALIASES -> K_ALIAS for consistency the
  enum has singular names.
- aliases, virtual and forward now work with an expandtree and deal with
  multiple levels of resolving by merging expandtree's

more coming soon ;)

Revision 1.106 / (download) - annotate - [select for diffs], Wed Apr 21 21:47:38 2010 UTC (14 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.105: +14 -15 lines
Diff to previous 1.105 (colored)

introduce first map parser for maps of kind K_SECRETS !

map_parse_secret() converts a map value into a struct map_secret. lka no
longer needs to do any parsing, it simply calls map_lookup() with kind
K_SECRETS, checks if it returned a !NULL value, and call lka_encode_secret
to safely do the base64 encoding.

Revision 1.105 / (download) - annotate - [select for diffs], Wed Apr 21 19:53:15 2010 UTC (14 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.104: +2 -2 lines
Diff to previous 1.104 (colored)

map_lookup() takes an additionnal parameter of type enum map_kind which
will be used to select the appropriate map parser. make sure every call
to map_lookup() is updated. map_lookup() currently ignores the value.

Revision 1.104 / (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.103: +1 -2 lines
Diff to previous 1.103 (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.103 / (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.102: +1 -3 lines
Diff to previous 1.102 (colored)

Remove unusable ifdef DEBUG code.

Revision 1.102 / (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.101: +181 -505 lines
Diff to previous 1.101 (colored)

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

Revision 1.101 / (download) - annotate - [select for diffs], Wed Feb 17 17:27:47 2010 UTC (14 years, 3 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.100: +2 -2 lines
Diff to previous 1.100 (colored)

erf, previous fix to lka crash was still using the wrong define ...

Revision 1.100 / (download) - annotate - [select for diffs], Wed Feb 17 13:47:31 2010 UTC (14 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.99: +10 -5 lines
Diff to previous 1.99 (colored)

the map api becomes backend-agnostic with initial support for db(3) and
stdio(3) backends, though for now we only enable db(3). this is the first
commit of a serie to improve maps and everything related.

idea discussed with and diff okay jacekm@

Revision 1.99 / (download) - annotate - [select for diffs], Wed Feb 17 08:40:24 2010 UTC (14 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.98: +6 -3 lines
Diff to previous 1.98 (colored)

localpart of a struct path may legally exceed MAXLOGNAME, causing lka to
fatalx() on a lowercase() call in some cases. make sure lka uses a buffer
capable of holding a localpart, and do not attempt getpwnam() if we know
it's going to fail anyway...

issue reported by Ben Lindstrom <mouring@eviladmin.org>

Revision 1.98 / (download) - annotate - [select for diffs], Sun Jan 3 14:37:37 2010 UTC (14 years, 5 months ago) by chl
Branch: MAIN
Changes since 1.97: +10 -1 lines
Diff to previous 1.97 (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.97 / (download) - annotate - [select for diffs], Tue Dec 15 00:23:38 2009 UTC (14 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.96: +2 -2 lines
Diff to previous 1.96 (colored)

Must aim better.

Revision 1.96 / (download) - annotate - [select for diffs], Mon Dec 14 19:56:55 2009 UTC (14 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.95: +3 -3 lines
Diff to previous 1.95 (colored)

Tweak the logic behind setting the fd limits so that smtpd is less likely
to get upset by custom soft/hard ulimit settings.

Suggested by todd@

Revision 1.95 / (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.94: +7 -1 lines
Diff to previous 1.94 (colored)

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

Revision 1.94 / (download) - annotate - [select for diffs], Fri Nov 13 11:27:51 2009 UTC (14 years, 6 months ago) by jacekm
Branch: MAIN
Changes since 1.93: +3 -3 lines
Diff to previous 1.93 (colored)

Log FQDN and IP of the server we handed mail to.  As a bonus, don't delay
logging of successful deliveries until all MXs were tried, plus add logging
of 5yz replies.

tested by todd@, "reads ok" gilles@

Revision 1.93 / (download) - annotate - [select for diffs], Tue Nov 10 14:46:18 2009 UTC (14 years, 7 months ago) by jacekm
Branch: MAIN
Changes since 1.92: +2 -1 lines
Diff to previous 1.92 (colored)

In relay case, avoid freeing garbage pointer by copying the required struct
from the temporary imsg buffer.

ok gilles@

Revision 1.92 / (download) - annotate - [select for diffs], Tue Nov 10 10:25:11 2009 UTC (14 years, 7 months ago) by jacekm
Branch: MAIN
Changes since 1.91: +3 -11 lines
Diff to previous 1.91 (colored)

move format expansion to the right place, from gilles@

Revision 1.91 / (download) - annotate - [select for diffs], Tue Nov 10 09:53:40 2009 UTC (14 years, 7 months ago) by jacekm
Branch: MAIN
Changes since 1.90: +2 -2 lines
Diff to previous 1.90 (colored)

sync code with comment, from gilles@

Revision 1.90 / (download) - annotate - [select for diffs], Tue Nov 10 01:09:24 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.89: +49 -49 lines
Diff to previous 1.89 (colored)

- add comments to explain the logic in the aliases expansion loop
- more cosmethic changes to help readability
- fix memory leaks
- if deliverylist is empty, it means something went bad during expansion,
  reject recipient

Revision 1.89 / (download) - annotate - [select for diffs], Tue Nov 10 00:42:55 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.88: +0 -9 lines
Diff to previous 1.88 (colored)

pfff remove a comment i pasted to help me refactor code ;-)

Revision 1.88 / (download) - annotate - [select for diffs], Tue Nov 10 00:36:29 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.87: +26 -49 lines
Diff to previous 1.87 (colored)

more cleanup, let lka_resolve_path() request forward files and populate
expandtree, this makes a lot of code clearer and removes quite a bit of
complexity from various places.

Revision 1.87 / (download) - annotate - [select for diffs], Tue Nov 10 00:21:46 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.86: +15 -15 lines
Diff to previous 1.86 (colored)

cosmethic changes, code reordering, no functionnal change

Revision 1.86 / (download) - annotate - [select for diffs], Tue Nov 10 00:13:33 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.85: +14 -13 lines
Diff to previous 1.85 (colored)

introduce lka_session_fail() which factors a small piece of code used in
three places: set code to 530, send imsg to notify rejection, kill
lkasession

Revision 1.85 / (download) - annotate - [select for diffs], Mon Nov 9 23:49:34 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.84: +23 -20 lines
Diff to previous 1.84 (colored)

- add a reference count and flags to struct expand_node
- during expansion, no longer create a new node for each result but try to
  lookup for an existing equivalent node and increment its reference count
  so that: a) we save on memory, b) we don't need to expand the same users
  again and again just because they keep appearing in expansion results.
- while expanding, flag nodes as F_EXPAND_DONE so that we know which nodes
  we already processed
- be smarter when expanding, if we have a clue that an iteration has not
  brought any new result (because no new nodes were added and all existing
  nodes have F_EXPAND_DONE), end expansion and proceed to delivery.
- various small cleanups

discussed with jacekm@ yesterday, rebuild aliases db, make clean

Revision 1.84 / (download) - annotate - [select for diffs], Mon Nov 9 22:28:08 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.83: +6 -1 lines
Diff to previous 1.83 (colored)

support the userpart+foobar@domainpart syntax which got wiped when i wrote
the virtual domains support as it was in my way. this time, make it work as
it should: userpart+foobar@domainpart becomes:

path->user = userpart+foobar
path->domain = domainpart
path->pw_name = userpart

discussed quickly with jacekm@

Revision 1.83 / (download) - annotate - [select for diffs], Sun Nov 8 23:08:56 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.82: +58 -51 lines
Diff to previous 1.82 (colored)

rework a bit expansion and data structures involved in the expansion so we
no longer have a direct mapping between structures saved in aliases/virtual
db and structures used at runtime during expansion.

side effects ? struct alias is smaller, databases are smaller and it is no
longer necessary to rebuild aliases/virtual databases each time jacekm@ or
I make changes to some obscure structure used indirectely during expansion

rebuild databases, flush queues, make clean

Revision 1.82 / (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.81: +17 -18 lines
Diff to previous 1.81 (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.81 / (download) - annotate - [select for diffs], Sun Nov 8 19:38:26 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.80: +138 -122 lines
Diff to previous 1.80 (colored)

first commit of a serie to cleanup, simplify and improve aliases resolution
which is probably the most complex code in smtpd right now. no longer use a
single list to hold aliases to be resolved and resolved aliases, and do not
use struct alias to hold resolved aliases. instead use a delivery list that
is a list of struct path, and populate it with resolved aliases.

idea discussed with jacekm@, this needs some testing to make sure it does
not introduce a regression with aliases. flush your queue and make clean.

Revision 1.80 / (download) - annotate - [select for diffs], Thu Nov 5 12:26:19 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.79: +3 -2 lines
Diff to previous 1.79 (colored)

another log_debug() cleanup

Revision 1.79 / (download) - annotate - [select for diffs], Thu Nov 5 12:06:41 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.78: +14 -10 lines
Diff to previous 1.78 (colored)

cleanup a bit the log_debug output

Revision 1.78 / (download) - annotate - [select for diffs], Thu Nov 5 12:02:22 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.77: +12 -3 lines
Diff to previous 1.77 (colored)

- introduce lka_session_destroy() which replaces the splay tree removal and
  free(lkasession) in lka_expand_rcpt()
- while at it, plug a very very unlikely memory leak which i spotted while
  reviewing the logic

Revision 1.77 / (download) - annotate - [select for diffs], Thu Nov 5 10:27:24 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.76: +9 -15 lines
Diff to previous 1.76 (colored)

- move a couple prototypes in smtpd.h
- remove prototypes from deprecated functions

Revision 1.76 / (download) - annotate - [select for diffs], Tue Nov 3 22:57:41 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.75: +19 -8 lines
Diff to previous 1.75 (colored)

teach makemap how to build a set, which is a map containing only keys.
smtpd is now capable of looking primary domains at runtime in a set, which
means that the following becomes possible:

	map "primary" { source db "/etc/mail/primary.db" }
	accept for domain map "primary" deliver to mbox

while at it fix a couple bugs in the aliases resolution path which caused
recipients to bounce if a ruleset did not have an "accept for local" rule

"diff reads good" jacekm@, flush queue & make clean

Revision 1.75 / (download) - annotate - [select for diffs], Tue Nov 3 20:55:23 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.74: +31 -11 lines
Diff to previous 1.74 (colored)

this commit removes the hardcoded special "aliases" map and brings support
for multiple aliases maps that can be attached at the rule level. with it,
you can for example define different aliases maps for different domains or
different aliases maps for the same domain depending on the client source:

map "localiases" { source db "/etc/mail/localiases.db" }
map "netaliases" { source db "/etc/mail/netaliases.db" }

accept from 192.168.0.0/16 for local alias "localiases" deliver to mbox
accept from all for local alias "netaliases" deliver to mbox

idea discussed with jacekm@ and various other hackers, diff contains some
bug fixes too which were not part of the original diff. man page follows
very shortly ... make clean & flush queue !

Revision 1.74 / (download) - annotate - [select for diffs], Tue Nov 3 19:13:34 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.73: +5 -4 lines
Diff to previous 1.73 (colored)

- remove a useless member of struct cond
- have virtual related functions take a map id instead of a map
- shrink a tiny bit ruleset matching
- add missing lka_resolve_path() call in aliases resolution leading to
  issues spotted by nicm@

Revision 1.73 / (download) - annotate - [select for diffs], Tue Nov 3 10:56:51 2009 UTC (14 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.72: +1 -4 lines
Diff to previous 1.72 (colored)

Don't need regex.h and remove two declarations that are now in smtpd.h.

ok jacekm

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

fix the aliases resolution path so that smtpd does not accidentally skip
recipients when an alias resolves to more than one.

issue spotted by martijn@bunix.org

Revision 1.71 / (download) - annotate - [select for diffs], Mon Oct 19 20:48:13 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.70: +13 -13 lines
Diff to previous 1.70 (colored)

currently, smtpd is capable of having multiple listeners with different
options but they will all share the same ruleset. this means that there
is no way to have a rule apply to a session established on one listener
but not applied on another.

this commit brings initial support for tagging listeners and having the
rules able to match these specific listeners. The following will define
a rule which will only apply to interfaces tagged as "mynet":

listen on lo0			# implicit lo0 tag
listen on fxp0 tag mynet
listen on fxp1 tag mynet

accept on mynet for domain "example.org" deliver to mbox

Revision 1.70 / (download) - annotate - [select for diffs], Sun Oct 18 21:45:47 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.69: +7 -4 lines
Diff to previous 1.69 (colored)

actually, we want to resolve C_ALL and C_NET, we just don't want to do it
when their action is to be relayed.

Revision 1.69 / (download) - annotate - [select for diffs], Sun Oct 18 19:53:49 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.68: +4 -3 lines
Diff to previous 1.68 (colored)

do not attempt to resolve aliases for C_ALL and C_NET destinations

Revision 1.68 / (download) - annotate - [select for diffs], Fri Oct 16 22:26:27 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.67: +3 -1 lines
Diff to previous 1.67 (colored)

as of now, "accept for all deliver to mbox" is a valid syntax, sadly lka is
not aware of this and will fatal() when it attempts to resolve a recipient
for a destination that's not C_DOM or C_VDOM.

issue reported by Dorian Buettner <dorian.buettner@gmx.de>

Revision 1.67 / (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.66: +89 -107 lines
Diff to previous 1.66 (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.66 / (download) - annotate - [select for diffs], Sun Oct 11 17:40:49 2009 UTC (14 years, 8 months ago) by gilles
Branch: MAIN
Changes since 1.65: +34 -23 lines
Diff to previous 1.65 (colored)

implement proper virtual domains instead of faking them on top of primary
domains. this means that:

- virtual domains no longer deliver to a local user when not told to
- they no longer attempt to resolve aliases when not told to
- they no longer need an explicit rule in smtpd.conf for EACH domain
- the "virtual" map is no longer hardcoded
- smtpd no longer needs a restart to support a new domain

instead we introduce the: accept for virtual map "mapname" [...] syntax
which refers to a map that can be manipulated at runtime.

idea discussed and okayd with jacekm@

Revision 1.65 / (download) - annotate - [select for diffs], Wed Oct 7 18:09:12 2009 UTC (14 years, 8 months ago) by gilles
Branch: MAIN
Changes since 1.64: +20 -1 lines
Diff to previous 1.64 (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.64 / (download) - annotate - [select for diffs], Wed Oct 7 17:30:41 2009 UTC (14 years, 8 months ago) by gilles
Branch: MAIN
Changes since 1.63: +1 -50 lines
Diff to previous 1.63 (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.63 / (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.62: +7 -7 lines
Diff to previous 1.62 (colored)

imsg_get sets errno so use fatal instead of fatalx.

Revision 1.62 / (download) - annotate - [select for diffs], Sat Aug 8 00:02:22 2009 UTC (14 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

import some changes from portable smtpd to reduce the delta between both.
this commit contains mostly missing casts and cosmethic changes, do not
expect to build this anywhere but on OpenBSD, it does not contain any of
the portable glue.

Revision 1.61 / (download) - annotate - [select for diffs], Fri Aug 7 20:21:48 2009 UTC (14 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.60: +3 -4 lines
Diff to previous 1.60 (colored)

we were linking to libkeynote to use kn_base64_encode/decode, but honestly
this was a ugly hack, and i'd rather include resolv.h and use __b64_encode
and __b64_decode as openssh does. this commit kills all references to
libkeynote in smtpd, should help a bit with porting ... no functionnal
change.

Revision 1.60 / (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.59: +2 -2 lines
Diff to previous 1.59 (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.59 / (download) - annotate - [select for diffs], Sat Jun 6 04:14:21 2009 UTC (15 years ago) by pyr
Branch: MAIN
Changes since 1.58: +48 -36 lines
Diff to previous 1.58 (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.58 / (download) - annotate - [select for diffs], Fri Jun 5 20:43:57 2009 UTC (15 years ago) by pyr
Branch: MAIN
Changes since 1.57: +17 -17 lines
Diff to previous 1.57 (colored)

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

Revision 1.57 / (download) - annotate - [select for diffs], Wed Jun 3 16:31:55 2009 UTC (15 years ago) by jacekm
Branch: MAIN
Changes since 1.56: +26 -24 lines
Diff to previous 1.56 (colored)

Improve error checking for the secrets encoding function; ok gilles@
Pointed out by giovanni <qgiovanni@gmail.com>

Revision 1.56 / (download) - annotate - [select for diffs], Mon Jun 1 23:15:48 2009 UTC (15 years ago) by gilles
Branch: MAIN
Changes since 1.55: +6 -40 lines
Diff to previous 1.55 (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.55 / (download) - annotate - [select for diffs], Mon Jun 1 22:51:47 2009 UTC (15 years ago) by gilles
Branch: MAIN
Changes since 1.54: +31 -64 lines
Diff to previous 1.54 (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.54 / (download) - annotate - [select for diffs], Mon Jun 1 21:19:15 2009 UTC (15 years ago) by gilles
Branch: MAIN
Changes since 1.53: +4 -2 lines
Diff to previous 1.53 (colored)

propagate the recipient domain through aliases expansion, this fixes a bug
that would trigger when smtpd.conf does not have an "accept for local" rule
and we attempt to deliver to a domain for which we are a destination.

spotted by jacekm@, fix by me and ok jacekm@

Revision 1.53 / (download) - annotate - [select for diffs], Mon Jun 1 18:24:01 2009 UTC (15 years ago) by deraadt
Branch: MAIN
Changes since 1.52: +5 -5 lines
Diff to previous 1.52 (colored)

No need for save_getpwuid and such functions which call endpwent.
endpwent is not needed unless setpwent (with stayopen = 1) or getpwent
was used.  getpwuid/getpwnam do not use getpwent; i think people must
be assuming this.  we are going to improve the man pages for this.
ok gilles

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

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

Revision 1.51 / (download) - annotate - [select for diffs], Sun May 24 14:38:56 2009 UTC (15 years ago) by jacekm
Branch: MAIN
Changes since 1.50: +2 -2 lines
Diff to previous 1.50 (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.50 / (download) - annotate - [select for diffs], Wed May 20 16:07:26 2009 UTC (15 years ago) by gilles
Branch: MAIN
Changes since 1.49: +40 -1 lines
Diff to previous 1.49 (colored)

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

Revision 1.49 / (download) - annotate - [select for diffs], Wed May 20 14:36:55 2009 UTC (15 years ago) by gilles
Branch: MAIN
Changes since 1.48: +6 -4 lines
Diff to previous 1.48 (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.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: +82 -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: +23 -11 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], Thu May 14 15:05:12 2009 UTC (15 years ago) by eric
Branch: MAIN
Changes since 1.45: +3 -3 lines
Diff to previous 1.45 (colored)

use the nitems() macro where appropriate

ok gilles@, jacekm@

Revision 1.45 / (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.44: +34 -192 lines
Diff to previous 1.44 (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.44 / (download) - annotate - [select for diffs], Fri May 1 21:44:19 2009 UTC (15 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

initialize secret to NULL otherwise we may try to free a junk pointer when
F_AUTH is not set. i was going to look into the issue, but i have received
a diff from Simon Betrang <janus@errornet.de>, thanks !

Revision 1.43 / (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.42: +9 -9 lines
Diff to previous 1.42 (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.42 / (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.41: +31 -25 lines
Diff to previous 1.41 (colored)

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

Revision 1.41 / (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.40: +7 -7 lines
Diff to previous 1.40 (colored)

correct some fatal(x) calls and error strings

ok gilles@ jacekm@

Revision 1.40 / (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.39: +5 -5 lines
Diff to previous 1.39 (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.39 / (download) - annotate - [select for diffs], Sun Apr 5 16:33:12 2009 UTC (15 years, 2 months ago) by gilles
Branch: MAIN
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

log_warn -> log_warnx

Revision 1.38 / (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.37: +14 -14 lines
Diff to previous 1.37 (colored)

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

Revision 1.37 / (download) - annotate - [select for diffs], Sun Mar 22 22:53:47 2009 UTC (15 years, 2 months ago) by gilles
Branch: MAIN
Changes since 1.36: +45 -14 lines
Diff to previous 1.36 (colored)

fix a bug in the resolution of forward files which would cause usernames
not to be taken into account if they had no ~/.forward file AND were the
result of an alias expansion that expanded to more than one username.

while at it, I spotted another bug where I would check T_MDA_MESSAGE on
the flags field instead of the type field. the bug could cause two MDA
message to end up in the same batch which is no longer valid.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Mar 20 09:34:34 2009 UTC (15 years, 2 months ago) by gilles
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

initialize variable before using it as a counter in a loop

spotted and fix by Matthew Haub <matthew.haub@alumni.adelaide.edu.au>

Revision 1.35 / (download) - annotate - [select for diffs], Wed Mar 11 11:11:08 2009 UTC (15 years, 3 months ago) by pea
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

getmxbyname() returning a value != 0 does not necessarily means it failed

ok gilles@

Revision 1.34 / (download) - annotate - [select for diffs], Mon Mar 9 16:31:09 2009 UTC (15 years, 3 months ago) by jacekm
Branch: MAIN
Changes since 1.33: +1 -2 lines
Diff to previous 1.33 (colored)

Drop ALIAS_TEXT, plain maps got implemented in a different way; ok gilles@

Revision 1.33 / (download) - annotate - [select for diffs], Mon Mar 9 01:43:19 2009 UTC (15 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.32: +249 -90 lines
Diff to previous 1.32 (colored)

add basic support for outgoing authentication (AUTH PLAIN over ssl) which
can be turned on by adding "enable auth" to a "relay via" rule. this made
me rework the mx resolution so that it is done by the mta process and not
the runner process anymore.

Revision 1.32 / (download) - annotate - [select for diffs], Sun Mar 8 17:54:20 2009 UTC (15 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.31: +78 -122 lines
Diff to previous 1.31 (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.31 / (download) - annotate - [select for diffs], Wed Mar 4 00:00:40 2009 UTC (15 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.30: +41 -58 lines
Diff to previous 1.30 (colored)

plug a memory leak, remove lka session from the the lka session tree when
we are done expanding aliases/forwards, and cleanup a bit the expansion
code so that I can soon remove some of the duplication.

Revision 1.30 / (download) - annotate - [select for diffs], Tue Mar 3 23:33:52 2009 UTC (15 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.29: +20 -5 lines
Diff to previous 1.29 (colored)

when forwards/aliases expansion fails in an lka session, make sure that mfa
is notified so that the session does not hang

Revision 1.29 / (download) - annotate - [select for diffs], Tue Mar 3 23:23:52 2009 UTC (15 years, 3 months ago) by gilles
Branch: MAIN
Changes since 1.28: +232 -84 lines
Diff to previous 1.28 (colored)

Fix a long standing issue where ~/.forward files were opened by user _smtpd
causing them not to be handled when a user's homedir is set to mode 0700. I
still need to do some cleanup and make sure it works as it should, but this
diff provides better behavior than what we had.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Feb 24 21:40:51 2009 UTC (15 years, 3 months ago) by jacekm
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.27: +1 -2 lines
Diff to previous 1.27 (colored)

fix tilde expansion (eg. ~/Mail); ok gilles@

Revision 1.27 / (download) - annotate - [select for diffs], Sun Feb 22 23:21:40 2009 UTC (15 years, 3 months ago) by jacekm
Branch: MAIN
Changes since 1.26: +55 -52 lines
Diff to previous 1.26 (colored)

reorganize code so that couple of indentation levels can be removed;
ok gilles@

Revision 1.26 / (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.25: +2 -1 lines
Diff to previous 1.25 (colored)

add missing headers

ok gilles@

Revision 1.25 / (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.24: +23 -16 lines
Diff to previous 1.24 (colored)

replace MAX* constants by sizeof where possible

ok jacekm@

Revision 1.24 / (download) - annotate - [select for diffs], Wed Feb 18 12:06:01 2009 UTC (15 years, 3 months ago) by jacekm
Branch: MAIN
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored)

fix compiler warning; ok gilles@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Feb 17 22:15:01 2009 UTC (15 years, 3 months ago) by jacekm
Branch: MAIN
Changes since 1.22: +1 -35 lines
Diff to previous 1.22 (colored)

kill unused func lka_resolve_rcpt()

Revision 1.22 / (download) - annotate - [select for diffs], Sun Feb 15 13:12:19 2009 UTC (15 years, 3 months ago) by jacekm
Branch: MAIN
Changes since 1.21: +8 -3 lines
Diff to previous 1.21 (colored)

If MX query fails due to DNS error, do not attempt more queries; ok gilles@

Revision 1.21 / (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.20: +2 -1 lines
Diff to previous 1.20 (colored)

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

Revision 1.20 / (download) - annotate - [select for diffs], Fri Feb 13 23:54:37 2009 UTC (15 years, 3 months ago) by jacekm
Branch: MAIN
Changes since 1.19: +4 -4 lines
Diff to previous 1.19 (colored)

Fix a crash in lka caused by wrong assumption that we would never
exceed MXARRAYSIZE * 2 addresses.

Commited on behalf of gilles@ who hasn't got access to a safe box
at the moment.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Jan 28 17:43:45 2009 UTC (15 years, 4 months ago) by gilles
Branch: MAIN
Changes since 1.18: +5 -1 lines
Diff to previous 1.18 (colored)

relayhost flags were not properly copied to the relayhost array of the
batch we're handing over to mta. this prevented mta from knowing if a
session has to be established over ssl or not.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Jan 8 19:17:31 2009 UTC (15 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.17: +7 -7 lines
Diff to previous 1.17 (colored)

ensure getpwnam is always followed by endpwent; ok gilles@ henning@

Revision 1.17 / (download) - annotate - [select for diffs], Wed Jan 7 00:26:30 2009 UTC (15 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.16: +46 -2 lines
Diff to previous 1.16 (colored)

- when performing aliases expansion, do not forget to set an action to each
expanded envelope, orelse they will use the default action and be passed to
MTA no matter if recipient is local or not.
	bug reported by Nicholas Marriott <nicholas.marriott@gmail.com>,
	fixed by me and okayd by jacekm@, collaborative work ;-)

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jan 6 23:12:28 2009 UTC (15 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.15: +14 -3 lines
Diff to previous 1.15 (colored)

- do not perform a local user lookup, that includes alias expansion, when a
recipient is ... not a local recipient (bug introduced very recently).
	Fix by Nicholas Marriott <nicholas.marriott@gmail.com>

Revision 1.15 / (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.14: +2 -3 lines
Diff to previous 1.14 (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.14 / (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.13: +8 -7 lines
Diff to previous 1.13 (colored)

cleanup; ok gilles@

Revision 1.13 / (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.12: +156 -282 lines
Diff to previous 1.12 (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.12 / (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.11: +2 -7 lines
Diff to previous 1.11 (colored)

remove unnecessary includes; ok gilles@

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

typo

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

Reduce IMSG_LKA_HOST to only make NI_NAMEREQD getnameinfo call. We
don't need it to return NI_NUMERICHOST conversion because there's
no reason not to do it in smtp; ok gilles@

Revision 1.9 / (download) - annotate - [select for diffs], Mon Dec 22 12:59:15 2008 UTC (15 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.8: +2 -3 lines
Diff to previous 1.8 (colored)

delinting: salen may be used with no prior init; ok gilles@

Revision 1.8 / (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.7: +5 -1 lines
Diff to previous 1.7 (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.7 / (download) - annotate - [select for diffs], Sat Dec 13 23:19:33 2008 UTC (15 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.6: +25 -20 lines
Diff to previous 1.6 (colored)

IMSG_* namespace cleanup.

ok gilles@

Revision 1.6 / (download) - annotate - [select for diffs], Fri Dec 5 19:09:59 2008 UTC (15 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.5: +2 -3 lines
Diff to previous 1.5 (colored)

- more err/errx -> fatal/fatalx, warn/warnx -> log_warn/log_warnx
	contains bits based on an old diff from Jacek Masiulaniec and
	other bits from me.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Dec 5 02:51:32 2008 UTC (15 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.4: +52 -3 lines
Diff to previous 1.4 (colored)

- last part of the new queue code: the runner process (unprivileged and
	chrooted) is now in charge of doing the scheduling of deliveries,
	and the dispatching of messages to MDA and MTA. queue process only
	does inserts/updates/removals from the queue and can no longer be
	so busy that it delays answers to imsg from smtp server.

Revision 1.4 / (download) - annotate - [select for diffs], Tue Nov 25 20:26:40 2008 UTC (15 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.3: +14 -12 lines
Diff to previous 1.3 (colored)

- recent change in parse.y caused htons() to be called twice on the port
	provided to "relay via" rules, once in parse.y once in lka.c, fix.
- rename struct address to struct relayhost, introduce struct mxhost which
	not only holds the sockaddr_storage, but also additionnal flags we
	want forwarded to the mta process.
- propagate the change

Revision 1.3 / (download) - annotate - [select for diffs], Mon Nov 10 21:29:18 2008 UTC (15 years, 7 months ago) by chl
Branch: MAIN
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (colored)

rename h_errno field into getaddrinfo_error, to avoid confusion with errno.

h_errno has been obsoleted since the gethostbyname() --> getaddrinfo() replacement.

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.