History log of /openbsd-current/usr.sbin/smtpd/table_static.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.35 14-May-2024 op

use C99 syntax for filling the table_backend structs; ok gilles@


Revision tags: OPENBSD_7_5_BASE
# 1.34 11-Feb-2024 op

unify smtpd and makemap table parser

These are supposed to parse the same file format but have subtle
difference in the handling of comments, continuation lines and escaping.

Converge both to the simpler smtpd parser which doesn't handle
continuation lines nor escaping, and support comments only at the start
of the line.

improvements and ok millert@


Revision tags: OPENBSD_7_0_BASE OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE OPENBSD_7_4_BASE
# 1.33 14-Jun-2021 eric

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

ok jung@


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.32 28-Dec-2018 eric

type static tables on the fly when the first element is added

ok gilles@


# 1.31 28-Dec-2018 eric

fix logging of list entries


# 1.30 28-Dec-2018 eric

use private data structure for managing static table content

ok gilles@


# 1.29 27-Dec-2018 eric

table_fetch() always expect a valid dst pointer.

ok gilles@


# 1.28 27-Dec-2018 eric

introduce dump() and add() table methods, only implemented for static tables.

ok gilles@


# 1.27 27-Dec-2018 eric

pass the table pointer to the lookup()/fecth() methods

ok gilles@


# 1.26 27-Dec-2018 eric

change the close() method to take the table pointer

ok gilles


# 1.25 27-Dec-2018 eric

Make the backend open method return an int to report success.
The implementation is responsible for setting the handle pointer
as needed.

ok gilles@


# 1.24 26-Dec-2018 eric

reorder parameters for consistency


# 1.23 26-Dec-2018 eric

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

ok gilles@


# 1.22 26-Dec-2018 eric

move the table backend name in the backend struct.
remove unused function.

ok gilles@


# 1.21 23-Dec-2018 eric

Simplify the table backend interface: lookup results are returned
as strings, and parsing is handled by the upper layer.

ok gilles@


# 1.20 01-Nov-2018 gilles

introduce K_REGEX table type and table_regex_match(), unused for now

ok eric@


Revision tags: OPENBSD_6_4_BASE
# 1.19 16-Jun-2018 gilles

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@


# 1.18 24-May-2018 gilles

switch smtpd to new grammar

ok eric@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.17 29-Aug-2017 eric

Change the table parser logic. If the table is untyped, determine
its type by examining the first entry: if it contains a separator, type
is "mapping", otherwise type is "list". All entries are then parsed
according to the table type. The "list" type can also be forced by using
the "@list" directive in a comment. This allows to define list of entries
containing a separator.

Also, log parse errors.

ok gilles@


# 1.16 14-Aug-2017 eric

remove useless indirection for reading the file content

ok gilles@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.15 22-Jan-2016 gilles

add a log_warn() so that when smtpd fails to start due to a problem reading
the configuration file of a table, user actually understands what happens

diff by Alexis Vachette, ok jung@


# 1.14 28-Dec-2015 jung

remove spaces after '!'

no binary change

ok millert


# 1.13 22-Dec-2015 sunil

Wrap long lines.

Ok gilles@ jung@


# 1.12 24-Nov-2015 gilles

teach table_db and table_static about mailaddr maps (unused yet)

ok sunil@, ok jung@


# 1.11 11-Oct-2015 sunil

Convert some fgetln to getline.

Ok gilles@, giovanni@, millert@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.10 20-Jan-2015 deraadt

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 tags: OPENBSD_5_6_BASE
# 1.9 08-Jul-2014 eric

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 tags: OPENBSD_5_5_BASE
# 1.8 28-Nov-2013 eric

unsigned char casts for ctype
ok gilles@


# 1.7 18-Nov-2013 eric

change dict_poproot() prototype: do not take key placeholder parameter as
it can't work that way.


# 1.6 28-Oct-2013 eric

alias files may be empty


Revision tags: OPENBSD_5_4_BASE
# 1.5 24-May-2013 eric

sync with OpenSMTPD 5.3.2

ok gilles@


# 1.4 12-Apr-2013 eric

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 tags: OPENBSD_5_3_BASE
# 1.3 13-Feb-2013 gilles

