[Oberon] Stream usage.

peter at easthope.ca peter at easthope.ca
Wed May 24 21:46:36 CEST 2023


Currently SMTP authentication in Oberon.Mail.Mod is hardcoded, similar 
to this.
  SendCmd(S, "AUTH", "PLAIN AHBldGVyQGVhc3Rob3BlLmNhAHBhc3N3b3Jk");
  
Better to use Base64.Encode in NetSystem.

MODULE NetSystem IN Oberon;
IMPORT ... Base64 IN A2, Streams IN A2, ...

VAR ...
  s: Streams.Stream;
  ...
IF service = "smtp"
  Out.String("User and password available.  Base64 encode and store in pass.passwd."); Out.Ln();
  (* Put 0X pass.user 0X pass.passwd in stream s. *)
  Base64.Encode(s);
  (* Put "PLAIN " s in pass.passwd. *)
END;

Then simplify the line in Mail.
  SendCmd(S, "AUTH", pass.passwd);

This is my first attempt to use a stream.  Can the one stream work as 
suggested above?

Thx,                         ... P.L.

- 
mobile: +1 778 951 5147
VoIP: +1 604 670 0140
sip:461697 at sip.diamondcard.us



More information about the Oberon mailing list