1MAILPOST(8)               InterNetNews Documentation               MAILPOST(8)
2
3
4

NAME

6       mailpost - Feed an e-mail message into a newsgroup
7

SYNOPSIS

9       mailpost [-hn] [-a addr] [-b database] [-c wait-time] [-d distribution]
10       [-f addr] [-m mailing-list] [-o output-command] [-p port] [-r addr] [-t
11       tempdir] [-x header[:header...]] [-z header[:header...]]  newsgroups
12

DESCRIPTION

14       The mailpost program reads a properly formatted e-mail message from
15       stdin and feeds it to inews for posting to a news server.  newsgroups
16       is a whitespace-separated list of group names to which to post the
17       article (at least one newsgroup must be specified).
18
19       Before feeding the article to inews, it checks that the article has not
20       been seen before, and it changes some header fields (cleaning up some
21       address header fields, removing a few ones like X-Complaints-To and
22       X-Trace, and putting "X-" in front of unknown header fields).  The
23       Received and *-To header fields are also altered to prevent spamming
24       the gateway (the name of the news server or the domain name set in
25       fromhost, pathhost and domain in inn.conf are removed).
26
27       If the article has been seen before (mailpost records the message-ID of
28       each article it handles), then the article will be dropped with a non-
29       zero error status.  Other errors will cause the article to be mailed to
30       the newsmaster (selected at configure time and defaulting to "usenet").
31
32       Normally, mailpost is run by sendmail(8) via an alias entry:
33
34           local-mail-wreck-bikes: "|<pathbin in inn.conf>/mailpost
35               -b /var/spool/mailpost -t /tmp -d local local.bicycles.racing"
36
37       The -b and -t flags are useful to change the directories used by
38       mailpost by default.  As a matter of fact, though it is recommended to
39       run mailpost as the news user, it is as often as not run as another
40       user, notably the mail user.  Therefore, you should make sure to create
41       and set to be writable by the user that mailpost runs as the
42       directories where to put the database and the temporary files.  Also,
43       mailpost must be executable by that user.
44
45       Instead of /var/spool/mailpost, the mail spool directory can be
46       specified, or any other directory where the mailpost process has write
47       access.
48
49       A common practice to gateway a newsgroup to a mailing-list is to create
50       a moderated newsgroup (running for instance the command "ctlinnd
51       newgroup local.bicycles.racing m") and set the moderation address for
52       this newsgroup in the moderators file in pathetc to the mailing-list
53       address.  If you add an -a flag in the above example, then on the one
54       hand, when a message is sent to the mailing-list, mailpost will be run,
55       mark it as approved, and the message will directly reach the newsgroup.
56       On the other hand, when a message is posted to the newsgroup, it
57       normally does not have an Approved header field, so it will be sent (by
58       nnrpd) to the mailing-list address configured in the moderators file,
59       which means the message reaches the mailing-list and, like any other
60       messages posted to the mailing-list, it will be processed by mailpost,
61       approved, and finally reach the newsgroup.
62

OPTIONS

64       -a addr
65           If the -a flag is used, addr (which is usually the e-mail address
66           of the poster) is added to the article as the body of an Approved
67           header field.  It is useful if one of the newsgroup to which the
68           article should be posted is moderated.  (Of course, this flag
69           should be added only if you are supposed to auto-approve your
70           posts.)
71
72           Be sure that the reader connection made by inews to post the
73           article is allowed to post approved articles (see the "A" letter in
74           the access parameter of access blocks in readers.conf).
75
76       -b database
77           If the -b flag is used, then it defines the location of the
78           persistent database used to store the message-IDs of articles sent
79           on.  This is to prevent articles looping around if a news-to-mail
80           gateway sends them back here.  This option may be required if the
81           mailpost process does not have write access to the news database
82           directory (notably when it is executed as the mail user).  The
83           default value is pathdb as set in inn.conf.
84
85           Make sure the specified location exists and is writable by the user
86           mailpost runs as.
87
88       -c wait-time
89           The -c flag indicates a length of time to sleep before posting.  If
90           duplicate messages are received in this interval (by any instance
91           of mailpost using the same database), the article is only posted
92           once, but with Newsgroups: header modified to crosspost the article
93           to all indicated groups.  The units for wait-time are seconds; a
94           reasonable value may be anywhere from tens to hundreds of seconds,
95           or even higher, depending on how long mail can be delayed on its
96           way to your system.
97
98       -d distribution
99           If the -d flag is used, the value given is added to the article as
100           the body of the Distribution header field.
101
102       -f addr
103           The -f flag is a synonym for the -r flag.
104
105       -h  Print usage information and exit.
106
107       -m mailing-list
108           If the -m flag is used, the value given is added to the article in
109           a Mailing-List: header, if such a header doesn't already exist.
110
111       -n  If the -n flag is used, neither an article is posted nor a mail is
112           sent in case an error occurs.  Everything is written to the
113           standard output.
114
115       -o output-command
116           Specifies the program to which the resulting article processed by
117           mailpost should be sent.  For debugging purpose, "-o cat" can be
118           used.  The default value is "inews -S -h".
119
120       -p port
121           Specifies the port on which nnrpd is listening, used for article
122           posting.  If given, -p is passed along to inews.
123
124       -r addr
125           A heuristic is used to determine a reasonable value for the Path:
126           header.  The -r flag indicates what to use if no other value can be
127           determined.
128
129       -t tempdir
130           If the -t flag is used, then it defines the location of the
131           directory to use to temporarily store error messages that are sent
132           to the newsmaster.  This option may be required if the default
133           value refers to a path that does not exist or the mailpost process
134           does not have write access to (notably when it is executed as the
135           mail user).  Two paths are tried by default: pathtmp as set in
136           inn.conf, and then /var/tmp if pathtmp is not writable.
137
138           Make sure the specified location exists and is writable by the user
139           mailpost runs as.
140
141       -x header[:header...]
142           A colon-separated list of additional header fields which should be
143           treated as known header fields; these header fields will be passed
144           through to inews without having "X-" prepended.
145
146           By default, known header fields are:
147
148               Archive
149               Archived-At
150               Comments
151               Content-*
152               Date
153               Distribution
154               From
155               Injection-Date
156               Keywords
157               Mailing-List
158               Message-ID
159               MIME-*
160               Organization
161               References
162               Return-Path
163               Sender
164               Subject
165               Summary
166
167       -z header[:header...]
168           A colon-separated list of additional header fields which should be
169           removed.
170
171           By default, removed header fields are:
172
173               X-Complaints-To
174               X-Trace
175

FILES

177       pathbin/mailpost
178           The Perl script itself used to feed an e-mail message to a
179           newsgroup.
180
181       pathdb/mailpost-msgid.dir and pathdb/mailpost-msgid.pag
182           The default database files which record previously seen message-
183           IDs.
184

HISTORY

186       Written by Paul Vixie long ago and then hacked up by James Brister for
187       INN integration.  Documentation improved by Julien Elie.
188

SEE ALSO

190       inews(1), inn.conf(5), libinn_uwildmat(3), moderators(5), nnrpd(8),
191       readers.conf(5).
192
193
194
195INN 2.6.5                         2022-02-18                       MAILPOST(8)
Impressum