8 * C H _ B B O A R D S . C
10 * the new BBoards channel
13 * This is the channel that is used to handle Internet BBoard
14 * distribution in an intelligent fashion. In order to run it, you
15 * need the UCI BBoards facility installed. This requires the
16 * establishment of a special login called ``bboards'', and the
19 * The idea is simple. Distribution lists get aliased to go through
20 * this channel. Suppose that the relay (or site) using ch_bboards
21 * subscribes to UNIX-WIZARDS. The maintainer of the list is given
22 * the address ``dist-unix-wizards'' to send to for this relay and all
23 * sites that it serves. The site manager then defines the following
24 * alias in the aliases file:
26 * dist-unix-wizards: unix-wizards@dist-bboards
28 * This channel (and this channel alone) is then defined to serve the
29 * ``dist-bboards'' host. When it gets invoked, the channel does two
30 * things: First, if the relay itself subscribes to the BBoard (the
31 * bb_file entry in the BBoards file is non-empty), then it delivers
32 * the message to the file. Second, if other sites subscribe to the
33 * BBoard, then ch_bboards will enter the message back into the queue
34 * system using the ``bboards'' login as the sender.
36 * This achieves two goals: first, the incoming bandwidth of relays
37 * is not degraded by many sites subscribing to the same BBoard;
38 * second, if an address goes bad down the line, the relay's
39 * ``bboards'' login gets the message back (not the originator). Since
40 * the relay's PostMaster is assumed to monitor this mailbox, problems
41 * can be found and corrected.
43 * Finally, ch_bboards can be run by a site that does not relay for
44 * other sites. In this case, the bb_dist field is empty.
48 /* Unlike previous versions of ch_bboards, this version does not change
49 * the contents of the headers of the message being re-distributed.
50 * The following changes are made:
52 * Envelope: The failure address is changed to bboards@locname
53 * Headers: Another Received: is added
56 * The local copy going to the BBoard has two entries prepended to the
60 * BB-Posted: date/time
66 extern char logdfldir[];
68 extern struct ll_struct chanlog;
69 struct ll_struct *logptr = &chanlog;
82 ll_hdinit (logptr, "BB");
83 logptr -> ll_file = dupfpath (logptr -> ll_file, logdfldir);
86 signal (SIGINT, SIG_IGN);
88 if ((chanptr = ch_nm2struct (*argv)) == (Chan *) NOTOK)
89 err_abrt (RP_PARM, "unknown channel name '%s'", *argv);
91 retval = ch_bboards (argc, argv, chanptr);
99 ch_bboards (argc, argv, chanptr)
105 ll_log (logptr, LLOGBTR, "ch_bboards(argc=%d,*argv='%s')", argc, *argv);
108 if (rp_isbad (qu_init (argc, argv)))
110 if (rp_isbad (bb_init (chanptr)))
113 if (rp_isbad (qu2bb_send ()))
124 err_abrt (code, fmt, b, c, d)
131 char linebuf[LINESIZE];
136 sprintf (linebuf, "%s%s", "[abend: %s]", fmt);
137 ll_log (logptr, LLOGFAT, linebuf, rp_valstr (code), b, c, d);