2
+++ ifmail-2.14tx8.10/md/fidosend
5
+## SH script to send fido batches out trought ifmail.
10
+if [ -e /usr/lib/news/innshellvars ]; then
11
+ . /usr/lib/news/innshellvars
13
+ . /etc/news/innshellvars
15
+. /etc/ifmail/ifshellvars
17
+if [ ! -f $SERVERPID ]; then exit ;fi
19
+if [ $# -lt 1 ]; then
20
+ echo "$0 [$$]: Usage: $0 site"
26
+if [ -s $BATCH/$SITE ]; then
27
+ mv $BATCH/$SITE $BATCH/$SITE.work
28
+ $NEWSBIN/ctlinnd -s -t30 flush $SITE
29
+ $NEWSBIN/batcher -b0 -v -p\
30
+ "$IFBIN/ifnews $2 $3 $4 $5 %s"\
31
+ $SITE $BATCH/$SITE.work \
32
+ && rm -f $BATCH/$SITE.work
34
+ $VERBOSE && echo "$0 [$$]: no articles for $SITE"
38
+++ ifmail-2.14tx8.10/md/sendmail.mc
42
+# This is the m4 setup file for wonderland.linux.it
43
+# Copyright (C) 1996 by Marco d'Itri <md@linux.it>
46
+VERSIONID(`setup for wonderland (ifmail) 96/10/25')
50
+define(`IFMAIL_MAILER_MAX', 100000)dnl
52
+define(`confTRUSTED_USERS', ftn)dnl
57
+dnl###########################################################################
59
+Cwwonderland.linux.it wonderland.ils.org p10.f206.n332.z2.fidonet.org p10.f207.n332.z2.fidonet.org f102.n391.z42.guidenet.ftn
62
+++ ifmail-2.14tx8.10/md/nlc
66
+# This script compiles the Italian fidonet nodelist received via TIC
67
+# Copyright (C) 1996 by Marco d'Itri, 2:332/206.10 / md@linux.it
69
+. /etc/ifmail/ifshellvars
71
+if [ -r $IFSPOOL/inb/region33.zip ]; then
72
+ unzip -L -o -p $IFSPOOL/inb/region33.zip \
73
+ | sed "s/^;Zone,2,/Zone,2,/1" > $IFNLD/region.033.NEW
74
+ { printf 'To: ftn\n'
75
+ diff --unified=0 $IFNLD/region.033 $IFNLD/region.033.NEW; } \
77
+ mv $IFNLD/region.033.NEW $IFNLD/region.033
84
+mv $IFSPOOL/inb/region33.zip $IFSPOOL/inb/region33.OLD
87
+++ ifmail-2.14tx8.10/md/ahbpoll
90
+# ahbpoll, poll the two lines of my boss node
92
+# This script is based on the original ifpoll by Rasca Gmelch
93
+# Copyright (C) 1997 by Marco d'Itri, 2:332/206.10 / md@linux.it
95
+. /etc/ifmail/ifshellvars
97
+# Max number of failed polls
99
+# delay between outgoing calls in seconds
102
+###############################################################################
103
+# start some tail(1)s and initialize the ^C handler
104
+{ tail -n0 -f $IFLOG > $INFO_TTY & }; TOKILL=$!
105
+##{ tail -n0 -f $IFLOG | grep "received" & }; TOKILL="$TOKILL $!"
106
+##{ tail -n0 -f $IFLOG | grep "sent" & }; TOKILL="$TOKILL $!"
108
+trap "killall -HUP ifcico; kill $TOKILL; echo -e 'Aborted\n'; exit 100;" INT
110
+# let's pack the fido stuff..
113
+###############################################################################
114
+# loop until ifcico could connect the node or MaxTry is encountered
115
+i=1; errlv=1; alternate=0
116
+while [ $i -le $MaxTry -a $errlv != 0 ]; do
117
+ if [ $alternate = 0 ]; then
118
+ NODE=f206.n332.z2.fidonet.org
120
+ elif [ $alternate = 1 ]; then
121
+ NODE=f207.n332.z2.fidonet.org
125
+ echo -n "ahbpoll[$$]: $i. try ($NODE) "
126
+ $IFBIN/ifcico -r 1 $NODE
133
+ echo 'failed: busy (rc 2)'
134
+ if [ $i != $MaxTry -a $alternate = 0 ]; then sleep $DELAY; fi
137
+ echo 'failed: system error (rc 3)'
140
+ echo 'failed: lost carrier (rc 11)'
141
+ if [ $i != $MaxTry -a $alternate = 0 ]; then sleep $(($DELAY+120)); fi
144
+ echo "failed: ?? (rc $errlv)"
145
+ if [ $i != $MaxTry -a $alternate = 0 ]; then sleep $DELAY; fi
151
+###############################################################################
152
+# if the poll was ok, unpack
153
+if [ $errlv = "0" ]; then
154
+ if [ "`echo $IFSPOOL/inb/0000fff6.*`" != "$IFSPOOL/inb/0000fff6.*" ]; then
155
+ cp --force --link --preserve \
156
+ $IFSPOOL/inb/0000fff6.* $IFSPOOL/BAK
159
+ find $IFSPOOL/BAK -mtime +3 -type f -exec rm -fv \{\} \; >/dev/null
160
+ find $IFSPOOL/outb -empty -type f -exec rm -fv \{\} \; >/dev/null
163
+###############################################################################
167
+# return the errorlevel of ifcico
170
+++ ifmail-2.14tx8.10/md/newsfeeds
172
+# 332/206 is my boss node.
173
+# It is the hub, so it has 332/200 in the PATH kludge.
175
+f206.n332/f200.n332\
176
+ :!*,fido.ita.*,fido.332.*,fido.200.*\
180
+++ ifmail-2.14tx8.10/md/mailertable
182
+# You really need to write there all the six zones.
183
+.z1.fidonet.org ifmail:f206.n332
184
+.z2.fidonet.org ifmail:f206.n332
185
+.z3.fidonet.org ifmail:f206.n332
186
+.z4.fidonet.org ifmail:f206.n332
187
+.z5.fidonet.org ifmail:f206.n332
188
+.z6.fidonet.org ifmail:f206.n332
190
+# This allows sending crashmail and hold mail
191
+# Do NOT uncomment it if you don't trust your users!
192
+# .crash.fidonet.org ifmail-c:%1.fidonet.org
193
+# .hold.fidonet.org ifmail-h:%1.fidonet.org
195
+# This is an othernet
196
+.guidenet.ftn ifmail:f101.n391.z42
198
+# This is your smarthost
199
+. smtp:mail.provider.it
201
+++ ifmail-2.14tx8.10/md/fido.daily
205
+# fido.daily -- resume your ifcico, iftoss, ifmail, and ifnews logs
207
+# by Joaquim Baptista, px@fct.unl.pt
209
+# Placed on the public domain. If you make significant improvements on
210
+# this script, please send them to me so that I can mantain a "reference"
211
+# version. This script works with ifmail28; future versions may break it.
213
+# Example usage from cron, before rotating the logs:
214
+# fido.daily iflog | mail -s 'Daily Fidonet report' sysop
216
+# v1.1 -- Ignore "@somenet" in addresses like "2:362/42@fidonet" to avoid
217
+# multiple entries for the same node. Add -s option to select
218
+# nodes. Avoid dupplicate lines in the table of messages sent.
219
+# Add report of period covered.
221
+# v1.0 -- First release
223
+# Modified by kao@linux.it
227
+getopts("s:") || die "usage: $0 [-s pattern] [file...]\n";
228
+if ($opt_s ne "") { $opt_s =~ s/([^a-zA-Z0-9\s])/\\$1/g; }
233
+ if (/^([A-Z][a-z][a-z] [ \d]\d )/) {
234
+ $date= substr($_,0,15);
235
+ if ($date lt $first) { $first=$date; }
236
+ if ($last lt $date ) { $last=$date; }
239
+ if (/ifcico\[(\d+)\]: calling\s+([^\s@]+)/ ) {
243
+ elsif (/ifcico\[(\d+)\]: chat got "CONNECT"/) {
244
+ $conn{$call{$1}}++;
246
+ elsif (/ifcico\[(\d+)\]: chat got "BUSY"/) {
247
+ $busy{$call{$1}}++;
249
+ elsif (/ifcico\[(\d+)\]: chat got "NO CARRIER"/) {
250
+ $noca{$call{$1}}++;
252
+ elsif (/ifcico\[(\d+)\]: received (\d+) bytes in (\d+)/) {
253
+ $bytes_rcvd{$call{$1}} += $2;
254
+ $seconds_rcvd{$call{$1}} += $3;
256
+ elsif (/ifcico\[(\d+)\]: sent (\d+) bytes in (\d+)/) {
257
+ $bytes_sent{$call{$1}} += $2;
258
+ $seconds_sent{$call{$1}} += $3;
260
+ elsif (/iftoss\[(\d+)\]: packet from node ([^\s@]+)/) {
263
+ elsif (/iftoss\[(\d+)\]: No newsgroup for area tag (\S+)/) {
266
+ elsif (/iftoss\[(\d+)\]: end (\d+) echomail, (\d+)/) {
267
+ $tosskeys{$toss{$1}} ++;
268
+ $echomail{$toss{$1}} += $2;
269
+ $netmail{$toss{$1}} += $3;
271
+ elsif (/ifmail\[(\d+)\]: route: ([^\s@]+)/) {
274
+ elsif (/ifnews\[(\d+)\]: route: ([^\s@]+)/) {
277
+ elsif (/ifnews\[(\d+)\]: end input (\d+)/) {
278
+ $ifnewskeys{$snews{$1}} ++;
279
+ $ifnewscount{$snews{$1}} += $2;
281
+ elsif (/ifcico\[(\d+)\]: start inbound/) {
285
+ elsif (/ifcico\[(\d+)\]: remote operator: ([\S ]*)/) {
286
+ $inbkeys{$inb{$1}} = $2;
288
+ elsif (/ifcico\[(\d+)\]: remote time: ([\S ]*)/) {
289
+ $inbtime{$inb{$1}} = $2;
293
+print "Report period:\n From $first\n To $last\n\n";
295
+print "Call-out systems (ifcico):\n";
296
+print "Attempts Busy NoCa Conn Time Received Sent System\n";
297
+for $s (sort keys %attempts) {
298
+ next if ($opt_s ne "") && ($s !~ /$opt_s/o);
299
+ printf("%7d %3d %3d %3d %s %6dKb %4dKb %s\n",
300
+ $attempts{$s}, $busy{$s}, $noca{$s}, $conn{$s},
301
+ &mmss($seconds_rcvd{$s}+$seconds_sent{$s}),
302
+ $bytes_rcvd{$s}/1024, $bytes_sent{$s}/1024, $s);
305
+print "\n\nMessages received by system (iftoss):\nEchomail Netmail Route\n";
306
+for $s (sort keys %tosskeys) {
307
+ next if ($opt_s ne "") && ($s !~ /$opt_s/o);
308
+ printf("%7d %7d %s\n", $echomail{$s}, $netmail{$s}, $s);
311
+print "\n\nMessages sent by system (ifnews+ifmail):\nEchomail Netmail Route\n";
312
+%aux=(%ifmail, %ifnewskeys);
313
+for $s (sort (keys %aux)) {
314
+ next if ($opt_s ne "") && ($s !~ /$opt_s/o);
315
+ printf("%7d %7d %s\n", $ifnewscount{$s}, $ifmail{$s}, $s);
318
+print "\n\nCall-in systems (ifcico):\n";
319
+printf("%-20s%s\n","Time","Operator");
320
+for $s (sort keys %inbcount) {
321
+ next if ($opt_s ne "") && ($s !~ /$opt_s/o);
322
+ printf("%-20s%s\n",
323
+ $inbtime{$s}, $inbkeys{$s});
327
+ print "\n\nMessages not tossed for lack of area tag (iftoss):\nNumber Area tag\n";
328
+ for $a (sort keys %toss_area) {
329
+ printf("%5d %s\n", $toss_area{$a}, $a);
336
+ sprintf("%4d:%2.2d", $s/60, $s-int($s/60)*60);
340
+++ ifmail-2.14tx8.10/md/crontab.news
342
+# Every 30 minutes send outbound echomail to the gateway
343
+6,36 * * * * /etc/news/scripts/fidosend f206.n332
346
+++ ifmail-2.14tx8.10/md/ifpoll
349
+# ifpoll, poll my boss node or the node given as argument 1
351
+# This script is based on the original ifpoll by Rasca Gmelch
352
+# Copyright (C) 1997 by Marco d'Itri, 2:332/206.10 / md@linux.it
354
+. /etc/ifmail/ifshellvars
356
+# my boss node (default address to poll)
357
+NODE="f206.n332.z2.fidonet.org"
358
+# Max number of failed polls
360
+# delay between outgoing calls in seconds
363
+# argv[1] is the optional node to call
364
+if [ "$1" != "" ]; then
365
+ if [ "$1" = "-?" -o "$1" = "-h" ]; then
366
+ echo "usage: ifpoll [<node>]"
373
+###############################################################################
374
+# start some tail(1)s and initialize the ^C handler
375
+if [ -n "$INFO_TTY" ]; then
376
+ { tail -n0 -f $IFLOG > $INFO_TTY & }; TOKILL=$!
377
+ ##{ tail -n0 -f $IFLOG | grep "received" & }; TOKILL="$TOKILL $!"
378
+ ##{ tail -n0 -f $IFLOG | grep "sent" & }; TOKILL="$TOKILL $!"
380
+ trap "killall -HUP ifcico; kill $TOKILL; echo -e 'Aborted\n'; exit 100;" INT
382
+ trap "killall -HUP ifcico; echo -e 'Aborted\n'; exit 100;" INT
385
+# let's pack the fido stuff..
388
+###############################################################################
389
+# loop until ifcico could connect the node or MaxTry is encountered
391
+while [ $i -le $MaxTry -a $errlv != 0 ]; do
392
+ echo -n "ifpoll[$$]: $i. try ($NODE) "
393
+ $IFBIN/ifcico -r 1 $NODE
400
+ echo 'failed: busy (rc 2)'
401
+ if [ $i != $MaxTry ]; then sleep $DELAY; fi
404
+ echo 'failed: system error (rc 3)'
407
+ echo 'failed: lost carrier (rc 11)'
408
+ if [ $i != $MaxTry ]; then sleep $(($DELAY+120)); fi
411
+ echo "failed: ?? (rc $errlv)"
412
+ if [ $i != $MaxTry ]; then sleep $DELAY; fi
418
+###############################################################################
419
+# if the poll was ok, unpack
420
+if [ $errlv = "0" ]; then
421
+ if [ "`echo $IFSPOOL/inb/0000fff6.*`" != "$IFSPOOL/inb/0000fff6.*" ]; then
422
+ cp --force --link --preserve \
423
+ $IFSPOOL/inb/0000fff6.* $IFSPOOL/BAK
426
+ find $IFSPOOL/BAK -mtime +3 -type f -exec rm -fv \{\} \; >/dev/null
427
+ find $IFSPOOL/outb -empty -type f -exec rm -fv \{\} \; >/dev/null
430
+###############################################################################
432
+if [ ! -z "$INFO_TTY" ]; then
436
+# return the errorlevel of ifcico
439
+++ ifmail-2.14tx8.10/md/ifshellvars
441
+# user ifmail runs as
444
+# where binaries like "ifcico" and "ifpack" reside
445
+IFBIN=/usr/lib/ifmail
447
+# spool directory for ftn packets where inbound and outbounds reside
448
+IFSPOOL=/var/spool/ftn
450
+# logfiles directory
451
+IFLOGDIR=/var/log/ifmail
454
+IFLOG=$IFLOGDIR/iflog
456
+# default console for showing the log (used by ifpoll)
457
+INFO_TTY="/dev/tty24"
459
+# nodelists directory name
462
+# nodelists directory
463
+IFNLD=$IFSPOOL/$IFNLDIRNAME
466
+++ ifmail-2.14tx8.10/md/ifmail.m4
469
+ifdef(`IFMAIL_MAILER_PATH',, `define(`IFMAIL_MAILER_PATH', /usr/lib/ifmail/ifmail)')
470
+ifdef(`IFMAIL_MAILER_FLAGS',, `define(`IFMAIL_MAILER_FLAGS', `')')
471
+ifdef(`IFMAIL_MAILER_ARGS',, `define(`IFMAIL_MAILER_ARGS', `ifmail -r $h $u')')
474
+#######################################
475
+### IFMAIL Mailer specification ###
476
+#######################################
478
+VERSIONID(`@(#)ifmail.m4 2.0 (Md) 97/08/23')
480
+Mifmail, P=IFMAIL_MAILER_PATH, F=CONCAT(8mDFMuCS, IFMAIL_MAILER_FLAGS), S=11, R=21,ifdef(`IFMAIL_MAILER_MAX', ` M=IFMAIL_MAILER_MAX,')
481
+ _OPTINS(`IFMAIL_MAILER_CHARSET', `C=', `, ')T=X-FTN/RFC822/X-Unix, U=ftn:ftn,
482
+ A=IFMAIL_MAILER_ARGS
483
+Mifmail-c, P=IFMAIL_MAILER_PATH, F=CONCAT(8mDFMuCS, IFMAIL_MAILER_FLAGS), S=11, R=21,ifdef(`IFMAIL_MAILER_MAX', ` M=IFMAIL_MAILER_MAX,')
484
+ _OPTINS(`IFMAIL_MAILER_CHARSET', `C=', `, ')T=X-FTN/RFC822/X-Unix, U=ftn:ftn,
485
+ A=IFMAIL_MAILER_ARGS -gc
486
+Mifmail-h, P=IFMAIL_MAILER_PATH, F=CONCAT(8mDFMuCS, IFMAIL_MAILER_FLAGS), S=11, R=21,ifdef(`IFMAIL_MAILER_MAX', ` M=IFMAIL_MAILER_MAX,')
487
+ _OPTINS(`IFMAIL_MAILER_CHARSET', `C=', `, ')T=X-FTN/RFC822/X-Unix, U=ftn:ftn,
488
+ A=IFMAIL_MAILER_ARGS -gh
489
+dnl****************************************************************************
492
+`# All our points. Each user must have the same point number on each network
497
+dnl****************************************************************************
498
+LOCAL_NET_CONFIG`'dnl
500
+`# Route mail for our fidotech points
501
+R$* < @ $=D . $=w . > $* $#ifmail $@ $2.$3 $: $1 < @ $2 . $3 > $4
504
+dnl+ Does not works on nodes which run uucp.
505
+ifdef(`IFMAIL_BOUNCE_UUCP',
506
+`# Bounce mail sent to the gateway without a To: pseudo header as first line
507
+RUUCP $#error $@ 5.1.1 $: "you must provide a To: address"
510
+# send as normal email and not as netmail
511
+R$* < @ $+ .ip.fidonet.org. > $* $: $1 < @ $2 .fidonet.org. > $3
514
+ifdef(`FIDO_SMART_HOST',
515
+R$* < @ $+ .z1.fidonet.org . > $* $#ifmail $@ FIDO_SMART_HOST $: $1 < @ $2 .z1.fidonet.org > $3
516
+R$* < @ $+ .z2.fidonet.org . > $* $#ifmail $@ FIDO_SMART_HOST $: $1 < @ $2 .z2.fidonet.org > $3
517
+R$* < @ $+ .z3.fidonet.org . > $* $#ifmail $@ FIDO_SMART_HOST $: $1 < @ $2 .z3.fidonet.org > $3
518
+R$* < @ $+ .z4.fidonet.org . > $* $#ifmail $@ FIDO_SMART_HOST $: $1 < @ $2 .z4.fidonet.org > $3
519
+R$* < @ $+ .z5.fidonet.org . > $* $#ifmail $@ FIDO_SMART_HOST $: $1 < @ $2 .z5.fidonet.org > $3
520
+R$* < @ $+ .z6.fidonet.org . > $* $#ifmail $@ FIDO_SMART_HOST $: $1 < @ $2 .z6.fidonet.org > $3
522
+dnl****************************************************************************
524
+# trying to guess real internet domains
525
+C{NotFtn} fidonet ftp www smtp mail ns ns2 whois
526
+R$* < @ $={NotFtn}.$+.fidonet.org. > $* $: $1 < @ $2 . $3 .ip.fidonet.org. > $4
529
+dnl****************************************************************************
531
+# canonize fidotech domains.
532
+R$* < @ $+ .z1.fidonet.org > $* $: $1 < @ $2 .z1.fidonet.org. > $3
533
+R$* < @ $+ .z2.fidonet.org > $* $: $1 < @ $2 .z2.fidonet.org. > $3
534
+R$* < @ $+ .z3.fidonet.org > $* $: $1 < @ $2 .z3.fidonet.org. > $3
535
+R$* < @ $+ .z4.fidonet.org > $* $: $1 < @ $2 .z4.fidonet.org. > $3
536
+R$* < @ $+ .z5.fidonet.org > $* $: $1 < @ $2 .z5.fidonet.org. > $3
537
+R$* < @ $+ .z6.fidonet.org > $* $: $1 < @ $2 .z6.fidonet.org. > $3
538
+#R$* < @ $+ .crash.fidonet.org > $* $: $1 < @ $2 .crash.fidonet.org. > $3
539
+R$* < @ $+ .ftn > $* $: $1 < @ $2 .ftn. > $3
541
+dnl****************************************************************************