OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.92 / (download) - annotate - [select for diffs], Thu Nov 16 10:23:21 2023 UTC (22 months, 3 weeks ago) by op
Branch: MAIN
CVS Tags: OPENBSD_7_8_BASE, OPENBSD_7_8, OPENBSD_7_7_BASE, OPENBSD_7_7, OPENBSD_7_6_BASE, OPENBSD_7_6, OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.91: +3 -2 lines
Diff to previous 1.91 (colored)

consider an MX of "localhost" as it were a "Null MX"

diff from Philipp (philipp+openbsd [at] bureaucracy [dot] de), thanks!

ok sthen@

Revision 1.91 / (download) - annotate - [select for diffs], Wed Nov 8 08:46:34 2023 UTC (23 months ago) by op
Branch: MAIN
Changes since 1.90: +18 -2 lines
Diff to previous 1.90 (colored)

RFC 7505 ("Null MX") handling

mail delivery will not be attempted if a domain advertises a single MX
record with preference 0 and a zero-length label.

based on an initial diff from Philipp (philipp+openbsd [at] bureaucracy
[dot] de), thanks!

ok jung@

Revision 1.90 / (download) - annotate - [select for diffs], Mon Jun 14 17:58:15 2021 UTC (4 years, 3 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.89: +1 -12 lines
Diff to previous 1.89 (colored)

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

ok jung@

Revision 1.89 / (download) - annotate - [select for diffs], Wed Sep 18 11:26:30 2019 UTC (6 years ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.88: +6 -1 lines
Diff to previous 1.88 (colored)

Implement server certificate validation in smtp(1).
Check certificate against MX name in smtpd(8) mta.

ok gilles@

Revision 1.88 / (download) - annotate - [select for diffs], Wed Sep 26 16:28:34 2018 UTC (7 years ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.87: +3 -2 lines
Diff to previous 1.87 (colored)

treat NOTIMP as NO_DATA in response to MX query: fallback to hostname lookup
instead of bouncing the mail.

ok gilles@

Revision 1.87 / (download) - annotate - [select for diffs], Wed Jul 25 16:00:48 2018 UTC (7 years, 2 months ago) by eric
Branch: MAIN
Changes since 1.86: +1 -27 lines
Diff to previous 1.86 (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.86 / (download) - annotate - [select for diffs], Thu May 31 21:06:12 2018 UTC (7 years, 4 months ago) by gilles
Branch: MAIN
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (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.85 / (download) - annotate - [select for diffs], Sat Jan 6 07:57:53 2018 UTC (7 years, 9 months ago) by sunil
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.84: +2 -344 lines
Diff to previous 1.84 (colored)

Move unpack functions into a seperate file.

Required for upcoming 'smtpctl spf walk'.
Ok eric@ gilles@ millert@

Revision 1.84 / (download) - annotate - [select for diffs], Wed May 31 04:50:55 2017 UTC (8 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (colored)

typo; from Edgar Pettijohn

Revision 1.83 / (download) - annotate - [select for diffs], Wed Oct 28 07:28:13 2015 UTC (9 years, 11 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.82: +15 -1 lines
Diff to previous 1.82 (colored)

dns_lookup_host() needs to remove brackets and IPv6: prefix when receiving
a text representation otherwise getaddrinfo_async() will choke

ok eric@

Revision 1.82 / (download) - annotate - [select for diffs], Sat Oct 17 13:30:47 2015 UTC (9 years, 11 months ago) by gilles
Branch: MAIN
Changes since 1.81: +1 -4 lines
Diff to previous 1.81 (colored)

remove unused variables

Revision 1.81 / (download) - annotate - [select for diffs], Tue Jan 20 17:37:54 2015 UTC (10 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.80: +3 -2 lines
Diff to previous 1.80 (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.80 / (download) - annotate - [select for diffs], Tue Jan 6 09:32:13 2015 UTC (10 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.79: +3 -3 lines
Diff to previous 1.79 (colored)

fix whitespace and indentation, by Kyle Milz

Revision 1.79 / (download) - annotate - [select for diffs], Wed Oct 8 07:23:39 2014 UTC (11 years ago) by eric
Branch: MAIN
Changes since 1.78: +2 -1 lines
Diff to previous 1.78 (colored)

restrict address lookups to configured address families.

ok gilles@

Revision 1.78 / (download) - annotate - [select for diffs], Sat Apr 19 12:26:15 2014 UTC (11 years, 5 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored)

(void) cast this strlcpy(), it cannot truncate

Revision 1.77 / (download) - annotate - [select for diffs], Sat Apr 19 11:41:49 2014 UTC (11 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.76: +3 -3 lines
Diff to previous 1.76 (colored)

these strlcpy can't truncate, the copy is from a buffer to a buffer of same
size and the first buffer handles the truncation already

Revision 1.76 / (download) - annotate - [select for diffs], Fri Apr 4 16:10:42 2014 UTC (11 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.75: +15 -51 lines
Diff to previous 1.75 (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.75 / (download) - annotate - [select for diffs], Thu Apr 3 11:32:02 2014 UTC (11 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.74: +5 -62 lines
Diff to previous 1.74 (colored)

use asr helpers after libevent update.

Revision 1.74 / (download) - annotate - [select for diffs], Wed Mar 26 18:14:22 2014 UTC (11 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.73: +3 -2 lines
Diff to previous 1.73 (colored)

asr API is now public

Revision 1.73 / (download) - annotate - [select for diffs], Tue Mar 25 19:50:17 2014 UTC (11 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.72: +25 -28 lines
Diff to previous 1.72 (colored)

update after asr API update

Revision 1.72 / (download) - annotate - [select for diffs], Tue Mar 25 09:01:11 2014 UTC (11 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.71: +360 -20 lines
Diff to previous 1.71 (colored)

Integrate necessary dns packet parsing helpers from asr.
They are not supposed to be exposed.

ok gilles@

Revision 1.71 / (download) - annotate - [select for diffs], Fri Mar 14 11:09:45 2014 UTC (11 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.70: +9 -9 lines
Diff to previous 1.70 (colored)

field rename

Revision 1.70 / (download) - annotate - [select for diffs], Thu Dec 26 17:25:32 2013 UTC (11 years, 9 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.69: +1 -1 lines
Diff to previous 1.69 (colored)

bcopy -> memmove
bzero -> memset

Revision 1.69 / (download) - annotate - [select for diffs], Mon Nov 18 11:55:41 2013 UTC (11 years, 10 months ago) by eric
Branch: MAIN
Changes since 1.68: +90 -1 lines
Diff to previous 1.68 (colored)

When looking up a MX, parse the address if the domain is a "[ipaddr]" string.

Revision 1.68 / (download) - annotate - [select for diffs], Sat Oct 26 12:27:59 2013 UTC (11 years, 11 months ago) by eric
Branch: MAIN
Changes since 1.67: +2 -2 lines
Diff to previous 1.67 (colored)

%i -> %d in format strings

Revision 1.67 / (download) - annotate - [select for diffs], Fri Jul 12 14:38:34 2013 UTC (12 years, 3 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.66: +10 -10 lines
Diff to previous 1.66 (colored)

update after asr changes.

Revision 1.66 / (download) - annotate - [select for diffs], Fri May 24 17:03:14 2013 UTC (12 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.65: +10 -10 lines
Diff to previous 1.65 (colored)

sync with OpenSMTPD 5.3.2

ok gilles@

Revision 1.65 / (download) - annotate - [select for diffs], Tue Apr 30 12:07:21 2013 UTC (12 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored)

remove params after API change.

Revision 1.64 / (download) - annotate - [select for diffs], Sat Jan 26 09:37:23 2013 UTC (12 years, 8 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.63: +252 -286 lines
Diff to previous 1.63 (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.63 / (download) - annotate - [select for diffs], Sat Nov 24 14:01:51 2012 UTC (12 years, 10 months ago) by eric
Branch: MAIN
Changes since 1.62: +3 -3 lines
Diff to previous 1.62 (colored)

fix after asr update

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

knf

ok gilles@

Revision 1.61 / (download) - annotate - [select for diffs], Mon Nov 12 14:58:53 2012 UTC (12 years, 10 months ago) by eric
Branch: MAIN
Changes since 1.60: +12 -12 lines
Diff to previous 1.60 (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.60 / (download) - annotate - [select for diffs], Mon Oct 8 08:46:24 2012 UTC (13 years ago) by eric
Branch: MAIN
Changes since 1.59: +7 -5 lines
Diff to previous 1.59 (colored)

skip RR if type is not MX.  Use hostname if the list of MX is empty
after the loop.

spotted by huku at grhack.net

ok gilles@

Revision 1.59 / (download) - annotate - [select for diffs], Wed Oct 3 21:44:35 2012 UTC (13 years ago) by gilles
Branch: MAIN
Changes since 1.58: +3 -2 lines
Diff to previous 1.58 (colored)

when requesting MX entries, the result can be appear in random orders.

the logic for inserting them in a lka session when acting as backup MX did
not take account for one specific case that could lead to an early exit
without smtpd getting a chance to detect the entry corrsponds to itself.

in such case, a backup MX woud try to connect to itself and bounce in the
loop detection code ... or it would sometimes work.

Revision 1.58 / (download) - annotate - [select for diffs], Thu Sep 27 17:47:49 2012 UTC (13 years ago) by chl
Branch: MAIN
Changes since 1.57: +2 -4 lines
Diff to previous 1.57 (colored)

use xmalloc()/xcalloc() helpers

while there unify usage of log_trace() in ramstat_set()

ok gilles@ eric@

Revision 1.57 / (download) - annotate - [select for diffs], Sat Aug 25 10:23:11 2012 UTC (13 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.56: +8 -8 lines
Diff to previous 1.56 (colored)

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

ok eric@, ok chl@

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

Revision 1.56 / (download) - annotate - [select for diffs], Tue Aug 21 20:19:46 2012 UTC (13 years, 1 month ago) by eric
Branch: MAIN
Changes since 1.55: +16 -4 lines
Diff to previous 1.55 (colored)

Allow smtpd to work as a backup MX, relaying only to MXs with higher
priority in the DNS record. For example:

   accept for domain "foo.org" relay backup "mx3.foo.org"

will relay mails for "foo.org" using only hosts with higher priority
(i.e. lower value) than "mx3.foo.org", which is supposed to be the
current server.

If the specified backup MX is not found in the DNS record, relaying
works as normal.

ok gilles@

Revision 1.55 / (download) - annotate - [select for diffs], Tue Aug 21 15:14:40 2012 UTC (13 years, 1 month ago) by eric
Branch: MAIN
Changes since 1.54: +44 -29 lines
Diff to previous 1.54 (colored)

Use TAILQ rather than array for mx list.

ok gilles@

Revision 1.54 / (download) - annotate - [select for diffs], Tue Aug 21 14:00:59 2012 UTC (13 years, 1 month ago) by eric
Branch: MAIN
Changes since 1.53: +1 -28 lines
Diff to previous 1.53 (colored)

dns sessions don't use lookup. no need to store them in a tree.

ok gilles@

Revision 1.53 / (download) - annotate - [select for diffs], Sun Aug 19 14:16:58 2012 UTC (13 years, 1 month ago) by chl
Branch: MAIN
Changes since 1.52: +6 -6 lines
Diff to previous 1.52 (colored)

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

ok eric@

Revision 1.52 / (download) - annotate - [select for diffs], Sat Aug 18 18:18:23 2012 UTC (13 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.51: +8 -8 lines
Diff to previous 1.51 (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.51 / (download) - annotate - [select for diffs], Wed Aug 8 17:31:55 2012 UTC (13 years, 2 months ago) by eric
Branch: MAIN
Changes since 1.50: +1 -2 lines
Diff to previous 1.50 (colored)

cleanup some old debug traces

ok gilles@ chl@

Revision 1.50 / (download) - annotate - [select for diffs], Sun Jul 29 17:33:55 2012 UTC (13 years, 2 months ago) by eric
Branch: MAIN
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

fix bogus permfail when no MX is defined on a valid domain.

ok gilles@

Revision 1.49 / (download) - annotate - [select for diffs], Mon Jul 9 12:16:24 2012 UTC (13 years, 3 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.48: +48 -67 lines
Diff to previous 1.48 (colored)

move to the new resolver implementation, with temporary glue to use
the relevant files from asr directly.

ok gilles@

Revision 1.48 / (download) - annotate - [select for diffs], Sat Apr 14 13:31:46 2012 UTC (13 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.47: +74 -75 lines
Diff to previous 1.47 (colored)

improve readability

ok gilles@

Revision 1.47 / (download) - annotate - [select for diffs], Wed Jan 11 21:22:26 2012 UTC (13 years, 9 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.46: +12 -1 lines
Diff to previous 1.46 (colored)

Try to parse hostnames as IP addresses before resolving.  This allows
relays to be given as IP address in the config file.

ok gilles@

Revision 1.46 / (download) - annotate - [select for diffs], Wed Jan 11 17:20:56 2012 UTC (13 years, 9 months ago) by eric
Branch: MAIN
Changes since 1.45: +29 -12 lines
Diff to previous 1.45 (colored)

Improve error reporting.  Most errors during hostname lookup are
now correctly reported as temporary failures.

from Nathanael Rensen, tweaks by me.

Revision 1.45 / (download) - annotate - [select for diffs], Thu Sep 1 19:56:49 2011 UTC (14 years, 1 month ago) by eric
Branch: MAIN
Changes since 1.44: +9 -13 lines
Diff to previous 1.44 (colored)

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

ok gilles@ chl@

Revision 1.44 / (download) - annotate - [select for diffs], Wed Jul 20 10:22:54 2011 UTC (14 years, 2 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.43: +31 -15 lines
Diff to previous 1.43 (colored)

Fix reporting of permanent/temporary failures for MX lookups.
Simplify code a bit while there.

ok gilles@

Revision 1.43 / (download) - annotate - [select for diffs], Sun Jul 3 17:48:40 2011 UTC (14 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.42: +3 -1 lines
Diff to previous 1.42 (colored)

imsg.h requires sys/queue.h and sys/uio.h.

ok eric

Revision 1.42 / (download) - annotate - [select for diffs], Fri May 6 19:21:43 2011 UTC (14 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.41: +29 -4 lines
Diff to previous 1.41 (colored)

move dns session specific structs and prototypes out of smtpd.h.

ok gilles@

Revision 1.41 / (download) - annotate - [select for diffs], Sun May 1 12:57:11 2011 UTC (14 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.40: +15 -16 lines
Diff to previous 1.40 (colored)

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

discussed with and ok gilles@

Revision 1.40 / (download) - annotate - [select for diffs], Sun Apr 17 13:36:07 2011 UTC (14 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.39: +17 -17 lines
Diff to previous 1.39 (colored)

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

Revision 1.39 / (download) - annotate - [select for diffs], Sat Apr 2 16:40:19 2011 UTC (14 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.38: +15 -1 lines
Diff to previous 1.38 (colored)

add stat counters for the lookup agent

ok gilles@

Revision 1.38 / (download) - annotate - [select for diffs], Thu Mar 31 10:40:59 2011 UTC (14 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.37: +97 -163 lines
Diff to previous 1.37 (colored)

cleanup and simplification following the asr update.

- use a specific dispatch function for each type of query
- make the host handler work on a list of hosts by default (single host
  queries are just a particular case) and use that to resolve the MX list
- various other code cleanup
- remove unused headers
- remove orphaned prototypes
- update copyright

ok gilles@

Revision 1.37 / (download) - annotate - [select for diffs], Tue Mar 29 20:43:51 2011 UTC (14 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.36: +40 -71 lines
Diff to previous 1.36 (colored)

remove unused code now that reverse lookups are done through asr.

ok gilles@

Revision 1.36 / (download) - annotate - [select for diffs], Tue Mar 29 08:14:12 2011 UTC (14 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.35: +34 -6 lines
Diff to previous 1.35 (colored)

make use the cname query interface from asr for reverse lookups

ok gilles@

Revision 1.35 / (download) - annotate - [select for diffs], Sun Mar 27 18:08:21 2011 UTC (14 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.34: +17 -13 lines
Diff to previous 1.34 (colored)

add a function to factorize resetting of dnssession events.

ok gilles@

Revision 1.34 / (download) - annotate - [select for diffs], Sat Mar 26 21:40:14 2011 UTC (14 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.33: +22 -36 lines
Diff to previous 1.33 (colored)

Fix the MX lookup process:

- the MX records were not always properly inserted into the sorted
  array, which led to some MX being silently dropped.
- if an MX address could not be resolved, mail delivery would fail,
  even though other valid MX exist for that domain. Now only report
  the failure if no server address can be found at all.

grrrreeat gilles@

Revision 1.33 / (download) - annotate - [select for diffs], Sat Mar 26 14:38:14 2011 UTC (14 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.32: +7 -19 lines
Diff to previous 1.32 (colored)

Tweak the asr API to make things a bit smoother on the user side.
Then asr_run() call now returns ASR_COND when a condition on a FD is
expected.  The exact condition (readable or writeable) is specified in
the asr_result structure, along with the fd and timeout.

ok gilles@

Revision 1.32 / (download) - annotate - [select for diffs], Sat Mar 26 10:54:22 2011 UTC (14 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.31: +6 -10 lines
Diff to previous 1.31 (colored)

use an index for iterating into the mx list.

ok gilles@

Revision 1.31 / (download) - annotate - [select for diffs], Wed Mar 23 20:38:56 2011 UTC (14 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.30: +3 -46 lines
Diff to previous 1.30 (colored)

Simplify resolver initialization. This is done only once
since resolv.conf reloading is handled automatically by asr.

ok gilles@

Revision 1.30 / (download) - annotate - [select for diffs], Wed Mar 9 00:35:42 2011 UTC (14 years, 7 months ago) by todd
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

make similar code .. more similar
ok gilles@

previous commit should have read:

when copying 'struct sockaddr' data, use sa_len not sizeof(struct sockaddr_in)
this fixes truncation of IPv6 addresses in the mail delivery path
ok gilles@

Revision 1.29 / (download) - annotate - [select for diffs], Wed Mar 9 00:34:01 2011 UTC (14 years, 7 months ago) by todd
Branch: MAIN
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

*** empty log message ***

Revision 1.28 / (download) - annotate - [select for diffs], Sun Dec 19 11:24:17 2010 UTC (14 years, 9 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.27: +13 -1 lines
Diff to previous 1.27 (colored)

If MX lookup fails, fallback to using the host itself. This has always been
the behavior but I introduced a regression when switching to ASR.

bug reported by jmc@, bugfix tested by jmc@ and I

Revision 1.27 / (download) - annotate - [select for diffs], Sun Dec 12 22:29:39 2010 UTC (14 years, 10 months ago) by jsg
Branch: MAIN
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

use memcpy instead of a cast/deref dance that was reading past
the end of the buffer.

tested by and ok gilles@

Revision 1.26 / (download) - annotate - [select for diffs], Mon Nov 29 15:25:55 2010 UTC (14 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.25: +333 -396 lines
Diff to previous 1.25 (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.25 / (download) - annotate - [select for diffs], Sun Nov 28 14:02:46 2010 UTC (14 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

remove unused headers

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

a bit of .h cleanups, no functionnal change

Revision 1.23 / (download) - annotate - [select for diffs], Wed Sep 8 13:32:13 2010 UTC (15 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.22: +19 -6 lines
Diff to previous 1.22 (colored)

we do dns resolutions in a separate process because we don't have an async
resolver. if we run scarce on resources and we cannot fork a separate dns
process or we cannot socketpair() tell the caller that we have a temporary
failure rather than issueing a fatal(). message will stay in queue and be
rescheduled later ...

bug reported and bugfix tested by Sacha El Masry <[email protected]>

Revision 1.22 / (download) - annotate - [select for diffs], Tue Jun 29 03:47:24 2010 UTC (15 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.21: +13 -10 lines
Diff to previous 1.21 (colored)

force the dns buffers to be aligned using a union, until the retarded
"misalign strings on the stack" bug in gcc4 is fixed (even when that
is fixed this idiom is safer and quite common)
ok jacekm

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

check event_dispatch() return value

ok jacekm@

Revision 1.20 / (download) - annotate - [select for diffs], Sat Nov 14 18:49:25 2009 UTC (15 years, 10 months ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.19: +2 -1 lines
Diff to previous 1.19 (colored)

add missing header needed by signal()

ok gilles@

Revision 1.19 / (download) - annotate - [select for diffs], Wed Nov 11 16:55:18 2009 UTC (15 years, 11 months ago) by jacekm
Branch: MAIN
Changes since 1.18: +17 -9 lines
Diff to previous 1.18 (colored)

Fix previous.  When configured to relay via IP address, MX lookup would fail
(NXDOMAIN), leading to a bounce.  Precede the MX lookup with an attempt to
parse the relay as numeric string.

"reads ok" gilles@

Revision 1.18 / (download) - annotate - [select for diffs], Thu Nov 5 12:11:53 2009 UTC (15 years, 11 months ago) by jsing
Branch: MAIN
Changes since 1.17: +2 -1 lines
Diff to previous 1.17 (colored)

Consider DNS lookups that result in NXDOMAIN to be a permanent failure.

ok gilles@ jacekm@

Revision 1.17 / (download) - annotate - [select for diffs], Thu Nov 5 12:05:47 2009 UTC (15 years, 11 months ago) by jsing
Branch: MAIN
Changes since 1.16: +0 -0 lines
Diff to previous 1.16 (colored)

Introduce a 6yz status code, used internally to report permanent errors.
The 1yz and 6yz status codes are now removed prior to reporting the status
message in bounce messages, which provides an easy way to distinguish
between local and remote status messages. Initial diff from jacekm@

ok gilles@ jacekm@

Revision 1.16 / (download) - annotate - [select for diffs], Thu Sep 3 08:19:13 2009 UTC (16 years, 1 month ago) by jacekm
Branch: MAIN
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

imsg_get sets errno so use fatal instead of fatalx.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Aug 8 00:02:22 2009 UTC (16 years, 2 months ago) by gilles
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (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.14 / (download) - annotate - [select for diffs], Sat Jun 6 04:14:21 2009 UTC (16 years, 4 months ago) by pyr
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.13: +47 -42 lines
Diff to previous 1.13 (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.13 / (download) - annotate - [select for diffs], Fri Jun 5 20:43:57 2009 UTC (16 years, 4 months ago) by pyr
Branch: MAIN
Changes since 1.12: +11 -11 lines
Diff to previous 1.12 (colored)

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

Revision 1.12 / (download) - annotate - [select for diffs], Mon Jun 1 13:20:56 2009 UTC (16 years, 4 months ago) by jacekm
Branch: MAIN
Changes since 1.11: +10 -17 lines
Diff to previous 1.11 (colored)

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

Revision 1.11 / (download) - annotate - [select for diffs], Sat May 9 17:04:55 2009 UTC (16 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.10: +450 -131 lines
Diff to previous 1.10 (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.10 / (download) - annotate - [select for diffs], Sun Feb 22 11:44:29 2009 UTC (16 years, 7 months ago) by form
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.9: +7 -4 lines
Diff to previous 1.9 (colored)

replace MAX* constants by sizeof where possible

ok jacekm@

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

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

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

Fix a bug where list of 6 MXs or more was not handled correctly.
Pointed out by & ok sthen@, ok gilles@.

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

remove unnecessary includes; ok gilles@

Revision 1.6 / (download) - annotate - [select for diffs], Fri Dec 5 19:09:59 2008 UTC (16 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.5: +3 -5 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], Mon Dec 1 22:54:08 2008 UTC (16 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

- in mxsort, fix type of loop counter, it will never be < 0 if it is
	unsigned and when running out of luck it will cause the lookup
	process to crash.

Revision 1.4 / (download) - annotate - [select for diffs], Tue Nov 25 23:03:24 2008 UTC (16 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.3: +1 -3 lines
Diff to previous 1.3 (colored)

- move prototype to smtpd.h

Revision 1.3 / (download) - annotate - [select for diffs], Mon Nov 10 03:54:08 2008 UTC (16 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.2: +8 -10 lines
Diff to previous 1.2 (colored)

insertion sort is faster than bubble sort.  ok gilles

Revision 1.2 / (download) - annotate - [select for diffs], Wed Nov 5 12:14:45 2008 UTC (16 years, 11 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 (16 years, 11 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.