OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.43 / (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_5_BASE, OPENBSD_7_5, 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, HEAD
Changes since 1.42: +2 -3 lines
Diff to previous 1.42 (colored)

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

ok jung@

Revision 1.42 / (download) - annotate - [select for diffs], Mon Jan 6 11:02:38 2020 UTC (4 years, 4 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.41: +6 -1 lines
Diff to previous 1.41 (colored)

provide a better error message for invalid smtpctl commands

Revision 1.41 / (download) - annotate - [select for diffs], Mon Jul 31 16:38:33 2017 UTC (6 years, 10 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.40: +1 -15 lines
Diff to previous 1.40 (colored)

cmd_dump() is unused

spotted by deraadt

Revision 1.40 / (download) - annotate - [select for diffs], Fri Jan 9 08:28:02 2015 UTC (9 years, 4 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, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.39: +15 -15 lines
Diff to previous 1.39 (colored)

rename a variable to avoid a warning

spotted by deraadt@

Revision 1.39 / (download) - annotate - [select for diffs], Tue Feb 4 15:22:39 2014 UTC (10 years, 3 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.38: +85 -0 lines
Diff to previous 1.38 (colored)

Allow the admin to pause relaying to a specific domain:
 - smtpctl pause mta from <source> for <domain>
 - smtpctl resume mta from <source> for <domain>
 - smtpctl show mta paused

Revision 1.38 / (download) - annotate - [select for diffs], Fri Dec 6 14:12:34 2013 UTC (10 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (colored)

fix smtpctl resume route

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

%i -> %d in format strings

Revision 1.36 / (download) - annotate - [select for diffs], Fri Oct 25 18:58:10 2013 UTC (10 years, 7 months ago) by eric
Branch: MAIN
Changes since 1.35: +1 -1 lines
Diff to previous 1.35 (colored)

Improve reporting in smtpctl and a few fixes.

When sending a request to the scheduler, wait for the success/failure
report from the scheduler.  Simplify the code by introducing generic
functions for interruptible iteration over envelopes.  Report the total
number of affected envelopes for schedule, pause, resume and remove
envelope operations.

Revision 1.35 / (download) - annotate - [select for diffs], Fri Jul 19 13:41:23 2013 UTC (10 years, 10 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.34: +199 -238 lines
Diff to previous 1.34 (colored)

New implementation for smtpctl and the command line parser.  Allows
richer syntax, and makes the code way simpler to follow and extend
with new commands.

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

sync with OpenSMTPD 5.3.2

ok gilles@

Revision 1.33 / (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.32: +3 -1 lines
Diff to previous 1.32 (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.32 / (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.31: +3 -1 lines
Diff to previous 1.31 (colored)

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

trace by me, logging by eric

Revision 1.31 / (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.30: +58 -10 lines
Diff to previous 1.30 (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.30 / (download) - annotate - [select for diffs], Fri Nov 23 10:55:25 2012 UTC (11 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.29: +19 -19 lines
Diff to previous 1.29 (colored)

knf

ok gilles@

Revision 1.29 / (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.28: +19 -4 lines
Diff to previous 1.28 (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.28 / (download) - annotate - [select for diffs], Wed Oct 10 19:39:11 2012 UTC (11 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.27: +15 -1 lines
Diff to previous 1.27 (colored)

teach smtpctl how to display envelopes and messages using their id.
this allows an admin to inspect the queue without having to manually
extract bucket and find the path to an envelope or message.

diff by Sunil Nimmagadda <sunil@poolp.org>

ok eric@, chl@ and I

Revision 1.27 / (download) - annotate - [select for diffs], Thu Aug 30 22:06:00 2012 UTC (11 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.26: +1 -2 lines
Diff to previous 1.26 (colored)

- rename show_envelope() to show_queue_envelope()
- remove SHOW_RUNQUEUE it was a noop since runqueues have been removed
  years ago from smtpd

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

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

ok eric@

Revision 1.25 / (download) - annotate - [select for diffs], Sun May 13 09:18:52 2012 UTC (12 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.24: +1 -2 lines
Diff to previous 1.24 (colored)

Remove sizes entry so it doesn't appear as a valid command in the
"smtpctl show" output, and use errx rather than err for the unknown
message error.

ok gilles

Revision 1.24 / (download) - annotate - [select for diffs], Thu Jan 12 18:06:18 2012 UTC (12 years, 4 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.23: +1 -2 lines
Diff to previous 1.23 (colored)

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

ok gilles@

Revision 1.23 / (download) - annotate - [select for diffs], Wed Oct 26 20:47:31 2011 UTC (12 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.22: +7 -7 lines
Diff to previous 1.22 (colored)

- fix smtpctl pause/resume so the ramqueue scheduling is done correctly
- rename IMSG and smtpctl pause/resume parameters
- update man page

tested by me, ok chl@, eric@

Revision 1.22 / (download) - annotate - [select for diffs], Sun Oct 23 17:12:41 2011 UTC (12 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.21: +6 -5 lines
Diff to previous 1.21 (colored)

- smtpctl schedule no longer works, instead, use 'smtpctl schedule-id <id>'
- introduce 'smtpctl schedule-all'

ok eric@

Revision 1.21 / (download) - annotate - [select for diffs], Tue Aug 16 19:12:40 2011 UTC (12 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.20: +2 -1 lines
Diff to previous 1.20 (colored)

smtpctl show sizes, displays the size of queue-related structures, useful
for developers to see the impact of structure changes on memory and disk
usage, and useful for users to better understand 'smtpctl show stats'

Revision 1.20 / (download) - annotate - [select for diffs], Thu Jul 21 23:29:24 2011 UTC (12 years, 10 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.19: +15 -1 lines
Diff to previous 1.19 (colored)

- update smtpctl.8 to reflect reality
- bring back 'smtpctl schedule' and 'smtpctl remove' to life

Things you should know:

The ramqueue data structure is not finished yet and lacks an envelope tree
for evpid lookups. I wanted to wait until I'm done but too many people are
affected by not being able to reschedule envelopes, this is a quick fix.

So right now there's an O(rrible) complexity as both commands will perform
a (possibly aborted) queue scan leading to O(n). I will make that O(log n)
soon.

Also, smtpctl remove no longer supports removing an entire message, I will
fix that very soon too.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Apr 13 20:53:18 2011 UTC (13 years, 1 month ago) by gilles
Branch: MAIN
Changes since 1.18: +1 -15 lines
Diff to previous 1.18 (colored)

following an idea from jacekm@, smtpd now uses a ram-queue instead of doing
a continuous walk on the disk-queue. the implementation differs from what
jacekm@ commited (and I backed out) a while ago in that it uses a queue and
a host tree required for upcoming features.

code will be improved in tree, it requires changes to be done in queue and
bounce API, I just wanted to commit a working version first ...

tested by todd@ and I

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

remove all unused headers

Revision 1.17 / (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.16: +2 -1 lines
Diff to previous 1.16 (colored)

a bit of .h cleanups, no functionnal change

Revision 1.16 / (download) - annotate - [select for diffs], Sat Oct 9 22:05:35 2010 UTC (13 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.15: +6 -13 lines
Diff to previous 1.15 (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.15 / (download) - annotate - [select for diffs], Sat Sep 4 21:31:04 2010 UTC (13 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.14: +13 -9 lines
Diff to previous 1.14 (colored)

move some things around to make intentions clear.  not really a functional
change.  ok claudio

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

new queue, again; gcc2 compile tested by deraadt

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

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

Revision 1.12 / (download) - annotate - [select for diffs], Mon May 31 23:38:56 2010 UTC (14 years ago) by jacekm
Branch: MAIN
Changes since 1.11: +11 -4 lines
Diff to previous 1.11 (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.11 / (download) - annotate - [select for diffs], Sun Jan 10 16:42:35 2010 UTC (14 years, 4 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.10: +8 -1 lines
Diff to previous 1.10 (colored)

- teach runner how to remove a message from queue given a message id/uid
	and assuming message is not in processing/scheduled state
- teach smtpctl how to request message removal from runner

discussed with todd@, idea ok jacekm@

Revision 1.10 / (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.9: +9 -1 lines
Diff to previous 1.9 (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.9 / (download) - annotate - [select for diffs], Sun Oct 25 19:46:31 2009 UTC (14 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

smtpctl reload is work in progress, do not expose it and make sure smtpd's
control process does not try to handle it.

spotted and reported by martijn@bunix.org

Revision 1.8 / (download) - annotate - [select for diffs], Sat Aug 8 00:16:49 2009 UTC (14 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.7: +2 -1 lines
Diff to previous 1.7 (colored)

missing header

Revision 1.7 / (download) - annotate - [select for diffs], Tue Feb 24 12:07:47 2009 UTC (15 years, 3 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.6: +23 -2 lines
Diff to previous 1.6 (colored)

teach smtpctl's parser how to deal with parameters that are not necessarily
a token so that it is possible to do: smtpctl schedule <message id/uid>

introduce F_MESSAGE_FORCESCHEDULE which lets the runner schedule a message
even if the retry delay has not been expired.

F_MESSAGE_ENQUEUED is a valid flag for a message and should not cause an\
errx() in smtpctl show queue

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

Implement "smtpctl show stats"; ok gilles@

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

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

Revision 1.4 / (download) - annotate - [select for diffs], Sun Jan 4 19:37:41 2009 UTC (15 years, 4 months ago) by gilles
Branch: MAIN
Changes since 1.3: +18 -2 lines
Diff to previous 1.3 (colored)

- runner is now capable of pausing/resuming the scheduling of deliveries
for both mda and mta batches.
- smtpctl can be used to disable/enable deliveries at runtime using the
pause/resume commands.

ok jacekm@

Revision 1.3 / (download) - annotate - [select for diffs], Sat Dec 27 16:45:01 2008 UTC (15 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.2: +8 -9 lines
Diff to previous 1.2 (colored)

Break showqueue and showrunqueue into 2 words; ok gilles@

Revision 1.2 / (download) - annotate - [select for diffs], Sat Dec 6 02:44:08 2008 UTC (15 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.1: +3 -1 lines
Diff to previous 1.1 (colored)

- teach smtpctl how to inspect queue and runqueue, it supports two commands
	`showqueue' which displays the content of the queue (all envelopes)
	`showrunqueue` which displays envelopes scheduled for delivery. The
	utility will be improved and extended, but for now we need at least
	this basic support to help debug queue-related issues.

	Output format is spamdb-alike:
	type|envelope uid|sender|recipient|last delivery date|retry count

	ok jacek@

Revision 1.1 / (download) - annotate - [select for diffs], Fri Dec 5 03:28:37 2008 UTC (15 years, 6 months ago) by gilles
Branch: MAIN

- smtpctl utility to control the smtpd, don't expect too much yet as it is
	just an empty clone of relayctl with the glue needed to have it
	exchange imsg with smtpd correctly. code mostly by pyr@, reviewed
	by chl@ and I a while ago.

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.