3 # $Cambridge: exim/doc/doc-docbook/x2man,v 1.4 2006/07/31 13:19:36 ph10 Exp $
5 # Script to find the command line options in the DocBook source of the Exim
6 # spec, and turn them into a man page, because people like that.
11 ##################################################
13 ##################################################
15 open(IN, "spec.xml") || die "Can't open spec.xml\n";
16 open(OUT, ">exim.8" ) || die "Can't open exim.8\n";
21 exim \\- a Mail Transfer Agent
23 .B exim [options] arguments ...
25 .B mailq [options] arguments ...
27 .B rsmtp [options] arguments ...
29 .B rmail [options] arguments ...
31 .B runq [options] arguments ...
33 .B newaliases [options] arguments ...
38 Exim is a mail transfer agent (MTA) developed at the University of Cambridge.
39 It is a large program with very many facilities. For a full specification, see
40 the reference manual. This man page contains only a description of the command
41 line options. It has been automatically generated from the reference manual
42 source, hopefully without too much mangling.
47 If none of the options that specifies a specific action (such as starting the
48 daemon or a queue runner, or testing an address, or receiving a message in a
49 specific format, or listing the queue) are present, and there is at least one
50 argument on the command line, \\fB-bm\\fR (accept a local message on the
51 standard input, with the arguments specifying the recipients) is assumed.
52 Otherwise, Exim outputs a brief message about itself and exits.
54 .SH SETTING OPTIONS BY PROGRAM NAME
58 Behave as if the option \\fB\\-bp\\fP were present before any other options.
59 The \\fB\\-bp\\fP option requests a listing of the contents of the mail queue
60 on the standard output.
63 Behaves as if the option \\fB\\-bS\\fP were present before any other options,
64 for compatibility with Smail. The \\fB\\-bS\\fP option is used for reading in a
65 number of messages in batched SMTP format.
68 Behave as if the \\fB\\-i\\fP and \\fB\\-oee\\fP options were present before
69 any other options, for compatibility with Smail. The name \\fBrmail\\fR is used
70 as an interface by some UUCP systems. The \\fB\\-i\\fP option specifies that a
71 dot on a line by itself does not terminate a non\\-SMTP message; \\fB\\-oee\\fP
72 requests that errors detected in non\\-SMTP messages be reported by emailing
76 Behave as if the option \\fB\\-q\\fP were present before any other options, for
77 compatibility with Smail. The \\fB\\-q\\fP option causes a single queue runner
78 process to be started. It processes the queue once, then exits.
81 Behave as if the option \\fB\\-bi\\fP were present before any other options,
82 for compatibility with Sendmail. This option is used for rebuilding Sendmail's
83 alias file. Exim does not have the concept of a single alias file, but can be
84 configured to run a specified command if called with the \\fB\\-bi\\fP option.
90 while (<IN>) { last if /^<!-- === Start of command line options === -->\s*$/; }
91 die "Can't find start of options\n" if ! defined $_;
96 # Loop for each individual option
105 last if /^<!-- === End of command line options === -->\s*$/;
107 # Start of new option
109 if (/^<term>(?=<option>-)(.*?)<\/term>$/)
111 print OUT ".TP 10\n";
116 # If a line contains text that is not in <>, read subsequent lines of the
117 # same form, so that we get whole sentences for matching on references.
119 if (/^ (?> (<[^>]+>)* ) \s*\S/x)
121 while ($next =~ /^ (?> (<[^>]+>)* ) \s*\S/x)
128 # Remove sentences or parenthetical comments that refer to chapters or
129 # sections. The order of these changes is very important:
131 # (1) Remove any parenthetical comments first.
132 # (2) Then remove any sentences that start after a full stop.
133 # (3) Then remove any sentences that start at the beginning or a newline.
135 s/\s?\( [^()]+ <xref \s linkend="[^"]+" \/ > \)//xg;
136 s/\s?\. [^.]+ <xref \s linkend="[^"]+" \/ > [^.]*? \././xg;
137 s/(^|\n) [^.]+ <xref \s linkend="[^"]+" \/ > [^.]*? \./$1/xg;
139 # Handle paragraph starts; skip the first one encountered for an option
141 if ($optstart && /<(sim)?para>/)
147 # Literal layout needs to be treated as a paragraph, and indented
149 if (/<literallayout/)
151 s/<literallayout[^>]*>/.P/;
155 $indent = "" if (/<\/literallayout>/);
164 s/<primary>.*?<\/primary>//g;
165 s/<secondary>.*?<\/secondary>//g;
167 # Convert all occurrences of backslash into \e
171 # Handle bold and italic
174 s/<emphasis role="bold">/\\fB/g;
175 s/<\/emphasis>/\\fP/g;
181 s/<\/varname>/\\fP/g;
187 # Remove any remaining XML markup
191 # If nothing left in the line, ignore.
195 # It turns out that we don't actually want .P; a blank line is needed.
196 # But we can't set that above, because it will be discarded.
200 # We are going to output some data; sort out special characters
209 # Escape hyphens to prevent unwanted hyphenation
213 # Put in the indent, and write the line