- when declaring a static table for userinfo, do not make username part of
the value as it confuses users
{ gilles => gilles:10:100:/home } becomes { gilles => 10:100:/home }

ok eric, we'll discuss changes under the hood post-release


# 1.2 05-Feb-2013 gilles

unbreak broken smtpctl table update

fix by eric and I, ok eric@


# 1.1 26-Jan-2013 gilles

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@


# 1.34 11-Feb-2024 op

unify smtpd and makemap table parser

These are supposed to parse the same file format but have subtle
difference in the handling of comments, continuation lines and escaping.

Converge both to the simpler smtpd parser which doesn't handle
continuation lines nor escaping, and support comments only at the start
of the line.

improvements and ok millert@


Revision tags: OPENBSD_7_0_BASE OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE OPENBSD_7_4_BASE
# 1.33 14-Jun-2021 eric

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

ok jung@


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.32 28-Dec-2018 eric

type static tables on the fly when the first element is added

ok gilles@


# 1.31 28-Dec-2018 eric

fix logging of list entries


# 1.30 28-Dec-2018 eric

use private data structure for managing static table content

ok gilles@


# 1.29 27-Dec-2018 eric

table_fetch() always expect a valid dst pointer.

ok gilles@


# 1.28 27-Dec-2018 eric

introduce dump() and add() table methods, only implemented for static tables.

ok gilles@


# 1.27 27-Dec-2018 eric

pass the table pointer to the lookup()/fecth() methods

ok gilles@


# 1.26 27-Dec-2018 eric

change the close() method to take the table pointer

ok gilles


# 1.25 27-Dec-2018 eric

Make the backend open method return an int to report success.
The implementation is responsible for setting the handle pointer
as needed.

ok gilles@


# 1.24 26-Dec-2018 eric

reorder parameters for consistency


# 1.23 26-Dec-2018 eric

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

ok gilles@


# 1.22 26-Dec-2018 eric

move the table backend name in the backend struct.
remove unused function.

ok gilles@


# 1.21 23-Dec-2018 eric

Simplify the table backend interface: lookup results are returned
as strings, and parsing is handled by the upper layer.

ok gilles@


# 1.20 01-Nov-2018 gilles

introduce K_REGEX table type and table_regex_match(), unused for now

ok eric@


Revision tags: OPENBSD_6_4_BASE
# 1.19 16-Jun-2018 gilles

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@


# 1.18 24-May-2018 gilles

switch smtpd to new grammar

ok eric@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.17 29-Aug-2017 eric

Change the table parser logic. If the table is untyped, determine
its type by examining the first entry: if it contains a separator, type
is "mapping", otherwise type is "list". All entries are then parsed
according to the table type. The "list" type can also be forced by using
the "@list" directive in a comment. This allows to define list of entries
containing a separator.

Also, log parse errors.

ok gilles@


# 1.16 14-Aug-2017 eric

remove useless indirection for reading the file content

ok gilles@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.15 22-Jan-2016 gilles

add a log_warn() so that when smtpd fails to start due to a problem reading
the configuration file of a table, user actually understands what happens

diff by Alexis Vachette, ok jung@


# 1.14 28-Dec-2015 jung

remove spaces after '!'

no binary change

ok millert


# 1.13 22-Dec-2015 sunil

Wrap long lines.

Ok gilles@ jung@


# 1.12 24-Nov-2015 gilles

teach table_db and table_static about mailaddr maps (unused yet)

ok sunil@, ok jung@


# 1.11 11-Oct-2015 sunil

Convert some fgetln to getline.

Ok gilles@, giovanni@, millert@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.10 20-Jan-2015 deraadt

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 tags: OPENBSD_5_6_BASE
# 1.9 08-Jul-2014 eric

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 tags: OPENBSD_5_5_BASE
# 1.8 28-Nov-2013 eric

unsigned char casts for ctype
ok gilles@


# 1.7 18-Nov-2013 eric

change dict_poproot() prototype: do not take key placeholder parameter as
it can't work that way.


# 1.6 28-Oct-2013 eric

alias files may be empty


Revision tags: OPENBSD_5_4_BASE
# 1.5 24-May-2013 eric

sync with OpenSMTPD 5.3.2

ok gilles@


# 1.4 12-Apr-2013 eric

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 tags: OPENBSD_5_3_BASE
# 1.3 13-Feb-2013 gilles

