[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 - Automatically Delete Old E-mails

Automatically Delete Old E-mails

Help and advice on using PocoMail

Moderators: Eric, Tomas, robin

Automatically Delete Old E-mails

Postby Brian_E » Tue Oct 21, 2008 5:54 am

Is it possible to get PocoMail to automatically delete e-mails that are older than a specified age? I seem to remember that there may have been a Pocoscript to do such a thing. If so, has anyone used it and if so, does it work like it is supposed to do? If it is available via a Pocoscript, I presume that the script would have to be run manually from time to time, wouldn't it?
Brian_E
Drop-in Visitor
 
Posts: 10
Joined: Mon Oct 20, 2008 12:21 am

Re: Automatically Delete Old E-mails

Postby Eric » Tue Oct 21, 2008 6:04 am

Brian_E wrote:Is it possible to get PocoMail to automatically delete e-mails that are older than a specified age?
Unfortunately it won't do it automatically. :?
You'll have to select your messages, so the script can be run manually.
Eventually you could assign the script to a user button.

See script not working.

Enjoy. ;)
Eric
 

Postby Brian_E » Wed Oct 22, 2008 6:00 am

Unfortunately, the script doesn't want to work for me either. I selected some messages and set the period to one day, but nothing happened when I ran it.
Brian_E
Drop-in Visitor
 
Posts: 10
Joined: Mon Oct 20, 2008 12:21 am

Postby Eric » Wed Oct 22, 2008 6:11 am

Brian_E wrote:Unfortunately, the script doesn't want to work for me either. I selected some messages and set the period to one day, but nothing happened when I ran it.
Seems to work here just fine. :?

In case there's a problem with that script, I'll just post mine.
Code: Select all
{### Archive Old Mail
{ Script will archive any selected messages older
{ than a specified number of days to a specified folder

{ Usage: best used on Selected messages
{ To try it out, select some messages, setup this script
{ in Scripts/Setup, then run it in Scripts/Settings by
{ selecting it along the bottom and clicking on Now button

    { Initialize user settings: }
External $userdata1 "Archive messages older than: (days)" "30"
External $userdata2 "Which mailbox should I archive them to:%mailboxes%" "Archives"

    { Make sure message is appended to mailbox }
AppendToFile True
    { Get today's date }
GetDate $todaydate
    { Get message's date }
ReadHeader $messagedate "Date:" %message
    { Calculate the message age }
SubDays #diff $todaydate $messagedate

    { Compare the age to user setting }
if #diff > $userdata1 then PerformCopy
    { Exit if the difference is not greater }
Exit

    { If true, jump here and archive the message }
:PerformCopy
    { Load the mailbox filepath information }
AddStrings $UserData2 ".mbx"
SaveMessage %message $UserData2
    { Finally, deleting the original message }
DeleteMessage %message
Eric
 

Postby Brian_E » Fri Oct 24, 2008 7:01 am

Hi Eric

Actually, it does seem to be working now, but just in case, I've used your script.

Regards

Brian E
Brian_E
Drop-in Visitor
 
Posts: 10
Joined: Mon Oct 20, 2008 12:21 am

Postby Eric » Mon Oct 27, 2008 8:06 am

Glad 'my script' did work Brian. :)
Eric
 


Return to PocoMail Help and How-To

Who is online

Users browsing this forum: No registered users and 2 guests

cron