| View previous topic :: View next topic |
| Author |
Message |
Uffe Kousgaard Guest
|
Posted: Thu Feb 19, 2004 9:48 pm Post subject: POP3 - deleting e-mails |
|
|
Consider this scenario:
count:= idPOP3.CheckMessages;
// Do some checks, decide that message 2 out of 5 has to be deleted. In
the meantime one more e-mail has arrived. Will message 2 still be the
same one?
idPOP3.delete(2);
When I look at the source code for the delete command, it just sends the
number directly to the server, so how can we be sure what happens, if
new e-mails arrive or other applications also delete e-mails? Such as a
mail client would normally do.
TIA
Uffe
|
|
| Back to top |
|
 |
eshipman Guest
|
Posted: Thu Feb 19, 2004 10:01 pm Post subject: Re: POP3 - deleting e-mails |
|
|
In article <40352f3b$2 (AT) newsgroups (DOT) borland.com>, "Uffe Kousgaard"
<look_at_www.routeware.dk> says...
| Quote: | Consider this scenario:
count:= idPOP3.CheckMessages;
// Do some checks, decide that message 2 out of 5 has to be deleted. In
the meantime one more e-mail has arrived. Will message 2 still be the
same one?
idPOP3.delete(2);
When I look at the source code for the delete command, it just sends the
number directly to the server, so how can we be sure what happens, if
new e-mails arrive or other applications also delete e-mails? Such as a
mail client would normally do.
|
I suppose that you will need to write code to make sure that the
Message-ID is the same as the one you want to delete.
|
|
| Back to top |
|
 |
Chad Z. Hower aka Kudzu Guest
|
Posted: Thu Feb 19, 2004 10:05 pm Post subject: Re: POP3 - deleting e-mails |
|
|
"Uffe Kousgaard" <look_at_www.routeware.dk> wrote in news:40352f3b$2
@newsgroups.borland.com:
| Quote: | // Do some checks, decide that message 2 out of 5 has to be deleted. In
the meantime one more e-mail has arrived. Will message 2 still be the
same one?
idPOP3.delete(2);
When I look at the source code for the delete command, it just sends the
number directly to the server, so how can we be sure what happens, if
new e-mails arrive or other applications also delete e-mails? Such as a
mail client would normally do.
|
POP3 is transactional. Message numbers do not change while you are connected,
and new mail will not be seen either.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Want more Indy stuff? Try the Atozed Indy Portal at
http://www.atozedsoftware.com/
* More Free Demos
* Free Articles
* Extra Support
|
|
| Back to top |
|
 |
Uffe Kousgaard Guest
|
Posted: Thu Feb 19, 2004 10:09 pm Post subject: Re: POP3 - deleting e-mails |
|
|
"Chad Z. Hower aka Kudzu" <cpub (AT) hower (DOT) org> wrote
| Quote: |
POP3 is transactional. Message numbers do not change while you are
connected,
and new mail will not be seen either.
|
Thanks a lot.
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Feb 19, 2004 10:26 pm Post subject: Re: POP3 - deleting e-mails |
|
|
"Uffe Kousgaard" <look_at_www.routeware.dk> wrote
| Quote: | In the meantime one more e-mail has arrived. Will
message 2 still be the same one?
|
Yes. The message is not actually deleted from the mailbox until your client
disconnects from the server. Until that time, the message is simply marked
for deletion and still physically exists, but it is not actually deleted
yet, although any further operations on that message will fail from that
moment on.
| Quote: | how can we be sure what happens, if new e-mails arrive
or other applications also delete e-mails?
|
Because the POP3 protocol specs dictate what should happen. First off,
multiple clients can't log in at the same time anyway, email servers don't
allow that. When new email is added while you are still logged in, it is
simply added to the end of the mailbox, existing messages are not touched.
Gambit
|
|
| Back to top |
|
 |
Alex Brainman Guest
|
Posted: Fri Feb 20, 2004 2:02 am Post subject: Re: POP3 - deleting e-mails |
|
|
Remy Lebeau (TeamB) wrote:
| Quote: |
Yes. The message is not actually deleted from the mailbox until your client
disconnects from the server.
|
AFAIR, you must issue "QUIT" command for that, simple disconnect does not removes "pending deleted" messages.
Alex
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Feb 20, 2004 4:02 am Post subject: Re: POP3 - deleting e-mails |
|
|
"Alex Brainman" <brainman (AT) sussan (DOT) com.au> wrote
Remy Lebeau (TeamB) wrote:
| Quote: | you must issue "QUIT" command for that
|
TIdPop3.Disconnect() does exactly that.
Gambit
|
|
| Back to top |
|
 |
Alex Brainman Guest
|
Posted: Fri Feb 20, 2004 4:20 am Post subject: Re: POP3 - deleting e-mails |
|
|
Remy Lebeau (TeamB) wrote:
| Quote: | you must issue "QUIT" command for that
TIdPop3.Disconnect() does exactly that.
|
It might well do "under the hood", but you said:
| Quote: | ... The message is not actually deleted from the mailbox until your client
disconnects from the server. ...
|
and that is not quite the same.
Furthermore, the fact that Indy POP3 component "hides" the event as important as "Commit all those changes to my mail box I've done just now" is just bit sus ... what if I change my mind and do NOT want to commit, but leave all my deleted messages intact?
Alex
|
|
| Back to top |
|
 |
Chad Z. Hower aka Kudzu Guest
|
Posted: Fri Feb 20, 2004 5:37 am Post subject: Re: POP3 - deleting e-mails |
|
|
"Alex Brainman" <brainman (AT) sussan (DOT) com.au> wrote in
news:40358b0f (AT) newsgroups (DOT) borland.com:
| Quote: | Furthermore, the fact that Indy POP3 component "hides" the event as
important as "Commit all those changes to my mail box I've done just
now" is just bit sus ... what if I change my mind and do NOT want to
commit, but leave all my deleted messages intact?
|
The POP3 protocol does not support that. The only way to do that is just drop
the connection - which will cause POP3 servers to think there was an error
and back out.
But that its NOT the intended design or how POP3 is meant to work. Thats just
error recovery.
If you dont want messages deleted - dont delete them. This is a safeguarde of
POP3 - NOT a feature set.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Want to keep up to date with Indy?
Join Indy News - it free!
http://www.atozed.com/indy/news/
|
|
| Back to top |
|
 |
Alex Brainman Guest
|
Posted: Sun Feb 22, 2004 10:29 pm Post subject: Re: POP3 - deleting e-mails |
|
|
Chad Z. Hower aka Kudzu wrote:
| Quote: | ... This is a safeguarde of
POP3 - NOT a feature set.
|
You can play with words, Chad ... <BG>
Alex
|
|
| Back to top |
|
 |
|