- when declaring a static table for userinfo, do not make username part of
the value as it confuses users
{ gilles => gilles:10:100:/home } becomes { gilles => 10:100:/home }

ok eric, we'll discuss changes under the hood post-release


# 1.2 05-Feb-2013 gilles

unbreak broken smtpctl table update

fix by eric and I, ok eric@


# 1.1 26-Jan-2013 gilles

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@


# 1.33 14-Jun-2021 eric

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

ok jung@


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.32 28-Dec-2018 eric

type static tables on the fly when the first element is added

ok gilles@


# 1.31 28-Dec-2018 eric

fix logging of list entries


# 1.30 28-Dec-2018 eric

use private data structure for managing static table content

ok gilles@


# 1.29 27-Dec-2018 eric

table_fetch() always expect a valid dst pointer.

ok gilles@


# 1.28 27-Dec-2018 eric

introduce dump() and add() table methods, only implemented for static tables.

ok gilles@


# 1.27 27-Dec-2018 eric

pass the table pointer to the lookup()/fecth() methods

ok gilles@


# 1.26 27-Dec-2018 eric

change the close() method to take the table pointer

ok gilles


# 1.25 27-Dec-2018 eric

Make the backend open method return an int to report success.
The implementation is responsible for setting the handle pointer
as needed.

ok gilles@


# 1.24 26-Dec-2018 eric

reorder parameters for consistency


# 1.23 26-Dec-2018 eric

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

ok gilles@


# 1.22 26-Dec-2018 eric

move the table backend name in the backend struct.
remove unused function.

ok gilles@


# 1.21 23-Dec-2018 eric

Simplify the table backend interface: lookup results are returned
as strings, and parsing is handled by the upper layer.

ok gilles@


# 1.20 01-Nov-2018 gilles

introduce K_REGEX table type and table_regex_match(), unused for now

ok eric@


Revision tags: OPENBSD_6_4_BASE
# 1.19 16-Jun-2018 gilles

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@


# 1.18 24-May-2018 gilles

switch smtpd to new grammar

ok eric@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.17 29-Aug-2017 eric

Change the table parser logic. If the table is untyped, determine
its type by examining the first entry: if it contains a separator, type
is "mapping", otherwise type is "list". All entries are then parsed
according to the table type. The "list" type can also be forced by using
the "@list" directive in a comment. This allows to define list of entries
containing a separator.

Also, log parse errors.

ok gilles@


# 1.16 14-Aug-2017 eric

remove useless indirection for reading the file content

ok gilles@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.15 22-Jan-2016 gilles

add a log_warn() so that when smtpd fails to start due to a problem reading
the configuration file of a table, user actually understands what happens

diff by Alexis Vachette, ok jung@


# 1.14 28-Dec-2015 jung

remove spaces after '!'

no binary change

ok millert


# 1.13 22-Dec-2015 sunil

Wrap long lines.

Ok gilles@ jung@


# 1.12 24-Nov-2015 gilles

teach table_db and table_static about mailaddr maps (unused yet)

ok sunil@, ok jung@


# 1.11 11-Oct-2015 sunil

Convert some fgetln to getline.

Ok gilles@, giovanni@, millert@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.10 20-Jan-2015 deraadt

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 tags: OPENBSD_5_6_BASE
# 1.9 08-Jul-2014 eric

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 tags: OPENBSD_5_5_BASE
# 1.8 28-Nov-2013 eric

unsigned char casts for ctype
ok gilles@


# 1.7 18-Nov-2013 eric

change dict_poproot() prototype: do not take key placeholder parameter as
it can't work that way.


# 1.6 28-Oct-2013 eric

alias files may be empty


Revision tags: OPENBSD_5_4_BASE
# 1.5 24-May-2013 eric

sync with OpenSMTPD 5.3.2

ok gilles@


# 1.4 12-Apr-2013 eric

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 tags: OPENBSD_5_3_BASE
# 1.3 13-Feb-2013 gilles

- when declaring a static table for userinfo, do not make username part of
the value as it confuses users
{ gilles => gilles:10:100:/home } becomes { gilles => 10:100:/home }

ok eric, we'll discuss changes under the hood post-release


# 1.2 05-Feb-2013 gilles

unbreak broken smtpctl table update

fix by eric and I, ok eric@


# 1.1 26-Jan-2013 gilles

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@


# 1.32 28-Dec-2018 eric

type static tables on the fly when the first element is added

ok gilles@


# 1.31 28-Dec-2018 eric

fix logging of list entries


# 1.30 28-Dec-2018 eric

use private data structure for managing static table content

ok gilles@


# 1.29 27-Dec-2018 eric

table_fetch() always expect a valid dst pointer.

ok gilles@


# 1.28 27-Dec-2018 eric

introduce dump() and add() table methods, only implemented for static tables.

ok gilles@


# 1.27 27-Dec-2018 eric

pass the table pointer to the lookup()/fecth() methods

ok gilles@


# 1.26 27-Dec-2018 eric

change the close() method to take the table pointer

ok gilles


# 1.25 27-Dec-2018 eric

Make the backend open method return an int to report success.
The implementation is responsible for setting the handle pointer
as needed.

ok gilles@


# 1.24 26-Dec-2018 eric

reorder parameters for consistency


# 1.23 26-Dec-2018 eric

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

ok gilles@


# 1.22 26-Dec-2018 eric

move the table backend name in the backend struct.
remove unused function.

ok gilles@


# 1.21 23-Dec-2018 eric

Simplify the table backend interface: lookup results are returned
as strings, and parsing is handled by the upper layer.

ok gilles@


# 1.20 01-Nov-2018 gilles

introduce K_REGEX table type and table_regex_match(), unused for now

ok eric@


Revision tags: OPENBSD_6_4_BASE
# 1.19 16-Jun-2018 gilles

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@


# 1.18 24-May-2018 gilles

switch smtpd to new grammar

ok eric@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.17 29-Aug-2017 eric

Change the table parser logic. If the table is untyped, determine
its type by examining the first entry: if it contains a separator, type
is "mapping", otherwise type is "list". All entries are then parsed
according to the table type. The "list" type can also be forced by using
the "@list" directive in a comment. This allows to define list of entries
containing a separator.

Also, log parse errors.

ok gilles@


# 1.16 14-Aug-2017 eric

remove useless indirection for reading the file content

ok gilles@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.15 22-Jan-2016 gilles

add a log_warn() so that when smtpd fails to start due to a problem reading
the configuration file of a table, user actually understands what happens

diff by Alexis Vachette, ok jung@


# 1.14 28-Dec-2015 jung

remove spaces after '!'

no binary change

ok millert


# 1.13 22-Dec-2015 sunil

Wrap long lines.

Ok gilles@ jung@


# 1.12 24-Nov-2015 gilles

teach table_db and table_static about mailaddr maps (unused yet)

ok sunil@, ok jung@


# 1.11 11-Oct-2015 sunil

Convert some fgetln to getline.

Ok gilles@, giovanni@, millert@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.10 20-Jan-2015 deraadt

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 tags: OPENBSD_5_6_BASE
# 1.9 08-Jul-2014 eric

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 tags: OPENBSD_5_5_BASE
# 1.8 28-Nov-2013 eric

unsigned char casts for ctype
ok gilles@


# 1.7 18-Nov-2013 eric

change dict_poproot() prototype: do not take key placeholder parameter as
it can't work that way.


# 1.6 28-Oct-2013 eric

alias files may be empty


Revision tags: OPENBSD_5_4_BASE
# 1.5 24-May-2013 eric

sync with OpenSMTPD 5.3.2

ok gilles@


# 1.4 12-Apr-2013 eric

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 tags: OPENBSD_5_3_BASE
# 1.3 13-Feb-2013 gilles

- when declaring a static table for userinfo, do not make username part of
the value as it confuses users
{ gilles => gilles:10:100:/home } becomes { gilles => 10:100:/home }

ok eric, we'll discuss changes under the hood post-release


# 1.2 05-Feb-2013 gilles

unbreak broken smtpctl table update

fix by eric and I, ok eric@


# 1.1 26-Jan-2013 gilles

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@


# 1.23 26-Dec-2018 eric

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

ok gilles@


# 1.22 26-Dec-2018 eric

move the table backend name in the backend struct.
remove unused function.

ok gilles@


# 1.21 23-Dec-2018 eric

Simplify the table backend interface: lookup results are returned
as strings, and parsing is handled by the upper layer.

