OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.26, Wed Aug 30 16:52:00 2017 UTC (6 years, 9 months ago) by eric
Branch: MAIN
CVS Tags: HEAD
Changes since 1.25: +1 -1 lines
FILE REMOVED

unused file

Revision 1.25 / (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.24: +2 -2 lines
Diff to previous 1.24 (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.24 / (download) - annotate - [select for diffs], Wed Nov 30 11:52:48 2016 UTC (7 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.23: +13 -16 lines
Diff to previous 1.23 (colored)

make struct io opaque:

- move struct io definition to ioev.c
- replace io_init/io_clear with io_new/io_free
- allocate an iobuf for each new io internally
- use struct io pointer in the rest of the code
- remove remaining uses of iobuf_*

ok gilles@ sunil@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Nov 22 07:28:42 2016 UTC (7 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.22: +1 -2 lines
Diff to previous 1.22 (colored)

Normalize the io input buffer internally when reinstalling the io event, so
the caller doesn't have to bother with this.

ok gilles@ sunil@

Revision 1.22 / (download) - annotate - [select for diffs], Mon Nov 21 13:00:43 2016 UTC (7 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.21: +4 -4 lines
Diff to previous 1.21 (colored)

replace calls to iobuf_*() functions with the corresponding io_*() wrappers.

ok sunil@ gilles@

Revision 1.21 / (download) - annotate - [select for diffs], Sun Nov 20 08:43:36 2016 UTC (7 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.20: +5 -3 lines
Diff to previous 1.20 (colored)

add dedicated functions to set fd and callback on a struct io.
simplify io_init() prototype.

ok sunil@ gilles@

Revision 1.20 / (download) - annotate - [select for diffs], Wed Nov 16 21:30:37 2016 UTC (7 years, 6 months ago) by eric
Branch: MAIN
Changes since 1.19: +4 -4 lines
Diff to previous 1.19 (colored)

pass the user pointer as parameter to the io callback instead of having
the user dereference the io structure.

ok millert@ gilles@

Revision 1.19 / (download) - annotate - [select for diffs], Wed Jun 29 06:46:06 2016 UTC (7 years, 11 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.18: +4 -3 lines
Diff to previous 1.18 (colored)

Explicitely enclose SMTP transactions between BEGIN and COMMIT/ROLLBACK
filter events. Bump filter API version.

ok gilles@ jung@

Revision 1.16.2.1 / (download) - annotate - [select for diffs], Mon May 16 19:29:13 2016 UTC (8 years ago) by gilles
Branch: OPENBSD_5_9
Changes since 1.16: +3 -1 lines
Diff to previous 1.16 (colored) next main 1.17 (colored)

fix logic in error code path of smtp state machine that can lead to invalid
state and result in fatal(), while at it plug file pointer leak.

errata 006

ok eric@, millert@

Revision 1.18 / (download) - annotate - [select for diffs], Mon May 16 19:25:05 2016 UTC (8 years ago) by gilles
Branch: MAIN
Changes since 1.17: +3 -1 lines
Diff to previous 1.17 (colored)

fix logic in error code path of smtp state machine that can lead to an
invalid state ending in fatal(), while at it plug a file pointer leak.

ok eric@, millert@

Revision 1.17 / (download) - annotate - [select for diffs], Fri Mar 25 15:06:58 2016 UTC (8 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

Nuke session_socket_blockmode() and session_socket_linger(). Use
the identical io_set_blocking() and io_set_linger().

Since both are always called to turn off blocking or lingering,
nuke the parameter and associated enum in favour of "just doing the
right thing".

While passing remove the unneeded last parameter to the remaining
fcntl(F_GETFL).

Finally, rename the functions to io_set_nonblocking() and
io_set_nolinger() for clarity.

No functional change.

Started with a sweep of fcntl() usage inspired by guenther@.

ok gilles@

Revision 1.16 / (download) - annotate - [select for diffs], Wed Feb 3 11:14:08 2016 UTC (8 years, 4 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE
Branch point for: OPENBSD_5_9
Changes since 1.15: +14 -25 lines
Diff to previous 1.15 (colored)

When a filter rejects a message content, report immediatly to the
smtp session. Simplify code while here.

ok gilles@ jung@

Revision 1.15 / (download) - annotate - [select for diffs], Fri Jan 29 12:43:38 2016 UTC (8 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.14: +1 -4 lines
Diff to previous 1.14 (colored)

remove unused field

Revision 1.14 / (download) - annotate - [select for diffs], Fri Jan 29 10:49:53 2016 UTC (8 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.13: +3 -11 lines
Diff to previous 1.13 (colored)

Simplify code: hasrun is confusing and useless.  There is no way
filter_drain_query() can be called when the ->current filter is
still running the query. Just make sure we move forward after
having received the response from the current filter.

ok gilles@

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jan 29 08:06:27 2016 UTC (8 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.12: +2 -29 lines
Diff to previous 1.12 (colored)

Remove the query queueing mechanism. It's useless since pipelining is
not supported anyway.

ok sunil@ gilles@

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jan 28 09:03:35 2016 UTC (8 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.11: +65 -117 lines
Diff to previous 1.11 (colored)

Simplify the query-chain code now that events are sent through a dedicated loop.

ok gilles@ jung@

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jan 27 08:36:35 2016 UTC (8 years, 4 months ago) by eric
Branch: MAIN
Changes since 1.10: +23 -4 lines
Diff to previous 1.10 (colored)

send events to filters in a simple loop, rather than using the
query-chaining machinery.

ok jung@ gilles@

Revision 1.10 / (download) - annotate - [select for diffs], Mon Dec 14 10:28:50 2015 UTC (8 years, 5 months ago) by sunil
Branch: MAIN
Changes since 1.9: +51 -38 lines
Diff to previous 1.9 (colored)

Wrap long lines and whitespace fixes.

Ok jung@ gilles@

Revision 1.9 / (download) - annotate - [select for diffs], Tue Nov 24 08:40:10 2015 UTC (8 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.8: +820 -209 lines
Diff to previous 1.8 (colored)

add filter.c plumbing, not linked to the build, not used yet

ok sunil@, ok jung@, ok eric@

Revision 1.8, Sat Jun 16 16:16:09 2012 UTC (11 years, 11 months ago) by chl
Branch: MAIN
Changes since 1.7: +1 -1 lines
FILE REMOVED

rename filter.c --> filter_api.c (to be consistent with upcoming changes)

prompted by and ok gilles@

Revision 1.7 / (download) - annotate - [select for diffs], Thu Jun 14 21:56:13 2012 UTC (11 years, 11 months ago) by gilles
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

- rename filter.h -> filter_api.h to be consistent with upcoming changes

Revision 1.6 / (download) - annotate - [select for diffs], Wed Jan 18 13:41:54 2012 UTC (12 years, 4 months ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.5: +83 -1 lines
Diff to previous 1.5 (colored)

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

ok gilles@ eric@

Revision 1.5 / (download) - annotate - [select for diffs], Mon Nov 28 22:13:27 2011 UTC (12 years, 6 months ago) by chl
Branch: MAIN
Changes since 1.4: +2 -4 lines
Diff to previous 1.4 (colored)

use STATUS_* filter codes, instead of -1/0/1 hard coded values

ok gilles@

Revision 1.4 / (download) - annotate - [select for diffs], Wed Nov 16 10:24:41 2011 UTC (12 years, 6 months ago) by chl
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

fix obvious variable substitution mistake
change code type back to int8_t

ok gilles@

Revision 1.3 / (download) - annotate - [select for diffs], Tue Nov 15 23:22:47 2011 UTC (12 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.2: +32 -21 lines
Diff to previous 1.2 (colored)

- change callback prototypes in filter.c to allow stricter checks
- introduce STATUS_WAITING, filters will reroute async DNS queries through
  LKA in a near future
- filter_api.c will contain our filter API (empty for now)
- Makefile to build libsmtpdfilter (not linked to the build,dev stuff only)

Revision 1.2 / (download) - annotate - [select for diffs], Wed Aug 31 18:56:30 2011 UTC (12 years, 9 months ago) by gilles
Branch: MAIN
Changes since 1.1: +12 -32 lines
Diff to previous 1.1 (colored)

add support for per-line DATA callbacks, this allows filters to take their
decisions *while* the message is being received by the client.

Revision 1.1 / (download) - annotate - [select for diffs], Sat Aug 27 22:32:41 2011 UTC (12 years, 9 months ago) by gilles
Branch: MAIN

initial support for a session-time filtering API

currently only HELO/EHLO, MAIL, RCPT are supported, however ... I have
voluntarily disabled filters at smtpd.conf level so people don't play with
it until the API has stabilized a bit

discussed with several people in private, no one opposed the feature

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.