diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-05-04 05:37:38 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-05-04 05:37:38 +0000 |
commit | 5663888746b3b5e15ab795a1e2bfaae7b2cf768a (patch) | |
tree | e1ee007db83ea3832d450ae4d6e2df7010cfbed9 /doc | |
parent | 076f7df5c40dbc3c791f14e5f55568e46244c0f8 (diff) | |
download | mailfromd-5663888746b3b5e15ab795a1e2bfaae7b2cf768a.tar.gz mailfromd-5663888746b3b5e15ab795a1e2bfaae7b2cf768a.tar.bz2 |
SIGHUP instructs `mailfromd' to restart itself.
Remove UNIX socket after closing it.
git-svn-id: file:///svnroot/mailfromd/trunk@1405 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'doc')
-rw-r--r-- | doc/Makefile.am | 2 | ||||
-rw-r--r-- | doc/mailfromd.texi | 159 |
2 files changed, 87 insertions, 74 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am index 9ac968a8..cd62e11a 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -92,7 +92,7 @@ check-refs: check-fixmes: @sed -e = $(info_TEXINFOS) | \ - sed -n 'N;/@FIXME{/{s/\(^[0-9][0-9]*\).*@FIXME{\([^}]*\)}.*/$(info_TEXINFOS):\1: \2/gp}' > $@-t; \ + sed -n 'N;/@FIXME{/{s/\(^[0-9][0-9]*\).*@FIXME{\([^}]*\).*/$(info_TEXINFOS):\1: \2/gp}' > $@-t; \ if [ -s $@-t ]; then echo "Unresolved FIXMEs:"; cat $@-t;\ fi rm -f $@-t diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi index 741499b1..ffd1495c 100644 --- a/doc/mailfromd.texi +++ b/doc/mailfromd.texi @@ -66,10 +66,10 @@ Software Foundation raise funds for GNU development.'' @page @quotation -Dedico aquesta obra a Lluis Llach, un home qui ha canviat la meva vida. +@i{Dedico aquesta obra a Lluis Llach, un home qui ha canviat la meva vida. No puc dedicar-li ni una poesia, ni una can@,c@'o, ho sento molt. Ara, commogut pel seu concert de comiat, li dedico ho que puc: aquest programa -senzill. +senzill.} @end quotation @@ -1106,7 +1106,7 @@ The diagram below shows the control flow when processing an @acronym{SMTP} transaction. Lines marked with @code{C:} show @acronym{SMTP} commands issued by the remote machine (the @dfn{client}), those marked with @samp{@result{}} show called handlers -with their arguments. An @r{[R]} appearing at the right end of a line +with their arguments. An @r{[R]} appearing at the start of a line indicates that this part of the transaction can be repeated any number of times: @@ -1114,7 +1114,7 @@ of times: @caption{Mailfromd Control Flow} @smallexample @group -@result{} begin +@result{} begin() @result{} connect(@var{hostname}, @var{family}, @var{port}, @samp{IP address}) C: HELO @var{domain} helo(@var{domain}) @@ -1123,26 +1123,26 @@ do C: MAIL FROM @var{sender} @result{} envfrom(@var{sender}) - C: RCPT TO @var{recipient} @r{[R]} +@r{[R]} C: RCPT TO @var{recipient} @result{} envrcpt(@var{recipient}) C: DATA - C: @var{header}: @var{value} @r{[R]} +@r{[R]} C: @var{header}: @var{value} @result{} header(@var{header}, @var{value}) C: - @result{} eoh + @result{} eoh() - C: @var{body-line} @r{[R]} +@r{[R]} C: @var{body-line} @result{} /* @r{Collect lines into blocks @var{blk} of @result{} * at most @var{len} bytes and call:} @result{} */ @result{} body(@var{blk}, @var{len}) C: . - @result{} eom + @result{} eom() done -@result{} end +@result{} end() @end group @end smallexample @end float @@ -1643,48 +1643,42 @@ done @end group @end smallexample -@FIXME{Proposed by Jan: - - Another way to avoid infinite looping caused by endless recursive -triggering of @code{on poll}, is to accept relaying of all email originating -from the local @acronym{IP} cluster with (trusted) clients and @acronym{SMTP} servers, -provided that the server running mailfromd falls within this @acronym{IP} range: + If you feel that your Sendmail's relayed domains are not restrictive +enough for @command{mailfromd} filters (for example you are relaying +mails from some third-party servers), you can use a database of mail +server addresses to decide whether the mail must be checked or not. +If the number of such servers is small enough, a single @samp{or} +statement can be used, e.g.: @smallexample -@group -prog envfrom -do - if $f == "" + elif $@{client_addr@} = "10.10.10.1" + or $@{client_addr@} = "192.168.11.7" accept + @dots{} +@end smallexample + +@noindent +otherwise, if the servers' @acronym{IP} addresses fall within one or +several @acronym{CIDR}s, you can use the @code{match_cidr} function +(@pxref{Internet address manipulation functions}), e.g.: + +@smallexample elif match_cidr ($@{client_addr@}, "199.232.0.0/16") accept - else - on poll $f do - when success: - accept - when not_found or failure: - reject 550 5.1.0 "Sender validity not confirmed" - when temp_failure: - tempfail 450 4.1.0 "Try again later" - done - fi -done -@end group + @dots{} @end smallexample -Here, triggering the @code{on poll} statement with more than 1 recursion -is avoided for all local emails, originating from non-local @acronym{IP}s -(outside of @acronym{CIDR} range 193.232.0.0/16) - when such an email arrives, -handler execution falls through to @code{on poll}, which will cause -the server to connect back to itself for local email verification, but -this time, the @code{on poll} check will be skipped, as the server's -own @acronym{IP} address will be caught by @code{match_cidr} statement. -This method has particular advantage over the previous one: it -does not rely on sendmail's relay-domains control, which can be, -alone, too wide for sane relaying control. +@noindent +Finally, you can keep a @acronym{DBM} database of relayed addresses +and use @code{dbmap} or @code{dbget} function for checking +(@pxref{Database functions}). -} - +@smallexample + elif dbmap(__statedir__"/relay.db", $@{client_addr@}) + accept + @dots{} +@end smallexample + @node HELO Domain @section HELO Domain @@ -1784,24 +1778,6 @@ done @end group @end smallexample -@FIXME{Consider explaining this: - -@smallexample -@group -prog envfrom -do - if %helohost = localhost - or (%helohost matches '^[0-9]@{1,3@}\.[0-9]@{1,3@}\.[0-9]@{1,3@}\.[0-9]@{1,3@}$' - and hostname %helohost = %helohost) - or resolve %helohost = "0" - reject 570 "Please specify real host name" - fi -done - -@end group -@end smallexample -} - @node Controlling Number of Recipients @section Controlling Number of Recipients @@ -2936,9 +2912,8 @@ debugging, or in your @code{catch} statements. @section Warnings about some slippery places in @acronym{MFL} @quotation -It seemed like a good idea at the time. - ---- Brian Kernighan +@i{It seemed like a good idea at the time.}@* +Brian Kernighan @end quotation There are some features of @acronym{MFL} which, when used improperly, @@ -3434,8 +3409,8 @@ scripts. @xref{tracing runtime errors}, for the detailed description. @deffn {pragma option} user @var{string} @xprindex{user} - Switch to this user's privileges after startup. @FIXME{Describe -it. Refer to --group.} + Switch to this user's privileges after startup. +@FIXME{Describe it. Refer to --group.} @end deffn @deffn {pragma option} group @var{string} @@ -9100,8 +9075,9 @@ the action to all available databases. @xref{compact cronjob}. @item -D @var{string} @itemx --domain=@var{string} Set default @acronym{SMTP} domain. Overrides @samp{#pragma option ehlo} -(@pxref{pragma ehlo}). @FIXME{Deprecated: use @option{-v -ehlo_domain=@var{string}} instead. Explain why.} +(@pxref{pragma ehlo}). This option is +deprecated@footnote{@xref{31x-32x}, for the detailed description of +why it is deprecated.}: use @option{-v ehlo_domain=@var{string}} instead. @opsummary{ehlo} @itemx --ehlo=@var{string} @@ -9178,8 +9154,14 @@ Functions}. @item --mailfrom=@var{email} Set postmaster email address. Overrides @samp{#pragma option ehlo}, which you are advised to use instead (@pxref{pragma ehlo}). The -default is null return address (@samp{""}). @FIXME{Deprecated: use -@option{-v mailfrom_address=@var{string}} instead. Explain why.} +default is null return address (@samp{""}). This option is +deprecated@footnote{@xref{31x-32x}, for the detailed +description of why it is deprecated.}: use @option{-v +mailfrom_address=@var{string}} instead. + +@opsummary{mtasim} +@item --mtasim +This option is reserved for use by @command{mtasim} (@pxref{mtasim}). @opsummary{optimize} @item -O[@var{level}] @@ -9527,15 +9509,43 @@ group}). In example above, you need to use the following directive: option: @kbd{mailfromd --group=smmsp}). @cindex Signals -@cindex SIGHUP +@cindex SIGQUIT @cindex SIGTERM @cindex SIGINT To stop a running instance of @command{mailfromd} use one of the -following signals: @code{SIGHUP}, @code{SIGTERM}, @code{SIGINT}. +following signals: @code{SIGQUIT}, @code{SIGTERM}, @code{SIGINT}. All three signals have the same effect: the program cancels handling any pending requests, uninitializes the communication socket (if it is a UNIX socket, the program unlinks it) and exits. +@cindex SIGHUP + To restart the running @command{mailfromd} instance, send it +@code{SIGHUP}. For restart to be possible, two conditions must be +met: @command{mailfromd} must be invoked with full file name, and the +configuration file name must be full as well. If either of them is not +met, @command{mailfromd} displays the similar warning message: + +@smallexample +@group +warning: script file is given without full file name +warning: restart (SIGHUP) will not work +@end group +@end smallexample + +@noindent +or: + +@smallexample +@group +warning: mailfromd started without full file name +warning: restart (SIGHUP) will not work +@end group +@end smallexample + +The reaction of @command{mailfromd} on @code{SIGHUP} in this case is +the same as on the three signals described previously, i.e. cleanup +and exit immediately. + @cindex pidfile The @acronym{PID} of the master instance of @command{mailfromd} is kept on the @dfn{pidfile}, which is named @file{mailfromd.pid} and is @@ -9567,6 +9577,9 @@ Start the program. @item stop Shut down the program +@item reload +Reload the program, by sending it @code{SIGHUP} signal. + @item restart Shut down the program and start it again. |