[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 - Undo for move to Trash

Undo for move to Trash

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

Undo for move to Trash

Postby eek » Mon Mar 02, 2009 6:23 am

Hi,
I'd like to have a script that works like Undo, for when I delete an email I didn't mean to. I'd like the script to move the last email sent to trash back to the current mailbox. I can't figure out how to do this. Is it possible? If so, could someone let me know how?
Thanks,
eek
New Arrival
 
Posts: 4
Joined: Mon Mar 02, 2009 6:19 am

Postby Eric » Mon Mar 02, 2009 6:28 pm

Hi eek & welcome to Poco Forums, :D

I'm not sure, but I don't think it would be possible the way you want it.

How would the script know the location from where this messsage was deleted :?:

As I already said, better wait until someone has another suggestion or tells me I'm wrong. :wink:
Eric
 

Postby eek » Mon Mar 02, 2009 11:25 pm

Hi Eric,

Thanks. What about just taking the last email deleted and moving it to Inbox? I know how to move an email with a script, but don't know how to identify the last email deleted.
eek
New Arrival
 
Posts: 4
Joined: Mon Mar 02, 2009 6:19 am

Postby Tomas » Tue Mar 03, 2009 1:14 am

eek wrote:I know how to move an email with a script, but don't know how to identify the last email deleted.

Scripts only work against selected messages.

What you are looking for is impossible.

Well...not absolutely impossible.

Last deleted message would get appended at the end of Trash.mbx file, as last record.

Just brainstorming here:
It shall be possible to use some scripting language, perhaps Python, or anything else depending on what you know and which of them has good library for parsing mbx files.
Pocoscript would simply call the Python script, Python script would read last message appended to Trash.mbx and append it to In.mbx.

Except I have no idea how well it would work with Poco, as In.mbx would be updated (unless there would be some error, eg. file locked and impossible to write to) but the index file In.idb wouldn't.
I guess that might be fixed by having the Pocoscript wait for certain time and then compress the In folder, but can't vouch for it.
Tomas
Tomas
Pillar of the Community
 
Posts: 1418
Joined: Sun Jul 25, 2004 1:34 am


Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 1 guest

cron