You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Caa_man <ca...@acs-it.ru> on 2012/08/01 09:38:22 UTC

Problem with getting messages via POP3

Hi!

I use this route:
<route>
  <from
uri="pop3://mail:110?password=123456&amp;username=master@mail.example.com&amp;delete=true&amp;debugMode=true"/>
  <to uri="wmq:queue:OUT"/>
</route>

Processing is correct if only one message in mailbox. But a lot of messages
(f.e. n = 2) in mailbox cause strange processing:
1. All n messages were processed correctly: n messages appear in WebSphere
queue.
2. One message was deleted from mailbox.
3. After polling timeout go to step #1 with n-1 messages.

And debug log from SUN's Mail framework is:

12/08/01 12:51:13 S: +OK Microsoft Windows POP3 Service Version 1.0
<22...@mail.example.com> ready.
12/08/01 12:51:13 C: USER master@mail.example.com
12/08/01 12:51:13 S: +OK
12/08/01 12:51:13 C: PASS 123456
12/08/01 12:51:13 S: +OK User successfully logged on
12/08/01 12:51:13 C: STAT
12/08/01 12:51:13 S: +OK 2 796
12/08/01 12:51:13 C: TOP 1 0
12/08/01 12:51:13 S: +OK 398 octects
*HEADERS OF THE FIRST MESSAGE*

12/08/01 12:51:13 C: TOP 2 0
12/08/01 12:51:13 S: +OK 398 octects
*HEADERS OF THE SECOND MESSAGE*

12/08/01 12:51:13 C: RETR 1
12/08/01 12:51:13 S: +OK 398 octects
*HEADERS AND BODY OF THE FIRST MESSAGE*

12/08/01 12:51:13 C: RETR 2
12/08/01 12:51:13 S: +OK 398 octects
*HEADERS AND BODY OF THE SECOND MESSAGE*

12/08/01 12:51:13 C: *DELE 1*
12/08/01 12:51:13 S: +OK Message marked as deleted
12/08/01 12:51:13 C: *QUIT*
12/08/01 12:51:13 S: +OK Microsoft Windows POP3 Service Version 1.0
<22...@mail.example.com> signing off.

So we can see that the only the first message had been deleted before
session closed.

What's going on?



--
View this message in context: http://camel.465427.n5.nabble.com/Problem-with-getting-messages-via-POP3-tp5716652.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Problem with getting messages via POP3

Posted by Christian Müller <ch...@gmail.com>.
Which version of Camel do you use?

Sent from a mobile device
Am 01.08.2012 14:56 schrieb "Caa_man" <ca...@acs-it.ru>:

> Hi!
>
> I use this route:
> <route>
>   <from
> uri="pop3://mail:110?password=123456&amp;username=master@mail.example.com
> &amp;delete=true&amp;debugMode=true"/>
>   <to uri="wmq:queue:OUT"/>
> </route>
>
> Processing is correct if only one message in mailbox. But a lot of messages
> (f.e. n = 2) in mailbox cause strange processing:
> 1. All n messages were processed correctly: n messages appear in WebSphere
> queue.
> 2. One message was deleted from mailbox.
> 3. After polling timeout go to step #1 with n-1 messages.
>
> And debug log from SUN's Mail framework is:
>
> 12/08/01 12:51:13 S: +OK Microsoft Windows POP3 Service Version 1.0
> <22...@mail.example.com> ready.
> 12/08/01 12:51:13 C: USER master@mail.example.com
> 12/08/01 12:51:13 S: +OK
> 12/08/01 12:51:13 C: PASS 123456
> 12/08/01 12:51:13 S: +OK User successfully logged on
> 12/08/01 12:51:13 C: STAT
> 12/08/01 12:51:13 S: +OK 2 796
> 12/08/01 12:51:13 C: TOP 1 0
> 12/08/01 12:51:13 S: +OK 398 octects
> *HEADERS OF THE FIRST MESSAGE*
>
> 12/08/01 12:51:13 C: TOP 2 0
> 12/08/01 12:51:13 S: +OK 398 octects
> *HEADERS OF THE SECOND MESSAGE*
>
> 12/08/01 12:51:13 C: RETR 1
> 12/08/01 12:51:13 S: +OK 398 octects
> *HEADERS AND BODY OF THE FIRST MESSAGE*
>
> 12/08/01 12:51:13 C: RETR 2
> 12/08/01 12:51:13 S: +OK 398 octects
> *HEADERS AND BODY OF THE SECOND MESSAGE*
>
> 12/08/01 12:51:13 C: *DELE 1*
> 12/08/01 12:51:13 S: +OK Message marked as deleted
> 12/08/01 12:51:13 C: *QUIT*
> 12/08/01 12:51:13 S: +OK Microsoft Windows POP3 Service Version 1.0
> <22...@mail.example.com> signing off.
>
> So we can see that the only the first message had been deleted before
> session closed.
>
> What's going on?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Problem-with-getting-messages-via-POP3-tp5716652.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Problem with getting messages via POP3

