IMO a better option would be to create a subclass of %Net.SMTP and copy and modify the GetResponse() method code uncommenting that line.
Then use this class instead of %Net.SMTP.
This way you don't need "to mess" system classes, change system database configuration (RW in IRISLIB) and then you have full control of the code.
Something like:
Class My.Net.SMTP Extends %Net.SMTP
{
/// Get response to mail command. Use timeout as specified by RFC1123.
Method GetResponse(timeout As %Integer, ByRef responseArray As %String) As %String [ Internal, Private ]
{
#define SMTPTRACE
#ifdef SMTPTRACE
#define TraceInit try { kill ^SmtpTrace } catch { set killsave=$zu(68,28,0) kill ^SmtpTrace do $zu(68,28,killsave) }
#define TraceNext(%line) set ^SmtpTrace($increment(^SmtpTrace))=%line_"<<"_$zb
#else
#define TraceInit
#define TraceNext(%line)
#endif
#define WriteText(%text) $$$TraceNext(">>"_%text) write %text
#define WriteLine(%text) $$$WriteText(%text),!
kill responseArray
set line=""
do {
read line:timeout
else do ..SetStatus($$$ERROR($$$SMTPTimeout)) set line=""
set responseArray($increment(responseArray))=line
$$$TraceNext(line)
} while $extract(line,4)="-"
quit line
}
}- Log in to post comments