[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Poco Forums • View topic - timed deletion

timed deletion

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

timed deletion

Postby janrif » Sun Sep 05, 2004 3:04 am

As a former TB! devotee, I'm used to an option that allows the user to delete msgs left in a mailbox for a period of time, i.e. delete msgs older than ___ days.

For starters I'd like to apply such an action to msgs I've filtered to the junk folder, i.e. give me a day ot review the junk mail but then delete it from the mail box.

I may need to change my thinking as Poco is a different client so I'm open to all suggestions.

TIA
janrif
Ridgefield, CT USA
w2k-sp4
janrif
Resident Poster
 
Posts: 111
Joined: Mon Aug 30, 2004 11:53 pm
Location: CT, USA

Postby Michael » Fri Sep 10, 2004 2:35 am

Unfortunately at the moment PocoScript can only run against the currently selected message(s). This means that you would have to manually go to the "Junk Mail" mailbox, select the messages and then run the script. I have suggested a method to extend PocoScript to allow it to process multiple messages but I do not have any idea where this sits in terms of PSI priorities.

In order to be as flexible as possible it would also be nice to be able to define custom mailbox properties. This would enable someone to have a general purpose script that purges messages after a certain amount of time and to customize that time interval by mailbox.
Michael
Moderator
 
Posts: 866
Joined: Mon Jul 26, 2004 12:14 pm
Location: Victoria BC, Canada

Re: timed deletion

Postby Hogyt » Fri Sep 10, 2004 3:03 am

janrif wrote:As a former TB! devotee, I'm used to an option that allows the user to delete msgs left in a mailbox for a period of time, i.e. delete msgs older than ___ days.


A filter running from an event would be the best way to do this but unfortunately they're broken at the moment :(
Mat
Hogyt
Poco Enthusiast
 
Posts: 241
Joined: Thu Jul 29, 2004 11:22 am
Location: England

Postby Dreamer » Fri Sep 10, 2004 6:45 am

I needed to do a similer thing where I wanted to clear a certain mailbox everytime I closed Pocomail down. I ended up looking at the clearmailbox script, printing out the scripts help files and trying to work out what was going on in order to adapt it to my needs.

All the mails I want to keep only for a limited time are filtered into a certain mailbox. I now have a short script in the "Application Closing" part of events that deletes that mailbox everytime Pocomail is closed down.

Then on the "Application Start" tab of events I have another script which deletes that mailboxes .idx file (if I did that when closing down it just seemed to recreate itself and this file seems to cause the headers of deleted files to remain) and then the script recreates the mailbox.

This gives the impression that the mailbox has been emptied! The filters don't seem to get confused but I did need to create the mailbox manually a few times before it all sort of clicked in lol!

I'm no expert with scripts by any means and I'm sure this is really clumsy, but it works for me :)

Lloyd :)
Dreamer
Drop-in Visitor
 
Posts: 9
Joined: Sun Aug 01, 2004 11:18 am
Location: England

Postby Michael » Fri Sep 10, 2004 5:35 pm

The script Lloyd is using will only work if you want to empty the entire mailbox. What JanRif is wanting to do is delete all messages older than a certain amount of time. The filter concept might or might not work, it depends on whether or not the filter will be run against all messages in the mailbox when it fires via the OnTimer event (since this appears to be broken at the moment there is no way of knowing).
Michael
Moderator
 
Posts: 866
Joined: Mon Jul 26, 2004 12:14 pm
Location: Victoria BC, Canada

Postby Hogyt » Fri Sep 10, 2004 11:48 pm

The filter events problem #1131 has been changed to an enhancement request rather than a bug thanks to Pete description of the problem! It seems like the ideal way to handle situations such as timed deletion of old mail so lets see if the enhancement gets added :)
Mat
Hogyt
Poco Enthusiast
 
Posts: 241
Joined: Thu Jul 29, 2004 11:22 am
Location: England

Postby Michael » Sat Sep 11, 2004 4:10 am

I've also added a PocoScript enhancement request that would cover this (and much more). See item 1132.
Michael
Moderator
 
Posts: 866
Joined: Mon Jul 26, 2004 12:14 pm
Location: Victoria BC, Canada

Postby dribnus » Thu Oct 16, 2008 1:23 pm

Hello....Yes, I know this thread is about 4 years old, but I was just searching for a way to select multiple messages and have them deleted via a filter, events, script or any combination of the 3.
Has anyone seen any development on this? Maybe a script?
I am wanting to use this on a folder that is used only to forward gmail to my PDA. I could use the delete filter on all incoming, but then I don't get the desktop notification. So, I would like to find a way to delete these once a day automatically, so the mailbox won't grow in size.
dribnus
Poco Enthusiast
 
Posts: 221
Joined: Fri Jul 30, 2004 3:33 am

Postby Tomas » Fri Oct 24, 2008 10:19 am

dribnus wrote:I was just searching for a way to select multiple messages and have them deleted via a filter, events, script or any combination of the 3.
I could use the delete filter on all incoming, but then I don't get the desktop notification. So, I would like to find a way to delete these once a day automatically, so the mailbox won't grow in size.

If those messages can be filtered (by account, recipient, subject,...), setup a special folder for them where they will get filtered to.
Then use a script that will delete that folder (the mbx file), perhaps as na event on application closing.

Here is the script. It's adapted (cut out) from clearmailbox.poc by Michael Motek. In place of FolderName, use the real name of the folder as you see it in Pocomail.

Code: Select all
AddStrings $prefix $MailPath "FolderName"
Set $file $prefix
Set $file2 $prefix
AddStrings $file ".mbx"
AddStrings $file2 ".idb"
DeleteFile $file
DeleteFile $file2


(I didn't test it.)
Tomas
Tomas
Pillar of the Community
 
Posts: 1418
Joined: Sun Jul 25, 2004 1:34 am

Postby dribnus » Sat Oct 25, 2008 9:15 am

Thanx for the reply Thomas.....but I have figured a way around needing this, utilizing Gmail online as my mail client and storage of my 15000 emails. It has been working great for me. I do use the POP fetching with PM to just forward it as a text to my mobile.
dribnus
Poco Enthusiast
 
Posts: 221
Joined: Fri Jul 30, 2004 3:33 am


Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 0 guests

cron