diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-05-07 15:17:34 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-05-07 15:17:34 +0300 |
commit | 05a8bb0ca988f41f016420ffc7dde427e423c187 (patch) | |
tree | fff58297f073bec8148c2d5468a45d592eab0379 | |
parent | 9f8f65324491b4186f4fd3c2580a8e0b14a248d9 (diff) | |
download | mailfromd-05a8bb0ca988f41f016420ffc7dde427e423c187.tar.gz mailfromd-05a8bb0ca988f41f016420ffc7dde427e423c187.tar.bz2 |
Implement v6 negotiation on the server side.
* gacopyz/stagenames.c: New file.
* gacopyz/Makefile.am (libgacopyz_a_SOURCES): Add stagenames.c.
* gacopyz/gacopyz.c (gacopyz_context_loop): Free req_macros.
(gacopyz_addrcpt_par): rename to gacopyz_add_rcpt_par.
* gacopyz/gacopyz.h (SM_LM_VRS_MAJOR, SM_LM_VRS_MAJOR)
(SM_LM_VRS_PLVL, GACOPYZ_SM_MKVER): New macros.
(macro_index): Rename to gacopyz_stage. All uses updated.
(smfi_version): New proto.
(gacopyz_addrcpt_par): rename to gacopyz_add_rcpt_par.
(gacopyz_stage_name): New declaration.
(gacopyz_srv_get_required_macros): New proto.
(gacopyz_srv_set_version, gacopyz_srv_set_protocol)
(gacopyz_srv_set_actions): 2nd argument is unsigned long.
* gacopyz/server.c (struct gacopyz_srv): New member req_macros.
(gacopyz_srv_get_required_macros): New function.
(gacopyz_srv_destroy): Free req_macros.
(gacopyz_srv_negotiate): Read macros.
* mfd/gram.y (milter_state_name): Removed. Use gacopyz_stage_name instead.
* mtasim/mtasim.c: New options: --gacopyz-log, --milter-proto, --milter-acts.
* doc/mtasim.texi, doc/mailfromd.texi: Update.
-rw-r--r-- | doc/mailfromd.texi | 8 | ||||
-rw-r--r-- | doc/mtasim.texi | 33 | ||||
-rw-r--r-- | gacopyz/Makefile.am | 1 | ||||
-rw-r--r-- | gacopyz/context.c | 4 | ||||
-rw-r--r-- | gacopyz/gacopyz.c | 71 | ||||
-rw-r--r-- | gacopyz/gacopyz.h | 58 | ||||
-rw-r--r-- | gacopyz/gacopyz_priv.h | 4 | ||||
-rw-r--r-- | gacopyz/server.c | 121 | ||||
-rw-r--r-- | gacopyz/smfi.c | 17 | ||||
-rw-r--r-- | gacopyz/stagenames.c | 27 | ||||
-rw-r--r-- | mfd/engine.c | 4 | ||||
-rw-r--r-- | mfd/gram.y | 44 | ||||
-rw-r--r-- | mfd/mailfromd.h | 2 | ||||
-rw-r--r-- | mtasim/mtasim.c | 111 |
14 files changed, 383 insertions, 122 deletions
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi index 3f8f893b..fd270c1a 100644 --- a/doc/mailfromd.texi +++ b/doc/mailfromd.texi | |||
@@ -12292,12 +12292,13 @@ else but for debugging, as it terribly degrades performance! | |||
12292 | @item --stack-trace | 12292 | @item --stack-trace |
12293 | Add @acronym{MFL} stack trace information to runtime error output. | 12293 | Add @acronym{MFL} stack trace information to runtime error output. |
12294 | Overrides @code{#pragma option stack-trace}, which you are advised to | 12294 | Overrides @code{#pragma option stack-trace}, which you are advised to |
12295 | use instead (@pxref{pragma stack-trace}). @xref{tracing runtime | 12295 | use instead (@pxref{pragma stack-trace}). @xref{tracing runtime |
12296 | errors}, for more information on this feature. | 12296 | errors}, for more information on this feature. |
12297 | 12297 | ||
12298 | @anchor{gacopyz-log option} | ||
12298 | @opsummary{gacopyz-log} | 12299 | @opsummary{gacopyz-log} |
12299 | @item --gacopyz-log=@var{level} | 12300 | @item --gacopyz-log=@var{level} |
12300 | Set desired logging level for @command{gacopyz} library | 12301 | Set desired logging level for @command{gacopyz} library |
12301 | (@pxref{Gacopyz}). There are five logging levels. The following | 12302 | (@pxref{Gacopyz}). There are five logging levels. The following |
12302 | table lists them in order of decreasing priority: | 12303 | table lists them in order of decreasing priority: |
12303 | 12304 | ||
@@ -12323,26 +12324,29 @@ Apr 28 09:00:11 host mailfromd[9411]: finishing | |||
12323 | connection | 12324 | connection |
12324 | @end smallexample | 12325 | @end smallexample |
12325 | 12326 | ||
12326 | This level can be useful for debugging your scripts. | 12327 | This level can be useful for debugging your scripts. |
12327 | 12328 | ||
12328 | @item debug | 12329 | @item debug |
12329 | Log debugging information. This level prints huge amounts of | 12330 | Log debugging information. |
12331 | |||
12332 | @item proto | ||
12333 | Log Milter protocol interactions. This level prints huge amounts of | ||
12330 | information, in particular it displays dumps of each Milter packet | 12334 | information, in particular it displays dumps of each Milter packet |
12331 | sent and received. | 12335 | sent and received. |
12332 | 12336 | ||
12333 | @end table | 12337 | @end table |
12334 | 12338 | ||
12335 | Although it is possible to set these levels independently of each | 12339 | Although it is possible to set these levels independently of each |
12336 | other, it is seldom practical. Therefore, the option | 12340 | other, it is seldom practical. Therefore, the option |
12337 | @option{--gacopyz-log=@var{level}} enables all logging levels from | 12341 | @option{--gacopyz-log=@var{level}} enables all logging levels from |
12338 | @var{level} up. For example, @option{--gacopyz-log=warn} enables | 12342 | @var{level} up. For example, @option{--gacopyz-log=warn} enables |
12339 | log levels @samp{warn}, @samp{err} and @samp{fatal}. It is the | 12343 | log levels @samp{warn}, @samp{err} and @samp{fatal}. It is the |
12340 | default. If you need to trace each subprocess startup and shutdown, | 12344 | default. If you need to trace each subprocess startup and shutdown, |
12341 | set @option{--gacopyz-log=info}. Setting the logging level to | 12345 | set @option{--gacopyz-log=info}. Setting the logging level to |
12342 | @samp{debug} can be needed only for @command{Gacopyz} developers, to | 12346 | @samp{proto} can be needed only for @command{Gacopyz} developers, to |
12343 | debug the protocol. | 12347 | debug the protocol. |
12344 | 12348 | ||
12345 | @xref{Testing Filter Scripts}. | 12349 | @xref{Testing Filter Scripts}. |
12346 | 12350 | ||
12347 | @opsummary{log-facility} | 12351 | @opsummary{log-facility} |
12348 | @item --log-facility=@var{facility} | 12352 | @item --log-facility=@var{facility} |
diff --git a/doc/mtasim.texi b/doc/mtasim.texi index a8849fea..513d045d 100644 --- a/doc/mtasim.texi +++ b/doc/mtasim.texi | |||
@@ -451,12 +451,20 @@ cases. | |||
451 | @mtindex D, -D, @command{mtasim} option, summary | 451 | @mtindex D, -D, @command{mtasim} option, summary |
452 | @item --define=@var{macro}=@var{value} | 452 | @item --define=@var{macro}=@var{value} |
453 | @itemx -D @var{macro}=@var{value} | 453 | @itemx -D @var{macro}=@var{value} |
454 | Define Sendmail macro @var{macro} to the given @var{value}. It is | 454 | Define Sendmail macro @var{macro} to the given @var{value}. It is |
455 | similar to the @code{\D} administrative command (@pxref{D command}) | 455 | similar to the @code{\D} administrative command (@pxref{D command}) |
456 | 456 | ||
457 | @mtasimopt{gacopyz-log, summary} | ||
458 | @item --gacopyz-log=@var{level} | ||
459 | Set desired logging level for @command{gacopyz} library | ||
460 | (@pxref{Gacopyz}). @xref{gacopyz-log option}, for a detailed | ||
461 | description of @var{level}. Notice, that unless this option is used, | ||
462 | the @option{--verbose} (@option{-v}) command line option implies | ||
463 | @option{--gacopyz-log=debug}. | ||
464 | |||
457 | @mtasimopt{group, summary} | 465 | @mtasimopt{group, summary} |
458 | @mtindex g, -g, @command{mtasim} option, summary | 466 | @mtindex g, -g, @command{mtasim} option, summary |
459 | @item --group=@var{name} | 467 | @item --group=@var{name} |
460 | @itemx -g @var{name} | 468 | @itemx -g @var{name} |
461 | When switching to user's privileges as requested by the | 469 | When switching to user's privileges as requested by the |
462 | @option{--user} command line option, retain the additional group | 470 | @option{--user} command line option, retain the additional group |
@@ -473,17 +481,35 @@ privileges. | |||
473 | 481 | ||
474 | @item --help | 482 | @item --help |
475 | @itemx -? | 483 | @itemx -? |
476 | Display a short help summary | 484 | Display a short help summary |
477 | 485 | ||
478 | @mtasimopt{milter-version, summary} | 486 | @mtasimopt{milter-version, summary} |
479 | @item --milter-version=@var{number} | 487 | @item --milter-version=@var{version} |
480 | Force using the given Milter protocol version number. This option | 488 | Force using the given Milter protocol version number. The |
489 | @var{version} argument is either a numeric version (e.g. @samp{2}), or | ||
490 | a version string in form @samp{@var{major}.@var{minor}[.@var{patch}]}, | ||
491 | where square brackets indicate optional part. The default is | ||
492 | @samp{1.0.0}. If @var{version} is any of @samp{2}, @samp{3} or | ||
493 | @samp{1.0.0}, the default protocol capabilities and actions for that | ||
494 | version are set automatically. This option | ||
481 | is intended for development and testing of the Gacopyz library | 495 | is intended for development and testing of the Gacopyz library |
482 | (@pxref{Gacopyz}). | 496 | (@pxref{Gacopyz}). |
483 | 497 | ||
498 | @mtasimopt{milter-proto, summary} | ||
499 | @item --milter-proto=@var{bitmask} | ||
500 | Set Milter protocol capabilities. See @file{gacopyz/gacopyz.h} for | ||
501 | the meaning of various bits in the @var{bitmask}. Look for the C | ||
502 | macros with the prefix @samp{SMFIP_}. | ||
503 | |||
504 | @mtasimopt{milter-actions, summary} | ||
505 | @item --milter-actions=@var{bitmask} | ||
506 | Set Milter actions. See @file{gacopyz/gacopyz.h} for | ||
507 | the meaning of various bits in the @var{bitmask}. Look for the C | ||
508 | macros with the prefix @samp{SMFIF_}. | ||
509 | |||
484 | @mtasimopt{no-interactive, summary} | 510 | @mtasimopt{no-interactive, summary} |
485 | @item --no-interactive | 511 | @item --no-interactive |
486 | Not-interactive mode (disable readline). @xref{Command Line Editing, , | 512 | Not-interactive mode (disable readline). @xref{Command Line Editing, , |
487 | Command Line Editing, readline, GNU Readline Library}. | 513 | Command Line Editing, readline, GNU Readline Library}. |
488 | 514 | ||
489 | @mtasimopt{port, summary} | 515 | @mtasimopt{port, summary} |
@@ -517,13 +543,14 @@ is the default mode for @command{mtasim}. @xref{interactive mode}. | |||
517 | Display option summary | 543 | Display option summary |
518 | 544 | ||
519 | @mtasimopt{verbose, summary} | 545 | @mtasimopt{verbose, summary} |
520 | @mtindex v, -v, @command{mtasim} option, summary | 546 | @mtindex v, -v, @command{mtasim} option, summary |
521 | @item --verbose | 547 | @item --verbose |
522 | @itemx -v | 548 | @itemx -v |
523 | Increase verbosity level. | 549 | Increase verbosity level. Implies @option{--gacopyz-log=debug}, |
550 | unless that option is used explicitly. | ||
524 | 551 | ||
525 | @item --version | 552 | @item --version |
526 | @itemx -V | 553 | @itemx -V |
527 | Print program version | 554 | Print program version |
528 | 555 | ||
529 | @end table | 556 | @end table |
diff --git a/gacopyz/Makefile.am b/gacopyz/Makefile.am index 7d8c012b..d658b3e7 100644 --- a/gacopyz/Makefile.am +++ b/gacopyz/Makefile.am | |||
@@ -24,12 +24,13 @@ libgacopyz_a_SOURCES = \ | |||
24 | context.c\ | 24 | context.c\ |
25 | io.c\ | 25 | io.c\ |
26 | log.c\ | 26 | log.c\ |
27 | mfapi.h\ | 27 | mfapi.h\ |
28 | proc.c\ | 28 | proc.c\ |
29 | server.c\ | 29 | server.c\ |
30 | stagenames.c\ | ||
30 | trans.h | 31 | trans.h |
31 | 32 | ||
32 | EXTRA_DIST=trans.tab trans.awk | 33 | EXTRA_DIST=trans.tab trans.awk |
33 | BUILT_SOURCES=trans.h | 34 | BUILT_SOURCES=trans.h |
34 | INCLUDES=-I$(top_srcdir)/gnu -I../gnu | 35 | INCLUDES=-I$(top_srcdir)/gnu -I../gnu |
35 | 36 | ||
diff --git a/gacopyz/context.c b/gacopyz/context.c index 41d64c44..12094fdf 100644 --- a/gacopyz/context.c +++ b/gacopyz/context.c | |||
@@ -1,8 +1,8 @@ | |||
1 | /* This file is part of gacopyz. | 1 | /* This file is part of gacopyz. |
2 | Copyright (C) 2006, 2007 Sergey Poznyakoff | 2 | Copyright (C) 2006, 2007, 2009 Sergey Poznyakoff |
3 | 3 | ||
4 | This program is free software; you can redistribute it and/or modify | 4 | This program is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by | 5 | it under the terms of the GNU General Public License as published by |
6 | the Free Software Foundation; either version 3, or (at your option) | 6 | the Free Software Foundation; either version 3, or (at your option) |
7 | any later version. | 7 | any later version. |
8 | 8 | ||
@@ -47,13 +47,13 @@ gacopyz_getsymval(SMFICTX *ctx, const char *name) | |||