[Oberon] Re. Spamfilter for Oberon

easlab at absamail.co.za easlab at absamail.co.za
Sun May 2 14:10:39 CEST 2004

Edgar wrote:-
> because it really was too much (More than 100 spams daily nowadays) 
> I invested
> half a day to hack Mail.Mod so that it allows me to drop spam mails to a 
> spam file.
> Now a question for ETHZ. Is the spamfilter a student is doing finished ?
> I would like to add it to my existing rules.

Well I can't comment on your specific question, but since you had
to unpack and get your hands dirty [familiarise your self with the 
algorithms] you might put this on the fix list:-
 * because the mail-panel didn't work [the transport protoccol]
     in about 1999, I used TextMail.*. And also I prefer to handle
    individual mails - I think Mail.Mod can't fetch single posts from 
    the server  ?
 * the design is based on the fact the USUALLY [in those days]
    the server would start like:
 " Hello my friend, you have 9 mails ...."
   So the client scanned the string to extract the first 'integer':
      9 in this example, and set 'something' accordingly.
 * when I changed my ISP, the server said eg.:
     "   ....NetNovel ver 3.04 ...bla bla"
     and the pointer was set to show only the 3 first mails.
    Since I leave more than 3 mails at the server, this was disasterous,
      and I had to patch the code - which was based on an assumption
      instead of the RFC.
As I remember the solution was to use the RFC 'comand' "STAT"
 which asks?tells about the server-dir-size.

?? I wonder if Mail.Mod makes the same invalid assumption ??

== Chris Glur.

Right now, I can't find the latest source,  but 
TextMail.Mod.Bak\d == 30.10.2002 22:12:18   23470
where I can see my changes in colour might tell something ?
Here are the coloured/edit lines extracted from the mess !
Refer to the "General ETH Oberon System Source License" contract available at: http://www.oberon.ethz.ch/ *)
(* 2002 Sept 14 ABSA trace  host, user, passwd  & incr len: user,passwd *)

	IMPORT Files, Texts, TextFrames, CRGtrace, Out,

	PROCEDURE OpenPop(VAR S: NS.Connection; host: ARRAY OF CHAR; 
                                          VAR mails: INTEGER): BOOLEAN;
	VAR s: ARRAY 256 OF CHAR; i: INTEGER;  user, passwd: ARRAY 64 OF CHAR;  (* previously 16 *)
		Connect(S, host, POP, res);
		IF res = 0 THEN 
NS.ReadString(S, s);  CRGtrace.LablVal(s,77);
FOR i := 0 TO 79 DO Out.Char(s[i]) END;  

			IF s[0] = "+" THEN
				user := "";  NS.GetPassword("pop", host, user, passwd);
(* CRGtrace.LablVal(host,1); CRGtrace.LablVal(user,2); CRGtrace.LablVal(passwd,3);  *)

				SendCmd(S, "user", user); s[1] := "1";
NS.ReadString(S, s); CRGtrace.LablVal(s,1);
				IF s[0] = "+" THEN SendCmd(S, "pass", passwd); s[1] := "2";
NS.ReadString(S, s);
CRGtrace.LablVal(s,2);  (* +OK=   2  *)
(* FFC1939 STAT command in TRANSACTION state *)
SendCmd(S, "STAT", ""); NS.ReadString(S, s); CRGtrace.LablVal(s, 4);
					IF s[0] = "+" THEN	(*+OK user has N message(s) (X octets).*)
						i := 4; WHILE (s[i] < "0") OR (s[i] > "9") DO INC(i) END;
						mails := 0;
						WHILE (s[i] >= "0") & (s[i] <= "9") DO
						  mails := 10*mails + ORD(s[i])-30H; INC(i)
						END;  CRGtrace.LablVal(s,mails);
FOR i := 0 TO 62 DO Out.Char(s[i]) END;  
					ELSE String("wrong password"); Ln
				ELSE String("no such user"); Ln
			ELSIF s[0] = 0X THEN String("timed out"); Ln
		ELSE String("no connection"); Ln
	END OpenPop;

More information about the Oberon mailing list