ok gilles@


# 1.20 01-Nov-2018 gilles

introduce K_REGEX table type and table_regex_match(), unused for now

ok eric@


Revision tags: OPENBSD_6_4_BASE
# 1.19 16-Jun-2018 gilles

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@


# 1.18 24-May-2018 gilles

switch smtpd to new grammar

ok eric@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.17 29-Aug-2017 eric

Change the table parser logic. If the table is untyped, determine
its type by examining the first entry: if it contains a separator, type
is "mapping", otherwise type is "list". All entries are then parsed
according to the table type. The "list" type can also be forced by using
the "@list" directive in a comment. This allows to define list of entries
containing a separator.

Also, log parse errors.

ok gilles@


# 1.16 14-Aug-2017 eric

remove useless indirection for reading the file content

ok gilles@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.15 22-Jan-2016 gilles

add a log_warn() so that when smtpd fails to start due to a problem reading
the configuration file of a table, user actually understands what happens

diff by Alexis Vachette, ok jung@


# 1.14 28-Dec-2015 jung

remove spaces after '!'

no binary change

ok millert


# 1.13 22-Dec-2015 sunil

Wrap long lines.

Ok gilles@ jung@


# 1.12 24-Nov-2015 gilles

teach table_db and table_static about mailaddr maps (unused yet)

ok sunil@, ok jung@


# 1.11 11-Oct-2015 sunil

Convert some fgetln to getline.

Ok gilles@, giovanni@, millert@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.10 20-Jan-2015 deraadt

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 tags: OPENBSD_5_6_BASE
# 1.9 08-Jul-2014 eric

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 tags: OPENBSD_5_5_BASE
# 1.8 28-Nov-2013 eric

unsigned char casts for ctype
ok gilles@


# 1.7 18-Nov-2013 eric

change dict_poproot() prototype: do not take key placeholder parameter as
it can't work that way.


# 1.6 28-Oct-2013 eric

alias files may be empty


Revision tags: OPENBSD_5_4_BASE
# 1.5 24-May-2013 eric

sync with OpenSMTPD 5.3.2

ok gilles@


# 1.4 12-Apr-2013 eric

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 tags: OPENBSD_5_3_BASE
# 1.3 13-Feb-2013 gilles

- when declaring a static table for userinfo, do not make username part of
the value as it confuses users
{ gilles => gilles:10:100:/home } becomes { gilles => 10:100:/home }

ok eric, we'll discuss changes under the hood post-release


# 1.2 05-Feb-2013 gilles

unbreak broken smtpctl table update

fix by eric and I, ok eric@


# 1.1 26-Jan-2013 gilles

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@


# 1.21 23-Dec-2018 eric

Simplify the table backend interface: lookup results are returned
as strings, and parsing is handled by the upper layer.

ok gilles@


# 1.20 01-Nov-2018 gilles

introduce K_REGEX table type and table_regex_match(), unused for now

ok eric@


Revision tags: OPENBSD_6_4_BASE
# 1.19 16-Jun-2018 gilles

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@


# 1.18 24-May-2018 gilles

switch smtpd to new grammar

ok eric@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.17 29-Aug-2017 eric

Change the table parser logic. If the table is untyped, determine
its type by examining the first entry: if it contains a separator, type
is "mapping", otherwise type is "list". All entries are then parsed
according to the table type. The "list" type can also be forced by using
the "@list" directive in a comment. This allows to define list of entries
containing a separator.

Also, log parse errors.

ok gilles@


# 1.16 14-Aug-2017 eric

remove useless indirection for reading the file content

ok gilles@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.15 22-Jan-2016 gilles

add a log_warn() so that when smtpd fails to start due to a problem reading
the configuration file of a table, user actually understands what happens

diff by Alexis Vachette, ok jung@


# 1.14 28-Dec-2015 jung

remove spaces after '!'

no binary change

ok millert


# 1.13 22-Dec-2015 sunil

Wrap long lines.

Ok gilles@ jung@


# 1.12 24-Nov-2015 gilles

teach table_db and table_static about mailaddr maps (unused yet)

ok sunil@, ok jung@


# 1.11 11-Oct-2015 sunil

Convert some fgetln to getline.

