chiark / gitweb /
ed322f6c63930267fd499a89a6081d14f2a0f041
[modbot-mtm.git] / stump / etc / modenv.INO
1 #!/bin/bash
2 ###
3 #
4 # MAIN CONFIGURATION FILE
5 #
6 # ### Administrators of STUMP robomoderator systems:
7 #
8 # set environment variables according to config of your site. 
9 # this script is normally invoked from procmail, as a wrapper
10 # to real moderation scripts. Follow the instructions.
11 #
12
13 set -e
14
15 #######################################################################
16 # this is the root directory where moderation software & config
17 # resides. Make sure that sendmail is in the PATH.
18 # (most likely it is in /usr/lib/sendmail).
19 #
20
21 MNG_ROOT=%BASEDIR%/stump
22 exec >>%BASEDIR%/errs 2>&1
23
24 printf "============ %s " "$*"
25 date
26
27 export MNG_ROOT BASEDIR
28
29 # Add bin and local/bin to PATH
30 PATH=$MNG_ROOT/bin:$MNG_ROOT/local/bin:$MNG_ROOT/etc:$PATH:/usr/sbin
31 PATH=$PATH:/usr/local/bin:/bin:/usr/bin:/usr/sbin:$HOME/bin
32 export PATH
33
34 #######################################################################
35 # Name of moderated group. Put the name of your group in here.
36 #
37
38 NEWSGROUP="%GROUP%"; export NEWSGROUP
39
40 #######################################################################
41 # Email handling and mangling
42
43 MAILOUT_RECVACK_FORMAIL_ARGS='
44         -I Bcc:%OURUSER%+%ABBREV%-internal-log+mailout@%DOMAIN%
45 '
46 MAILOUT_ACCEPTACK_FORMAIL_ARGS='
47         -I Bcc:%OURUSER%+mtm-internal-log+mailout@%DOMAIN%
48 '
49 MAILOUT_REJECT_FORMAIL_ARGS='
50         -I Bcc:%OURUSER%+%ABBREV%-internal-log+mailout@%DOMAIN%
51         -I Bcc:%OURUSER%+%ABBREV%-internal-reject-copy@%DOMAIN%
52 '
53 export MAILOUT_RECVACK_FORMAIL_ARGS
54 export MAILOUT_ACCEPTACK_FORMAIL_ARGS
55 export MAILOUT_REJECT_FORMAIL_ARGS
56
57 #######################################################################
58 # STUMP enforces limitations on the maximum number of newsgroups
59 # used in Newsgroups: header line. The default value is 5. I
60 # You can change this value. If you do not want to enforce limitations 
61 # on crossposting, set MAX_CROSSPOSTS to 1000.
62
63 MAX_CROSSPOSTS=1
64 export MAX_CROSSPOSTS
65
66
67 ######################################################################
68 # Do you really want to use PGP? PGP (Pretty Good Privacy) is a 
69 # program that allows you (among other things) digitally sign messages
70 # and check digital signatures.
71 #
72 # It can make certain transactions more non-repudiable and secure.
73 # however, for most newsgroups the benefits of security are not as
74 # important and many users prefer not to use PGP. 
75 #
76 # Those users may set PGP to "none" (lowercase). 
77 #
78 # This ENTIRELY DISABLES use of PGP. That also disables PGPMoose, a 
79 # program that relies on PGP to digitally sign all approvals. 
80 # PGP Moose can help you combat forged approvals.
81 #
82 # My suggestion is, if you are not comfortable with PGP and have other
83 # things on your plate, set PGP to "none" and set it up later when
84 # time permits. Get other stuff working first.
85 #
86 # Alternatively, you could set PGP to the path to the actual PGP executable,
87 # as in:
88 #
89 # PGP=/usr/local/bin/pgp262
90 #
91 # Note that STUMP _requires_ pgp v. 2.6.2.
92 #
93
94 PGP="gpg"
95 export PGP
96
97 ######################################################################
98 # for pmapp - digital signing
99
100 ######################################################################
101 # PGP key names.
102 # PMUSER must be exactly as the PGP key named in the keyring
103 # Refer to the online documentation on how to create PGP keys.
104 #
105 # *IF* you do not plan to use PGP at all, define it like this:
106 # PMUSER_APPROVAL="SCRM Moderators <scrm-board@algebra.com>"
107 # and make sure that PMAPP is defined as "cat".
108 #
109 # this MUST be dfined EVEN if PGP is set to "none".
110 # This goes into your Approved: field.
111 PMUSER_APPROVAL="%GROUP% approval key <%MODEMAIL%>"
112 export PMUSER_APPROVAL
113
114 ######################################################################
115 # type in the passphrase for PGP Moose (passphrase for the Approval Key
116 # named right above that you generated)
117 # ONLY if pgp moose is used
118 #
119 # (in turn, PGP Moose is used only if PGP is NOT set to "none")
120 #
121 PMPASSWORD=""
122 export PMPASSWORD
123
124 ######################################################################
125 #
126 # PMAPP is the name of the PGP Moose signing program. If you do not
127 # want to use it, define PMAPP as "cat", like this: 
128 # PMAPP="cat"; export PMAPP
129 #
130 # otherwise, use "pmapp":
131 # PMAPP="pmapp"; export PMAPP
132 #
133 # NOTE!!! PMApp is disabled if PGP is set to "none"!
134 #
135
136 PMAPP="pmapp"; export PMAPP
137
138 ######################################################################
139 #
140 # DECISION_ADDRESS is the address for approved AND rejected submissions
141 # Used by ModScape subsystem only.
142 #
143 #DECISION_ADDRESS=scrm-approved@algebra.com
144 #export DECISION_ADDRESS
145
146 ######################################################################
147 # put a munged address for your group here. It should best resolve to
148 # a devnulled address, since a lot of rejections/acks will bounce
149 # and there is no need for a human being to see the bounces.
150 #
151 MUNGED_ADDRESS=%OURUSER%+%ABBREV%-bounces@%DOMAIN%
152 export MUNGED_ADDRESS
153
154
155 ######################################################################
156 # Where to submit ready and signed articles
157 # You do not need this if you set RNEWS (below) to sendmail, as
158 # instructed.
159 #IHAVE_SERVER=news.uu.net; export IHAVE_SERVER
160
161 ######################################################################
162 # Path: suffix for news
163 # Put something similar here, it is not a very important value.
164 #
165 PATH_SUFFIX="%GROUP%-moderators!robomod!not-for-mail"; export PATH_SUFFIX
166
167 ######################################################################
168 # Do we want to work in paranoid PGP mode? YES or NO
169 #
170 # NOTE: it means more work for the maintainer
171 #
172 # I suggest STRONGLY that you should set it to NO!!!!!!!!!!
173 #
174 # This is disabled If PGP is set to "none".
175 #
176 STUMP_PARANOID_PGP=NO
177 export STUMP_PARANOID_PGP
178
179 ######################################################################
180 # reachable email address of a real person who is responsible
181 # for maintaining the robomoderator.
182 #
183 ADMIN=%ADMIN%; export ADMIN
184
185 ######################################################################
186 # Address of the moderator's board (little private mailing list
187 # for moderators only) where posters can send their complaints about the
188 # moderation policy.
189 #
190 BOARD=%MODEMAIL%; export BOARD
191
192 ######################################################################
193 # address for the no-ack requests.
194 NOACK=%OURUSER%+%ABBREV%-noack@chiark.greenend.org.uk
195 export NOACK
196
197 ######################################################################
198 # Official address for submissions to the newsgroup.
199 #
200 SUBMIT=%OURUSER%+%ABBREV%+%KEYSUBMIT%@chiark.greenend.org.uk; export SUBMIT
201
202 ###################################################################### Flags
203 #
204 # ATTENTION!!! Flags must be YES or NO, in capital letters.
205 #
206
207 ######################################################################
208 # set this flag to YES if you want to REQUIRE all preapproved
209 # posters to use PGP to sign their messages. Typically you
210 # do not want to do it, unless your group has
211 # been SEVERELY invaded by malicious forgers.
212 #
213 # disabled if PGP is set to "none"
214 #
215 WHITELIST_MUST_SIGN=NO; export WHITELIST_MUST_SIGN
216
217 ########################################################## where is your rnews
218 # find out where is rnews program in your system - there may be
219 # several ones called `rnews'. Yours must be setuid or setgid, 
220 # typically.
221 #
222 # Below are several variants of defining RNEWS. The simplest one involves
223 # use of my mail2news gateway for STUMP users.
224 #
225 # Use this one if you want to use my gateway -- SIMPLEST way to do it.
226 # RNEWS="sendmail -f devnull@stump.algebra.com news-gateway@stump.algebra.com"
227 #
228 # Note that the -f flag is used to prevent any antispamming system from
229 # rejecting email to the news gateway.
230 #
231 # Use this only if you want to use your own rnews -- a pain in the
232 # neck if you do not know well how news servers work.
233 # RNEWS="/usr/lib/news/rnews -h $IHAVE_SERVER -S $IHAVE_SERVER "
234 #
235 # OR may be something like this if you have inews only:
236 # [you may have problems with "hostname" on bsd-derived systems]
237 #RNEWS="/usr/lib/news/inews -h "; export RNEWS
238 RNEWS="%BASEDIR%/inews"
239
240 #RNEWS="sendmail -f devnull@stump.algebra.com news-gateway@stump.algebra.com"
241 export RNEWS
242
243 # ATTENTION!!!
244 # MORE ABOUT RNEWS/INEWS: unfortunately, these programs differ on many
245 # systems. Some of the BSD-derived systems have "broken" inews and rnews
246 # that does not like another program "hostname".
247 #
248 # If you see error messages about "hostname" in ~/Mail/from, you should 
249 # either disregard them, or use the "hostname" shell script provided in 
250 # stump/etc. Do the following: 
251 #
252 # cd $HOME/stump/etc
253 # mv hostname.REPLACEMENT hostname
254 #
255 # Edit "hostname" and set your host name and fully qualified hostname.
256 #
257
258 ############################################################ Internal vars
259 #
260 # Do NOT change this section
261 #
262
263 if [ "$PGP" = "none" ] ; then
264   PMAPP=cat
265   export PMAPP
266 fi
267
268 #######################################################################
269 # Directory for temp files. This directory must NOT be writable by general
270 # public, for security reasons. I suggest keeping this intact.
271 #
272
273 TMP=$MNG_ROOT/tmp; export TMP
274
275 BEGIN_PGP_SIGNED_MESSAGE="-----BEGIN PGP SIGNED MESSAGE-----"
276 BOT_SUBJECT_PREFIX="KEGHF894ND50MJ"
277
278 export BEGIN_PGP_SIGNED_MESSAGE BOT_SUBJECT_PREFIX
279
280
281 ################################################################# Invocation
282 #
283 # DO NOT EDIT
284 #
285 # I use `antivirus' program as additional protection from all sorts
286 # of attempts to exploit bugs in moderation programs. Antivirus replaces
287 # all suspicious characters by '_' and splits too long lines.
288 #
289
290 if [ "x$1" != "x" ]; then
291   umask 077
292   antivirus | decodeBase64 | "$@"
293 fi