Debian Codegraph @

doc/html/fmtmesfi.htm

raw
1 <HTML>
2 <HEAD>
3 <TITLE>Message filtering (Appendix 16)</TITLE>
4 </HEAD>
5 <BODY BACKGROUND="/back_fbb.jpg">
6 <P>
7 <IMG SRC="/fbb.gif" WIDTH="32" HEIGHT="32">
8 <H1 ALIGN=Center>
9 Message filtering<SMALL>.</SMALL>
10 </H1>
11 <P ALIGN=Center>
12 (Appendix 16)
13 <P>
14 <PRE>
15
16 FBB software allows filtering messages. Filtering is not done by the BBS
17 software but by external programs developed by users.
18
19 When the BBS starts, the M_FILTER does not really need to be there. But at
20 the first message, it must exist. If it does not exist at THAT time, it will
21 not be checked again. So if a M_FILTER is added after that, the BBS must be
22 rebooted for the filter to take effect.
23
24 M_FILTER may be interactive and allows to incorporate some features like
25 dedicated information for predefined callsigns, password filtering, etc...
26
27 I did not develop such programs, but this is an open door to many
28 applications.
29
30 The M_FILTER program must be found by the PATH of MsDos. Its extension can
31 be COM or EXE, and it must be little and fast as multitasking is stopped
32 during the activity of this program. If this program is not found, it will
33 not be called until the BBS is rebooted.
34
35 The M_FILTER may also be created as a DLL. Both for WinFBB and DosFBB (!!).
36 The filter must be installed in the path (\FBB\BIN) of Dos.
37
38 The message filter is called (if found) each time a message is ready to be
39 recorded (when Ctrl Z or /EX is received). The decision to validate or not
40 the message is function of the exit value of the M_FILTER program.
41
42 The M_FILTER program (if found) is called with some arguments including a
43 level number. This number is incremented each time the program is called in
44 the same connection session. The first time the level number will be 0.
45
46 The line arguments given to the M_FILTER program are :
47
48 - File name including the text of the message.
49 - Type of the message (P, B, T).
50 - Sender.
51 - "To" field.
52 - Record number of DIRMES.SYS file.
53
54 The M_FILTER program ends with an exit value. This value is very important
55 and tells the BBS what to do :
56
57 0 : Message is recorded.
58 1 : Message is killed (status = K).
59 2 : Message is archived (status = A).
60 3 : Message is held (status = H).
61
62
63 /*
64 * M_FILTER.C
65 *
66 * The message filter MUST be named M_FILTER (COM or EXE).
67 *
68 * This example only writes its call arguments in the TEST.MES file.
69 *
70 * It is called with 5 arguments :
71 * File name of the message.
72 * Type .
73 * Sender.
74 * To.
75 * Number of the record in the DIRMES.SYS file.
76 *
77 * If it returns 0 : The message is accepted.
78 * 1 : The message is killed (status K).
79 * 2 : The message is archived (status A).
80 *
81 */
82
83 #include &lt;stdio.h&gt;
84 main(argc, argv)
85 int argc;
86 char **argv;
87 {
88 int i;
89 FILE * fptr = fopen("TEST.MES", "at");
90
91 for (i = 0 ; i &lt; argc ; fprintf(fptr, "%s ", argv[i++]));
92 fputc('\n', fptr);
93
94 fclose(fptr);
95
96 return(0);
97 }
98
99
100
101
102
103
104 <A HREF="doc.htm"><IMG SRC="/contents.gif" WIDTH="108" HEIGHT="28"></A>
105
106 <A HREF="/"><IMG SRC="../button_home.gif" WIDTH="90" HEIGHT="29"></A>
107
108 <FONT COLOR="#800000">This page was last updated <!--#config timefmt="%d-%b-%y"--><!--#echo var="LAST_MODIFIED"--></FONT>
109
110 </PRE>
111 </BODY></HTML>