Ok gilles@, giovanni@, millert@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.10 20-Jan-2015 deraadt

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 tags: OPENBSD_5_6_BASE
# 1.9 08-Jul-2014 eric

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 tags: OPENBSD_5_5_BASE
# 1.8 28-Nov-2013 eric

unsigned char casts for ctype
ok gilles@


# 1.7 18-Nov-2013 eric

change dict_poproot() prototype: do not take key placeholder parameter as
it can't work that way.


# 1.6 28-Oct-2013 eric

alias files may be empty


Revision tags: OPENBSD_5_4_BASE
# 1.5 24-May-2013 eric

sync with OpenSMTPD 5.3.2

ok gilles@


# 1.4 12-Apr-2013 eric

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 tags: OPENBSD_5_3_BASE
# 1.3 13-Feb-2013 gilles

- when declaring a static table for userinfo, do not make username part of
the value as it confuses users
{ gilles => gilles:10:100:/home } becomes { gilles => 10:100:/home }

ok eric, we'll discuss changes under the hood post-release


# 1.2 05-Feb-2013 gilles

unbreak broken smtpctl table update

fix by eric and I, ok eric@


# 1.1 26-Jan-2013 gilles

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@


# 1.20 01-Nov-2018 gilles

introduce K_REGEX table type and table_regex_match(), unused for now

ok eric@


Revision tags: OPENBSD_6_4_BASE
# 1.19 16-Jun-2018 gilles

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@


# 1.18 24-May-2018 gilles

switch smtpd to new grammar

ok eric@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.17 29-Aug-2017 eric

Change the table parser logic. If the table is untyped, determine
its type by examining the first entry: if it contains a separator, type
is "mapping", otherwise type is "list". All entries are then parsed
according to the table type. The "list" type can also be forced by using
the "@list" directive in a comment. This allows to define list of entries
containing a separator.

Also, log parse errors.

ok gilles@


# 1.16 14-Aug-2017 eric

remove useless indirection for reading the file content

ok gilles@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.15 22-Jan-2016 gilles

add a log_warn() so that when smtpd fails to start due to a problem reading
the configuration file of a table, user actually understands what happens

diff by Alexis Vachette, ok jung@


# 1.14 28-Dec-2015 jung

remove spaces after '!'

no binary change

ok millert


# 1.13 22-Dec-2015 sunil

Wrap long lines.

Ok gilles@ jung@


# 1.12 24-Nov-2015 gilles

teach table_db and table_static about mailaddr maps (unused yet)

ok sunil@, ok jung@


# 1.11 11-Oct-2015 sunil

Convert some fgetln to getline.

Ok gilles@, giovanni@, millert@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.10 20-Jan-2015 deraadt

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 tags: OPENBSD_5_6_BASE
# 1.9 08-Jul-2014 eric

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 tags: OPENBSD_5_5_BASE
# 1.8 28-Nov-2013 eric

unsigned char casts for ctype
ok gilles@


# 1.7 18-Nov-2013 eric

change dict_poproot() prototype: do not take key placeholder parameter as
it can't work that way.


# 1.6 28-Oct-2013 eric

alias files may be empty


Revision tags: OPENBSD_5_4_BASE
# 1.5 24-May-2013 eric

sync with OpenSMTPD 5.3.2

ok gilles@


# 1.4 12-Apr-2013 eric

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 tags: OPENBSD_5_3_BASE
# 1.3 13-Feb-2013 gilles

- when declaring a static table for userinfo, do not make username part of
the value as it confuses users
{ gilles => gilles:10:100:/home } becomes { gilles => 10:100:/home }

ok eric, we'll discuss changes under the hood post-release


# 1.2 05-Feb-2013 gilles

unbreak broken smtpctl table update

fix by eric and I, ok eric@


# 1.1 26-Jan-2013 gilles

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@


# 1.19 16-Jun-2018 gilles

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@


# 1.18 24-May-2018 gilles

switch smtpd to new grammar

ok eric@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.17 29-Aug-2017 eric

Change the table parser logic. If the table is untyped, determine
its type by examining the first entry: if it contains a separator, type
is "mapping", otherwise type is "list". All entries are then parsed
according to the table type. The "list" type can also be forced by using
the "@list" directive in a comment. This allows to define list of entries
containing a separator.

Also, log parse errors.

