chiark / gitweb /
debugging for thing that crashed
[inn-innduct.git] / doc / pod / mailpost.pod
1 =head1 NAME
2
3 mailpost - Feed an e-mail message into a newsgroup
4
5 =head1 SYNOPSIS
6
7 B<mailpost> [B<-hn>] [B<-a> I<addr>] [B<-b> I<database>] [B<-c> I<wait-time>]
8 [B<-d> I<distribution>] [B<-f> I<addr>] [B<-m> I<mailing-list>]
9 [B<-o> I<output-command>] [B<-p> I<port>] [B<-r> I<addr>]
10 [B<-x> I<header>[B<:>I<header>...]] I<newsgroups>
11
12 =head1 DESCRIPTION
13
14 The B<mailpost> program reads a properly formatted e-mail message from stdin
15 and feeds it to B<inews> for posting to a news server.  I<newsgroups> is a
16 whitespace-separated list of group names to which to post the article
17 (at least one newsgroup must be specified).
18
19 Before feeding the article to B<inews>, it checks that the article has not
20 been seen before, and it changes some headers (cleans up some address
21 headers, removes X-Trace: and X-Complaints-To:, and puts C<X-> in front
22 of unknown headers).
23
24 If the article has been seen before (B<mailpost> records the Message-ID of
25 each article it handles), then the article will be silently dropped.  Other
26 errors will cause the article to be mailed to the newsmaster (selected
27 at configure time and defaulting to C<usenet>).
28
29 Normally, B<mailpost> is run by sendmail(8) via an alias entry:
30
31     local-mail-wreck-bikes: "|<pathbin in inn.conf>/mailpost
32         -b /var/tmp -d local local.mail.rec.bicycles.racing"
33
34 Instead of F</var/tmp>, the mail spool directory can be specified,
35 or any other directory where the B<mailpost> process has write access.
36
37 =head1 OPTIONS
38
39 =over 4
40
41 =item B<-a> I<addr>
42
43 If the B<-a> flag is used, the value given is added to the article 
44 as an Approved: header.
45
46 =item B<-b> I<database>
47
48 If the B<-b> flag is used, then it defines the location of the database 
49 used to store the Message-IDs of articles sent on.  This is to prevent articles
50 looping around if a news-to-mail gateway sends them back here.  This option may
51 be required if the B<mailpost> process does not have write access to the news
52 temporary directory.  The default value is I<pathtmp> as set in F<inn.conf>.
53
54 =item B<-c> I<wait-time>
55
56 The B<-c> flag indicates a length of time to sleep before posting.  If
57 duplicate messages are received in this interval (by any instance of
58 B<mailpost> using the same database), the article is only posted once, but
59 with Newsgroups: header modified to crosspost the article to all indicated
60 groups.  The units for I<wait-time> are seconds; a reasonable value may be
61 anywhere from tens to hundreds of seconds, or even higher, depending on how
62 long mail can be delayed on its way to your system.
63
64 =item B<-d> I<distribution>
65
66 If the B<-d> flag is used, the value given is added to the article as a
67 Distribution: header.
68
69 =item B<-f> I<addr>
70
71 The B<-f> flag is a synonym for the B<-r> flag.
72
73 =item B<-h>
74
75 Print usage information and exit.
76
77 =item B<-m> I<mailing-list>
78
79 If the B<-m> flag is used, the value given is added to the article in a 
80 Mailing-List: header, if such a header doesn't already exist.
81
82 =item B<-n>
83
84 If the B<-n> flag is used, neither an article is posted nor a mail is sent
85 in case an error occurs.  Everything is written to the standard output.
86
87 =item B<-o> I<output-command>
88
89 Specifies the program to which the resulting article processed by B<mailpost>
90 should be sent.  For debugging purpose, C<-o cat> can be used.  The default
91 value is C<inews -S -h>.
92
93 =item B<-p> I<port>
94
95 Specifies the port on which B<nnrpd> is listening, used for article posting.
96 If given, B<-p> is passed along to B<inews>.
97
98 =item B<-r> I<addr>
99
100 A heuristic is used to determine a reasonable value for the Path: header.
101 The B<-r> flag indicates what to use if no other value can be determined.
102
103 =item B<-x> I<header>[B<:>I<header>...]
104
105 A colon-separated list of additional headers which should be treated as
106 known headers; these headers will be passed through to B<inews> without
107 having C<X-> prepended.
108
109 Known headers are:
110
111     Approved
112     Content-*
113     Date
114     Distribution
115     From
116     Mailing-List
117     Message-ID
118     MIME-*
119     References
120     Return-Path
121     Sender
122     Subject
123
124 =back
125
126 =head1 FILES
127
128 =over 4
129
130 =item I<pathbin>/mailpost
131
132 The Perl script itself used to feed an e-mail message to a newsgroup.
133
134 =item I<pathtmp>/mailpost-msgid.dir and I<pathtmp>/mailpost-msgid.pag
135
136 The default database files which record previously seen Message-IDs.
137
138 =back
139
140 =head1 HISTORY
141
142 Written by Paul Vixie long ago and then hacked up by James Brister for INN 
143 integration.
144
145 $Id: mailpost.pod 7795 2008-04-26 08:28:08Z iulius $
146
147 =head1 SEE ALSO
148
149 active(5), inews(1), inn.conf(5), nnrpd(8), uwildmat(3).
150
151 =cut
152