1MAILPOST(8) InterNetNews Documentation MAILPOST(8)
2
3
4
6 mailpost - Feed an e-mail message into a newsgroup
7
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
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
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 field body modified to crosspost
93 the article to all indicated groups. The units for wait-time are
94 seconds; a reasonable value may be anywhere from tens to hundreds
95 of seconds, or even higher, depending on how long mail can be
96 delayed on its 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 List-ID header field, if such a header field doesn't already
110 exist.
111
112 -n If the -n flag is used, neither an article is posted nor a mail is
113 sent in case an error occurs. Everything is written to the
114 standard output.
115
116 -o output-command
117 Specifies the program to which the resulting article processed by
118 mailpost should be sent. For debugging purpose, "-o cat" can be
119 used. The default value is "inews -S -h".
120
121 -p port
122 Specifies the port on which nnrpd is listening, used for article
123 posting. If given, -p is passed along to inews.
124
125 -r addr
126 A heuristic is used to determine a reasonable value for the Path
127 header field body. The -r flag indicates what to use if no other
128 value can be determined.
129
130 -t tempdir
131 If the -t flag is used, then it defines the location of the
132 directory to use to temporarily store error messages that are sent
133 to the newsmaster. This option may be required if the default
134 value refers to a path that does not exist or the mailpost process
135 does not have write access to (notably when it is executed as the
136 mail user). Two paths are tried by default: pathtmp as set in
137 inn.conf, and then /var/tmp if pathtmp is not writable.
138
139 Make sure the specified location exists and is writable by the user
140 mailpost runs as.
141
142 -x header[:header...]
143 A colon-separated list of additional header fields which should be
144 treated as known header fields; these header fields will be passed
145 through to inews without having "X-" prepended.
146
147 By default, known header fields are:
148
149 Archive
150 Archived-At
151 Comments
152 Content-*
153 Date
154 Distribution
155 From
156 Injection-Date
157 Keywords
158 List-ID
159 Message-ID
160 MIME-*
161 Organization
162 References
163 Return-Path
164 Sender
165 Subject
166 Summary
167
168 -z header[:header...]
169 A colon-separated list of additional header fields which should be
170 removed.
171
172 By default, removed header fields are:
173
174 X-Complaints-To
175 X-Trace
176
178 pathbin/mailpost
179 The Perl script itself used to feed an e-mail message to a
180 newsgroup.
181
182 pathdb/mailpost-msgid.dir and pathdb/mailpost-msgid.pag
183 The default database files which record previously seen message-
184 IDs.
185
187 Written by Paul Vixie long ago and then hacked up by James Brister for
188 INN integration. Documentation improved by Julien Elie.
189
191 inews(1), inn.conf(5), libinn_uwildmat(3), moderators(5), nnrpd(8),
192 readers.conf(5).
193
194
195
196INN 2.7.0 2022-07-10 MAILPOST(8)