ok gilles@


# 1.16 14-Aug-2017 eric

remove useless indirection for reading the file content

ok gilles@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.15 22-Jan-2016 gilles

add a log_warn() so that when smtpd fails to start due to a problem reading
the configuration file of a table, user actually understands what happens

diff by Alexis Vachette, ok jung@


# 1.14 28-Dec-2015 jung

remove spaces after '!'

no binary change

ok millert


# 1.13 22-Dec-2015 sunil

Wrap long lines.

Ok gilles@ jung@


# 1.12 24-Nov-2015 gilles

teach table_db and table_static about mailaddr maps (unused yet)

ok sunil@, ok jung@


# 1.11 11-Oct-2015 sunil

Convert some fgetln to getline.

Ok gilles@, giovanni@, millert@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.10 20-Jan-2015 deraadt

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 tags: OPENBSD_5_6_BASE
# 1.9 08-Jul-2014 eric

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 tags: OPENBSD_5_5_BASE
# 1.8 28-Nov-2013 eric

unsigned char casts for ctype
ok gilles@


# 1.7 18-Nov-2013 eric

change dict_poproot() prototype: do not take key placeholder parameter as
it can't work that way.


# 1.6 28-Oct-2013 eric

alias files may be empty


Revision tags: OPENBSD_5_4_BASE
# 1.5 24-May-2013 eric

sync with OpenSMTPD 5.3.2

ok gilles@


# 1.4 12-Apr-2013 eric

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 tags: OPENBSD_5_3_BASE
# 1.3 13-Feb-2013 gilles

- when declaring a static table for userinfo, do not make username part of
the value as it confuses users
{ gilles => gilles:10:100:/home } becomes { gilles => 10:100:/home }

ok eric, we'll discuss changes under the hood post-release


# 1.2 05-Feb-2013 gilles

unbreak broken smtpctl table update

fix by eric and I, ok eric@


# 1.1 26-Jan-2013 gilles

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 tags: OPENBSD_6_2_BASE
# 1.17 29-Aug-2017 eric

Change the table parser logic. If the table is untyped, determine
its type by examining the first entry: if it contains a separator, type
is "mapping", otherwise type is "list". All entries are then parsed
according to the table type. The "list" type can also be forced by using
the "@list" directive in a comment. This allows to define list of entries
containing a separator.

Also, log parse errors.

ok gilles@


# 1.16 14-Aug-2017 eric

remove useless indirection for reading the file content

ok gilles@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.15 22-Jan-2016 gilles

add a log_warn() so that when smtpd fails to start due to a problem reading
the configuration file of a table, user actually understands what happens

diff by Alexis Vachette, ok jung@


# 1.14 28-Dec-2015 jung

remove spaces after '!'

no binary change

ok millert


# 1.13 22-Dec-2015 sunil

Wrap long lines.

Ok gilles@ jung@


# 1.12 24-Nov-2015 gilles

teach table_db and table_static about mailaddr maps (unused yet)

ok sunil@, ok jung@


# 1.11 11-Oct-2015 sunil

Convert some fgetln to getline.

Ok gilles@, giovanni@, millert@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.10 20-Jan-2015 deraadt

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 tags: OPENBSD_5_6_BASE
# 1.9 08-Jul-2014 eric

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 tags: OPENBSD_5_5_BASE
# 1.8 28-Nov-2013 eric

unsigned char casts for ctype
ok gilles@


# 1.7 18-Nov-2013 eric

change dict_poproot() prototype: do not take key placeholder parameter as
it can't work that way.


# 1.6 28-Oct-2013 eric

alias files may be empty


Revision tags: OPENBSD_5_4_BASE
# 1.5 24-May-2013 eric

sync with OpenSMTPD 5.3.2

ok gilles@


# 1.4 12-Apr-2013 eric

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 tags: OPENBSD_5_3_BASE
# 1.3 13-Feb-2013 gilles

- when declaring a static table for userinfo, do not make username part of
the value as it confuses users
{ gilles => gilles:10:100:/home } becomes { gilles => 10:100:/home }

ok eric, we'll discuss changes under the hood post-release


# 1.2 05-Feb-2013 gilles

unbreak broken smtpctl table update

fix by eric and I, ok eric@


# 1.1 26-Jan-2013 gilles

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@