Posted by Caa_man <ca...@acs-it.ru>.
Does anybody use MailComponent for obtaining messages via POP3? Or... Does
anybody test Camel-POP3 interaction with more than one message
simultaneously?



--
View this message in context: http://camel.465427.n5.nabble.com/Problem-with-getting-messages-via-POP3-tp5716652p5723761.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Problem with getting messages via POP3

Posted by Caa_man <ca...@acs-it.ru>.
Claus Ibsen-2 wrote
> 
> pop3 has limitations with delete/seen flags on processed mail messages.
> 
Sun mail framework works fine with several mail-msgs are obtained via pop3:
1) read n messages one by one from pop3
2) process n messages
3) mark processed messages for deletion (using pop3 command which is wrapped
by mail framework)
4) close pop3-"transaction"
As a result one iteration yields: n messages were processed and deleted from
mailbox.

But Camel's MailComponent doesn't work as I described above.



--
View this message in context: http://camel.465427.n5.nabble.com/Problem-with-getting-messages-via-POP3-tp5716652p5719407.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Problem with getting messages via POP3

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

pop3 has limitations with delete/seen flags on processed mail messages.
Use imap instead if possible.


On Wed, Aug 1, 2012 at 9:38 AM, Caa_man <ca...@acs-it.ru> wrote:
> Hi!
>
> I use this route:
> <route>
>   <from
> uri="pop3://mail:110?password=123456&amp;username=master@mail.example.com&amp;delete=true&amp;debugMode=true"/>
>   <to uri="wmq:queue:OUT"/>
> </route>
>
> Processing is correct if only one message in mailbox. But a lot of messages
> (f.e. n = 2) in mailbox cause strange processing:
> 1. All n messages were processed correctly: n messages appear in WebSphere
> queue.
> 2. One message was deleted from mailbox.
> 3. After polling timeout go to step #1 with n-1 messages.
>
> And debug log from SUN's Mail framework is:
>
> 12/08/01 12:51:13 S: +OK Microsoft Windows POP3 Service Version 1.0
> <22...@mail.example.com> ready.
> 12/08/01 12:51:13 C: USER master@mail.example.com
> 12/08/01 12:51:13 S: +OK
> 12/08/01 12:51:13 C: PASS 123456
> 12/08/01 12:51:13 S: +OK User successfully logged on
> 12/08/01 12:51:13 C: STAT
> 12/08/01 12:51:13 S: +OK 2 796
> 12/08/01 12:51:13 C: TOP 1 0
> 12/08/01 12:51:13 S: +OK 398 octects
> *HEADERS OF THE FIRST MESSAGE*
>
> 12/08/01 12:51:13 C: TOP 2 0
> 12/08/01 12:51:13 S: +OK 398 octects
> *HEADERS OF THE SECOND MESSAGE*
>
> 12/08/01 12:51:13 C: RETR 1
> 12/08/01 12:51:13 S: +OK 398 octects
> *HEADERS AND BODY OF THE FIRST MESSAGE*
>
> 12/08/01 12:51:13 C: RETR 2
> 12/08/01 12:51:13 S: +OK 398 octects
> *HEADERS AND BODY OF THE SECOND MESSAGE*
>
> 12/08/01 12:51:13 C: *DELE 1*
> 12/08/01 12:51:13 S: +OK Message marked as deleted
> 12/08/01 12:51:13 C: *QUIT*
> 12/08/01 12:51:13 S: +OK Microsoft Windows POP3 Service Version 1.0
> <22...@mail.example.com> signing off.
>
> So we can see that the only the first message had been deleted before
> session closed.
>
> What's going on?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Problem-with-getting-messages-via-POP3-tp5716652.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen