CAPA not supported on qpopper

Nov 6, 2009 at 2:27 PM

If the POP3 server does not supported "CAPA" (get capabilities) such as on qpopper earlier than 3.0 the subsequent "UIDL" commands returns an unexpected result.

The end result is that the 'leave mail on server' function of P3SS does not work as ascpected (mails are send over to the SMTP server on every collection round abd UIDL errors are logged).

Skipping the CAPA step fixes the problem for this particular POP3 server (pop.xs4all.nl) but maybe the code should be changed so that the CAPA step is optional depending on the POP3 server type and version.

 

Best regards,

Peter Blom

 

 

 

Coordinator
Nov 7, 2009 at 7:03 AM

Can you please post what the server returns for the CAPA and UIDL commands? (You may have to turn on debug mode)

Additionally, are you sure that the server actually supports UIDL?

Thanks,
Daniel

Coordinator
Nov 8, 2009 at 6:06 AM

Can you please test the 0.2.3 Pre-Release: http://p3ss.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35589

I haven't removed CAPA from it yet - but I did change the way that Unique IDs are collected; so this may help.

Nov 9, 2009 at 8:23 AM

The POP3server response to CAPA (after PASS is OK) is: [-ERR Unimplemented.] or [+OK Kappa 10-4\r\n]. I am not sure what the reason is for this. (Timing issue ?)

If the server responds with +OK…, the next UIDL command returns:

TOP

USER

UIDL

LAST

RESP-CODES

.

Which are the servers capabilities, but fails in P3SS as an expected response of UIDL.

Subsequent UIDL commands return an expected UIDL listings such as:

+OK UIDL listing follows

1 1257754456._smtp.mxdrop224.31271,S=4967

2 1257754459._smtp.mxdrop118.91755,S=4967

Nov 9, 2009 at 8:41 AM
Edited Nov 9, 2009 at 2:52 PM

With 0.2.3. the CAPA / UIDL issue is fixed…


Coordinator
Dec 8, 2009 at 1:25 PM

Can you please double-check that this is still fixed with the final 0.2.3 release?

 

Dec 10, 2009 at 7:11 PM

Sorry for the inconvenience but the CAPA issues is not solved in the 0.2.3. pre-release I tested.  

For test purposes I skipped over the CAPA stuff in Connect():

if (response.StartsWith("+OK"))

{

                            // Not supported by QPOP version lower than 3.0

                            serverCapabilities = "";

                            /*

                              response = innerProtocol.WriteCommand("CAPA");

                              if (response.StartsWith("+OK"))

                             {

                                   serverCapabilities = response;

                             }

                             else

                             {

                                   serverCapabilities = "Server responded incorrectly:\r\n" + response;

                             }*/

                        }

and of course unchecked the leave mail on server option. I am not sure what the root cause of the problem is… Sometimes the server responds with an expected CAPA list but on other occasions it responds  with an unexpected response.

Another issue is with SubmitMail (..) .  The regex for extracting the From address in an email expects the literal “From:”

Regex fromRegex = new Regex(@"From:[^:]*?(""[^""]*"")?[^:]*?([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]*)");

Some  mail such as the one sent by Team Foundation Server have a lowercase from literal. The causes P3SS to processes the mail as failed because it has no from address.  I changed the regex to:

Regex fromRegex = new Regex(@"[Ff]rom:[^:]*?(""[^""]*"")?[^:]*?([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]*)");

Which is working OK.

After these changes P3SS is working very stable in a test an environment with external ISP and an internal Exchange 2003 Sever…

Van: TehPenguin [mailto:notifications@codeplex.com]
Verzonden: dinsdag 8 december 2009 14:25
Aan: Peter Blom
Onderwerp: Re: CAPA not supported on qpopper [p3ss:74317]

From: TehPenguin

Can you please double-check that this is still fixed with the final 0.2.3 release?

Read the full discussion online.

To add a post to this discussion, reply to this email (p3ss@discussions.codeplex.com)

To start a new discussion for this project, email p3ss@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Dec 10, 2009 at 7:12 PM

Sorry for the inconvenience but the CAPA issues is not solved in the 0.2.3. pre-release I tested.

For test purposes I skipped over the CAPA stuff in Connect():

if (response.StartsWith("+OK"))

{

// Not supported by QPOP version lower than 3.0

serverCapabilities = "";

/*

response = innerProtocol.WriteCommand("CAPA");

if (response.StartsWith("+OK"))

{

serverCapabilities = response;

}

else

{

serverCapabilities = "Server responded incorrectly:\r\n" + response;

}*/

}

and of course unchecked the leave mail on server option. I am not sure what the root cause of the problem is… Sometimes the server responds with an expected CAPA list but on other occasions it responds with an unexpected response.

Another issue is with SubmitMail (..) . The regex for extracting the From address in an email expects the literal “From:”

Regex fromRegex = new Regex(@"From:[^:]*?(""[^""]*"")?[^:]*?([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]*)");

Some mail such as the one sent by Team Foundation Server have a lowercase from literal. The causes P3SS to processes the mail as failed because it has no from address. I changed the regex to:

Regex fromRegex = new Regex(@"[Ff]rom:[^:]*?(""[^""]*"")?[^:]*?([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]*)");

Which is working OK.

After these changes P3SS is working very stable in a test an environment with external ISP and an internal Exchange 2003 Sever…

Coordinator
Dec 11, 2009 at 4:23 AM
Edited Dec 11, 2009 at 4:24 AM

I've changed the latest 0.2.4.1 pre-release to enable disabling CAPA (pre-account) and to have the more lenient regex.

A note on the fromRegex, RFC 5322 specifies that the 'From' header must have a capital 'F' (http://tools.ietf.org/html/rfc5322#section-3.6.2), that said, its probably best if P3SS (and any other mail client) is lenient towards the standards.

Dec 28, 2009 at 10:43 AM

Hi, (everywith works fine, we have 42 mailboxes). Where could i get the pre release? :) . We have over 32000 emails here in ONE mailbox cause... u know .-)

Coordinator
Dec 30, 2009 at 4:16 PM

Pre-release is available here: http://p3ss.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=37002

(Or you can go to the "Downloads" tab, and select "Planned" in the "Releases" box in the top right of the page)