[Mono-list] [PATCH] System.Web.Mail.SmtpStream

Piers Haken piersh@friskit.com
Mon, 28 Apr 2003 17:32:02 -0700


If you're getting picky about the RFC then you should probably also
remove the space between the ':' and the '<'...

Piers.

> -----Original Message-----
> From: Tobias DiPasquale [mailto:toby@cbcg.net]=20
> Sent: Monday, April 28, 2003 5:12 PM
> To: mono-list@ximian.com
> Subject: [Mono-list] [PATCH] System.Web.Mail.SmtpStream
>=20
>=20
> Hello all,
>=20
> It came to my attention recently that the SmtpStream class as=20
> implemented in Mono is not RFC-compliant. All addresses in=20
> MAIL and RCPT commands must be wrapped in "<>". I have=20
> created a patch against the latest CVS to fix this particular=20
> problem, inlined below. Thanks!
>=20
> P.S. I wasn't sure how this project liked its patch files, so=20
> I created this one in the same manner that the Linux kernel=20
> creates theirs. The fix is so small that it should not be=20
> hard to apply if the patch format is wrong. Thanks again!
>=20
> P.P.S. I noticed that SmtpMail is listed as having 3 methods=20
> missing. Which are those? The ToString(), GetHashCode(),=20
> GetType() and Equals() methods were inaccessible to me, as I=20
> could not instantiate an instance of the SmtpMail class (this=20
> was with MS.NET SDK 1.1 on Windows). Anybody have a clue for=20
> me on this one? I'd love to finish this class up...
>=20
> <patch>
>=20
> 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=09
> 2003-03-12
> 23:20:03.000000000 +0000
> +++ mcs_NEW/class/System.Web/System.Web.Mail/SmtpStream.cs=09
> 2003-04-28
> 23:11:30.000000000 +0000
> @@ -50,7 +50,7 @@
>  	}
>  =09
>  	public void WriteMailFrom( string from ) {
> -	    command =3D "MAIL FROM: " + from;
> +	    command =3D "MAIL FROM: <" + from + ">";
>  	    WriteLine( command );
>  	    ReadResponse();
>  	    CheckForStatusCode( 250 );
> @@ -58,7 +58,7 @@
>  	}
>  =09
>  	public void WriteRcptTo( string to ) {
> -	    command =3D "RCPT TO: " + to; =20
> +	    command =3D "RCPT TO: <" + to + ">";
>  	    WriteLine( command );
>  	    ReadResponse();
>  	    CheckForStatusCode( 250 );
>=20
> </patch>
>=20
> --=20
> Tobias DiPasquale
> 88FA 30C9 1E63 CFE2 CBD8  37C4 DA1C E2BF 1D26 F036 http://cbcg.net/
>=20