pop3 fetch: deleting mails older than 5 days
[1/4] from: rene:villa-cossio at: 13-Jul-2003 10:22
Hello,
I try to write a "fetchmail"-clone. In the "library" I found some few-liners
for deleting mail on the
mail-server. But I want to delete mail older than 5 day and sometimes mail
with a specific "subject".
Hiw can this be solved?
cheers
Rene
[2/4] from: greggirwin:mindspring at: 13-Jul-2003 11:02
Hi Rene,
RSB> I try to write a "fetchmail"-clone. In the "library" I found some few-liners
RSB> for deleting mail on the
RSB> mail-server. But I want to delete mail older than 5 day and sometimes mail
RSB> with a specific "subject".
RSB> Hiw can this be solved?
I'm not a POP expert by any means, but I think you're going to have to
either use TOP or RETR to get the information you want, in order to
decide if you want to delete the message. In REBOL, you open the
mailbox, import each message, analyze it, and remove it if desired.
Using TOP might work as well. Maybe Graham, Phil, or another mail
expert can be more helpful.
-- Gregg
[3/4] from: philb::upnaway::com at: 14-Jul-2003 1:56
Hi Rene,
Think you can do it.
Cant remeber where this code came from .... (RT I think)
--------------------------------------------------------------------
attempt: does [
pop: open pop://user:[password--mail--server--com]/
lv-msgs: pop/locals/msg-nums
foreach mesg-num lv-msgs [
print ["Message" mesg-num]
insert pop/sub-port rejoin [ "TOP " pick pop/locals/msg-nums pop/state/index + mesg-num
" 0" ]
net-utils/confirm pop/sub-port [ none "+OK" ]
headers: pop/handler/read-til-dot pop make string! 1024
lv-em: import-email headers
print lv-em/date
]
close pop
]
attempt
--------------------------------------------------------------------
Just need to add the deletion code.
Cheers Phil
=== Original Message ===
Hi Rene,
RSB> I try to write a "fetchmail"-clone. In the "library" I found some few-liners
RSB> for deleting mail on the
RSB> mail-server. But I want to delete mail older than 5 day and sometimes mail
RSB> with a specific "subject".
RSB> Hiw can this be solved?
I'm not a POP expert by any means, but I think you're going to have to
either use TOP or RETR to get the information you want, in order to
decide if you want to delete the message. In REBOL, you open the
mailbox, import each message, analyze it, and remove it if desired.
Using TOP might work as well. Maybe Graham, Phil, or another mail
expert can be more helpful.
-- Gregg
[4/4] from: rene:villa-cossio at: 14-Jul-2003 9:03
Cool Script,
thank you....
cheers
Rene
--
Rene Schrader-Boelsche rene<at>villa-cossio.com
Heidberg 12 +49 (0)4194 988570
D-24641 Stuvenborn