bug in ZOE?

"Rene Kanzler" <[email protected]> Mon, 08 Jan 2007 18:36:37 +0100
Newsgroups gmane.mail.zoe.general
Message-ID <[email protected]>
This is a MIME-formatted message.  If you see this text it means that your
mail software cannot handle MIME-formatted messages.

--=_0_12394_1168277797_000
Content-Type: text/plain; charset="utf-8"; format=flowed
Content-Transfer-Encoding: 7bit

Hi 

I am in the process of configuring postfix to send a copy of a incomming
message to the ZOE SMTP server. 

The authentication went well until the part of the MAIL FROM:, it has
the AUTH=<> parameter. I tested the ZOE server with telnet to port
10025, put all the data needed (also the base64 login and pass), and
the message was rejected with the reason "501 Invalid sender address". 

The message was accepted when I remove the AUTH=<> from the MAIL FROM
line.
So, to solve the problem I went to the source and find the reason
for the rejectet sender address in SZSMTPMail.java. The Java InternetAddress
validator rejects the "aString".
I edited the SZSMTPMail.java file, remove the AUTH=<> and compiled the
source and all went well. The patched file is attached. 

Postfix use the AUTH=<> parameter as described in the RFC 2554.
So, maybe this is a bug in ZOE? 

Bye,
Rene

--=_0_12394_1168277797_000
Content-Disposition: attachment;
  filename="SZSMTPMail.java"
Content-Type: text/x-java; charset="utf-8";
  name="SZSMTPMail.java"
Content-Transfer-Encoding: quoted-printable

//=0D
//=09=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=0D
//=0D
//=09Title:=09=09SZSMTPMail.java=0D
//=09Description:=09[Description]=0D
//=09Author:=09=09Rapha=91l Szwarc <zoe (underscore) info (at) mac (dot) =
com>=0D
//=09Creation Date:=09Mon Sep 9 2002=0D
//=09Legal:=09=09Copyright (C) 2001 Rapha=91l Szwarc. Some Rights Reserve=
d.=0D
//=0D
//    modified by Rene <rk (at) cosmomill (dot) de> on January 3, 2007, 1=
1:51=0D
//=0D
//=09This work is licensed under the Creative Commons Attribution-NonComm=
ercial License. =0D
//=09To view a copy of this license, visit http://creativecommons.org/lic=
enses/by-nc/2.0/ =0D
//=09or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanfor=
d, California 94305, USA. =0D
//=0D
//=09--------------------------------------------------------------------=
-------=0D
//=0D
=0D
package alt.dev.szsmtp;=0D
=0D
import javax.mail.internet.InternetAddress;=0D
=0D
import java.io.PrintWriter;=0D
=0D
import java.util.List;=0D
=0D
import alt.dev.szfoundation.SZString;=0D
import alt.dev.szfoundation.SZLog;=0D
=0D
final class SZSMTPMail extends SZSMTPCommand=0D
{=0D
=0D
//=09=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=0D
//=09Constant(s)=0D
//=09--------------------------------------------------------------------=
-------=0D
=0D
=09private final static String=09Name =3D "MAIL";=0D
=09private static Pattern pattern;=0D
=09private static Matcher matcher;=0D
=09=0D
//=09=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=0D
//=09Class variable(s)=0D
//=09--------------------------------------------------------------------=
-------=0D
=0D
//=09=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=0D
//=09Instance variable(s)=0D
//=09--------------------------------------------------------------------=
-------=0D
=0D
//=09=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=0D
//=09Constructor method(s)=0D
//=09--------------------------------------------------------------------=
-------=0D
=0D
=09SZSMTPMail()=0D
=09{=0D
=09=09super();=0D
=09}=0D
=0D
//=09=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=0D
//=09Class method(s)=0D
//=09--------------------------------------------------------------------=
-------=0D
=0D
//=09=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=0D
//=09Instance method(s)=0D
//=09--------------------------------------------------------------------=
-------=0D
=0D
=09String name()=0D
=09{=0D
=09=09return SZSMTPMail.Name;=0D
=09}=0D
=09=0D
=09int state()=0D
=09{=0D
=09=09return SZSMTPSession.Authenticated;=0D
=09}=0D
=09=0D
=09boolean execute(SZSMTPSession aSession, PrintWriter aWriter, List some=
Tokens)=0D
=09{=0D
=09=09if ( super.execute( aSession, aWriter, someTokens ) =3D=3D true )=0D
=09=09{=0D
=09=09=09if ( aSession.sender() =3D=3D null )=0D
=09=09=09{=0D
=09=09=09=09aSession.reset();=0D
=09=09=09=09=0D
=09=09=09=09if ( ( someTokens !=3D null ) && ( someTokens.size() > 0 ) )=0D
=09=09=09=09{=0D
=09=09=09=09=09String=09aToken =3D (String) SZString.componentsJoinedBySt=
ring( someTokens, " " );=0D
=09=09=09=09=09int=09anIndex =3D aToken.indexOf( ':' );=0D
=09=09=09=09=09=0D
=09=09=09=09=09if ( anIndex > 0 )=0D
=09=09=09=09=09{=0D
=09=09=09=09=09=09String=09aString =3D aToken.substring( 1 + anIndex ).tr=
im();=0D
=09=09=09=09=09=09=0D
=09=09=09=09=09=09try=0D
=09=09=09=09=09=09{=0D
=09=09=09=09=09=09=09pattern =3D Pattern.compile("(AUTH|auth)=3D<[^>]*>")=
;=0D
=0D
=09=09=09=09=09=09=09matcher =3D pattern.matcher(aString);=0D
=0D
=09=09=09=09=09=09=09aString =3D (matcher1.replaceAll(""));=0D
=09=09=09=09=09=09=09=0D
=09=09=09=09=09=09=09InternetAddress=09anAddress =3D new InternetAddress( =
aString );=0D
=09=09=09=09=09=09=09=0D
=09=09=09=09=09=09=09aSession.setSender( anAddress );=0D
=0D
=09=09=09=09=09=09=09aWriter.println( "250 OK" );=0D
=09=09=09=09=09=09}=0D
=09=09=09=09=09=09catch(Exception anException)=0D
=09=09=09=09=09=09{=0D
=09=09=09=09=09=09=09SZLog.debug( anException + " : " + aString );=0D
=0D
=09=09=09=09=09=09=09aWriter.println( "501 Invalid sender address" );=0D
=09=09=09=09=09=09}=0D
=09=09=09=09=09}=0D
=09=09=09=09=09else=0D
=09=09=09=09=09{=0D
=09=09=09=09=09=09aWriter.println( "501 Usage: MAIL FROM:<sender>" );=0D
=09=09=09=09=09}=0D
=09=09=09=09}=0D
=09=09=09=09else=0D
=09=09=09=09{=0D
=09=09=09=09=09aWriter.println( "501 Usage: MAIL FROM:<sender>" );=0D
=09=09=09=09}=0D
=09=09=09}=0D
=09=09=09else=0D
=09=09=09{=0D
=09=09=09=09aWriter.println( "503 Sender already specified" );=0D
=09=09=09}=0D
=09=09}=0D
=0D
=09=09return true;=0D
=09}=0D
=09=0D
}=0D

--=_0_12394_1168277797_000
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--=_0_12394_1168277797_000
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Zoe-General mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/zoe-general

--=_0_12394_1168277797_000--