I am trying to write a script that will update the Header in an Email with a value selected and then Mark a Message followed by opening web browser with the page to update the popfile link.
So far my script errors on both the Mark Message and when I try to update the header info in a message, but it runs the browser bit fine!
- Code: Select all
{### update_popfile_classification }
{ Script will update the popfile classificatino for message }
{ Please notee this has only been tested on Barca2 }
{ Usage: to be run manually }
InputBox $userdata1 "Select Bucket to Re-Classify Email to: %var%" "bills|blogs|orders|other|personal|search|spam|work"
{ ReadHeader $Class "X-Text-Classification:" %message
DeleteHeader "X-Text-Classification:" %message
AddHeader %message "X-Text-Classification:" $userdata1
AppendToFile True
SaveMessage %message $mailbox
DeleteMessage %message
If $userdata1 = "bills" Then bills
If $userdata1 = "blogs" Then blogs
If $userdata1 = "orders" Then orders
If $userdata1 = "other" Then other
If $userdata1 = "personal" Then personal
If $userdata1 = "search" Then search
If $userdata1 = "work" then work
Goto popfile
:Leave
MarkMessage $message 0
Exit
:bills
MarkMessage %message 3
GoTo popfile
:blogs
MarkMessage %message 6
GoTo popfile
:orders
MarkMessage %message 5
GoTo popfile
:other
MarkMessage %message 2
GoTo popfile
:personal
MarkMessage %message 4
GoTo popfile
:search
MarkMessage %message 8
GoTo popfile
:work
MarkMessage %message 7
GoTo popfile
:popfile
ReadHeader $Link "X-POPFile-Link:" %message
Execute $Link
GoTo Leave
When it tries to mark the message I get the following error, even though form what I can see I am using the correct syntax from the help:
First parameter for MarkMessage has to be a message variable (%var)
But when I try and run the update of the headers I get the following:
Variable not previously declared: $mailbox (if this is the case what do I use to tell the script which mailbox?)
Thanks,
Gavin,