User Tools

Site Tools


reference:archive_script

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
reference:archive_script [2018/11/14 10:45] – external edit 127.0.0.1reference:archive_script [2023/03/25 23:33] (current) paul
Line 6: Line 6:
 The message headers will still be archived, along with the explanation text returned by the script. The message headers will still be archived, along with the explanation text returned by the script.
  
-The Lua script is stored in a file called **archive.lua** in the VPOP3 directory. VPOP3 calls a function called **ArchiveRules** which should have the following prototype:+The Lua script is stored in a file called **archive.lua** which is stored in the VPOP3 directory in VPOP3 v6.6 and earlier, or managed through the Settings → Scripts page in VPOP3 v6.7 and later. 
 + 
 +VPOP3 calls a function called **ArchiveRules** which should have the following prototype:
  
   ArchiveRules(<return path>, <subject>, <time>, <type>, <sender email>, <authenticated sender>, <ip address>, <message-id>, <size>, <attachments>, <recipients>, <references>, <header>, <content>)   ArchiveRules(<return path>, <subject>, <time>, <type>, <sender email>, <authenticated sender>, <ip address>, <message-id>, <size>, <attachments>, <recipients>, <references>, <header>, <content>)
Line 24: Line 26:
  
 If you need, we can produce a script for you, but there would be a cost for this - contact [[support@pscs.co.uk]] with a specification for a quote. If you need, we can produce a script for you, but there would be a cost for this - contact [[support@pscs.co.uk]] with a specification for a quote.
 +
 +=====Custom Archive Store functions=====
 +(from VPOP3 v8.4 onwards)
 +
 +These functions allow the archive to be stored on a non-standard file store - eg an FTP server, or Amazon S3-like system, etc. The functions can perform things like encryption, compression etc, as long as they can reverse the process correctly.
 +
 +There are a set of functions which perform uploads, downloads, check for presence of message file, etc.
 +
 +====CustomStore_Check====
 +
 +  CustomStore_Check()
 +  
 +  * Returns an empty string if the custom store is accessible, or an error response (which is logged) if it is inaccessible
 +
 +====CustomStore_Upload====
 +
 +  CustomStore_Upload(local_filename, archive_filename)
 +  
 +Uploads 'local_filename' and makes it accessible online as 'archive_filename'. In the future, the message will be referred to using 'archive_filename'
 +
 +  * Returns two values
 +    - Upload succeeded (true/false)
 +    - Want a local store as well (true/false)
 +
 +==== CustomStore_Get====
 +
 +  CustomStore_Get(archive_filename, local_filename)
 +  
 +Downloads 'archive_filename' and stores it locally as 'local_filename'
 +
 +==== CustomStore_CheckGet====
 +
 +  CustomStore_CheckGet(archive_filename)
 +  
 +Checks if 'archive_filename' is available on the custom store
 +
 +  * Returns true if the file is available
 +
 +
reference/archive_script.1542192349.txt.gz · Last modified: 2018/11/14 10:45 by 127.0.0.1