Re: Which application uses GNU JavaMail ?
Cedric Hyppolite <[email protected]> Wed, 15 Feb 2006 22:10:40 +0100
| Newsgroups | gmane.comp.java.classpath.extensions.discuss |
|---|---|
| Message-ID | <[email protected]> |
Actually, there is an issue with folder listing. It works only if the =20=
listed folder is not the default one. I got the listing of INBOX so I =20=
didn't notice.
To get it fully working, you need to change:
char sep =3D getSeparator();
String spec =3D
new StringBuffer(path).append(sep).append(pattern).toString();
into
String spec;
if (path.equals(""))
{
spec =3D pattern;
}
else
{
char sep =3D getSeparator();
spec =3D new =
StringBuffer(path).append(sep).append(pattern).toString=20
();
}
So the 'empty name' folder will get listed without a separator =20
character.
This does not change the fact that the folder type need the fix =20
explained below.
Bye,
Cedric
Le 15 f=C3=A9vr. 06 =C3=A0 21:08, Cedric Hyppolite a =C3=A9crit :
>
> Great !
> The patch work fine the listing of folders.
>
> However the type is still 2. The type is initialized in the =20
> constructor so the added code for setting the type is not executed.
>
> I think the following in getFolders
>
> int etype =3D entry.isNoinferiors() ?
> Folder.HOLDS_MESSAGES :
> Folder.HOLDS_FOLDERS;
> should be replaced with
> int etype =3D Folder.HOLDS_FOLDERS | Folder.HOLDS_MESSAGES;
>
> as this is only called from the listing function and creates only =20
> valid mailboxes.
>
> Ciao,
> Cedric
>
> Le 15 f=C3=A9vr. 06 =C3=A0 20:19, Chris Burdess a =C3=A9crit :
>
>> Cedric Hyppolite wrote:
>>> I used tcpflow with Gnu provider. Sun did take into account the =20
>>> mail.debug property so I got the command directly.
>>>
>>> Sun provider does:
>>> A6 LIST "" "INBOX/%"
>>> * LIST () "/" INBOX/sent-mail
>>> * LIST () "/" INBOX/JXTA
>>> * LIST () "/" INBOX/Pouic
>>> * LIST () "/" INBOX/spam
>>> * LIST () "/" INBOX/NonSpam
>>> * LIST () "/" INBOX/Apple
>>> A6 OK LIST completed
>>>
>>> where Gnu provider does:
>>> A10 LIST INBOX %
>>> * LIST () "/" INBOX
>>> A10 OK LIST completed
>>
>> These should be equivalent according to the IMAP4 spec. However, I =20=
>> attach a patch against CVS HEAD that should resolve this issue, if =20=
>> you wouldn't mind testing it.
>>
>>> - Another difference is that Sun provider gives the folder a type =20=
>>> 3 (holds folder & messages) where Gnu provider gives a type 2 =20
>>> (holds message).
>>
>> OK.
>>
>>> - Sun provider throws a FolderNotFoundException on listing of the =20=
>>> personal/user/shared namespace, where Gnu gives an empty array. I =20=
>>> prefers the GNU provider behaviour.
>>
>> Good
>>
>>> - On the logging problem: I am running under Eclipse, but that =20
>>> should not prevent logging from working as I use commons-logging =20
>>> and log4j without problems.
>>
>> GNU JavaMail uses the standard java.util.logging package which is =20
>> not the same as log4j. I don't know how Eclipse handles it, =20
>> perhaps you could try running from the command line?
>>
>>> Conclusion:
>>> On the folder type issue, I guess everything (but the root) =20
>>> should be of type 3 even if there is no 'inferior' folder for now =20=
>>> i.e. the API says for HOLDS_FOLDER: 'This folder CAN contain =20
>>> other folders'.
>>
>> I agree. I've also incorporated that algorithm into the patch. Let =20=
>> me know if this solves your problems, if so I will commit it.
>> --=20
>> =E7=8A=AC Chris Burdess
>> "They that can give up essential liberty to obtain a little safety
>> deserve neither liberty nor safety." - Benjamin Franklin
>>
>> <patch>
>>
>