[Mono-list] [PATCH] System.Web.Mail.SmtpStream
Per Arneng
pt99par@student.bth.se
Mon, 28 Apr 2003 17:34:41 -0400
Hi!
I created that class and probably missed that :) thanx for pointing it out.
Changed it just now If you have any other things that you have found that is
inccorrect then please mail them.
SmtpMail btw has a private constructor so it can not be instantiated.
Thnx!
Best regards
Per Arneng
On Monday 28 April 2003 20.11, Tobias DiPasquale wrote:
> Hello all,
>
> It came to my attention recently that the SmtpStream class as
> implemented in Mono is not RFC-compliant. All addresses in MAIL and RCPT
> commands must be wrapped in "<>". I have created a patch against the
> latest CVS to fix this particular problem, inlined below. Thanks!
>
> P.S. I wasn't sure how this project liked its patch files, so I created
> this one in the same manner that the Linux kernel creates theirs. The
> fix is so small that it should not be hard to apply if the patch format
> is wrong. Thanks again!
>
> P.P.S. I noticed that SmtpMail is listed as having 3 methods missing.
> Which are those? The ToString(), GetHashCode(), GetType() and Equals()
> methods were inaccessible to me, as I could not instantiate an instance
> of the SmtpMail class (this was with MS.NET SDK 1.1 on Windows). Anybody
> have a clue for me on this one? I'd love to finish this class up...
>
> <patch>
>
> diff -Naur mcs/class/System.Web/System.Web.Mail/SmtpStream.cs
> mcs_NEW/class/System.Web/System.Web.Mail/SmtpStream.cs
> --- mcs/class/System.Web/System.Web.Mail/SmtpStream.cs 2003-03-12
> 23:20:03.000000000 +0000
> +++ mcs_NEW/class/System.Web/System.Web.Mail/SmtpStream.cs 2003-04-28
> 23:11:30.000000000 +0000
> @@ -50,7 +50,7 @@
> }
>
> public void WriteMailFrom( string from ) {
> - command = "MAIL FROM: " + from;
> + command = "MAIL FROM: <" + from + ">";
> WriteLine( command );
> ReadResponse();
> CheckForStatusCode( 250 );
> @@ -58,7 +58,7 @@
> }
>
> public void WriteRcptTo( string to ) {
> - command = "RCPT TO: " + to;
> + command = "RCPT TO: <" + to + ">";
> WriteLine( command );
> ReadResponse();
> CheckForStatusCode( 250 );
>
> </patch>