On the Settings → Message Archiving → General page there is the facility to add Extra Archive Actions - this topic documents that feature.
Extra Archive actions are actions which VPOP3 can perform when it is copying messages into the VPOP3 archive main store. They can be used to copy messages to other locations. They are an advanced feature and are not needed for the main VPOP3 archive functionality to work. In fact, if the extra actions do copy the archived messages elsewhere, VPOP3 cannot access those other locations automatically to retrieve messages, so that would have to be performed manually.
The archive actions which are currently available (in VPOP3 7.0) are:
•execute command
•encrypt
•compress
•ftp
•sftp
Each command must be entered on a line of its own, with the appropriate parameters as necessary, described below. VPOP3 processes actions in order from top to bottom, so the output of one action can be used as the input to a later action. For instance, if you want to compress and encrypt a file before FTPing it to a remote server, you could use the encrypt action, then feed the output of that to the compress action and then feed the output of that to the ftp action.
In the syntax descriptions below, items in [] are optional, items in <> replaced with relevant text, items in () indicate possible values, and | separates various possible values.
Any parameters which contain space characters should be surrounded with " quotes. If you want to include quotes in your parameters, use a pair of quote characters, ie ""
When performing actions, values surrounded by {} are "variable names". These can be generated by VPOP3 or by other actions. VPOP3 will replace these in any action parameters with the variable contents.
You can replace parts of variables by appending :x,y to the variable name, for instance {myvar:1,3} will give you characters 1 to 3 of the myvar variable.
If you want to use { or } characters in your parameters, use {{ or }} instead.
The built in variables are:
•{tempfn} - the source filename which VPOP3 is moving to the main store.
•{fn} - the target filename which VPOP3 is creating in the main store.
•{authsender} - the authenticated sender username (if any) of the message being archived.
•{subject} - the subject of the message being archived.
•{returnpath} - the return path email address of the message being archived.
In various commands, if the output option is specified, then VPOP3 will create a temporary filename and store it in that variable - for instance:
output=myfile
will create a temporary filename and put it into the {myfile} variable. These temporary files are deleted after all archive action process has finished (whether successful or not).
Execute an arbitrary command-line program or command.
The syntax is:
cmd: cmd="<command>" [output=<name>] [ignoreresult=(yes|no)] [timeout=(0-99)]
For instance, to copy the source file to a temporary file and store the temporary filename in the variable {copyfile} you could use
cmd:cmd = "copy ""{tempfn}"" ""{copyfile}""" output=copyfile
This will cause a command to be passed to cmd.exe such as: copy c:\vpop3\_archive\p12345abcdef.dat c:\vpop3\outqueue\t12345.dat
and for the remainder of the archive actions {copyfile} will be replaced with c:\vpop3\outqueue\t12345.dat
The command can be a built-in cmd.exe command, such as COPY or an external program designed to be run from a command-line.
The parameters are:
•cmd - the command to run (mandatory).
•output - if this is specified a temporary filename will be generated and put into the specified variable for use in cmd (optional).
•ignoreresult - yes or no (optional - defaults to no) - if the command doesn't return 0 (success) then the action will fail unless ignoreresult=yes is specified.
•timeout - a number from 1 to 99 seconds (optional - defaults to 60 seconds) - if the command doesn't complete in the specified time the action will fail.
Encrypt a file.
The syntax is:
encrypt: [input=<name>] output=<name> [type=(3des|aes256|blowfish|des)] password=<password>
For instance, to encrypt the filename in the variable {copyfile} to a file in {encfile} using blowfish encryption you could use
encrypt:input=copyfile output=encfile type=blowfish password="my password"
The parameters are:
•input - the file to encrypt (optional - defaults to {tempfn}).
•output - The name of the encrypted file.
•type - 3des, aes256, blowfish or des (optional - defaults to blowfish) - the type of encryption to use.
•password - the password to use for the encryption.
Compress a file.
The syntax is:
compress: [input=<name>] output=<name> [type=(zip|gzip|bzip2)] [password=<password>] [filename=<filename>] [compression=(0-9)]
For instance, to encrypt the filename in the variable {encfile} to a file in {compfile} using zip compression you could use. The zip file will contain the message as a file called 'mymessage.dat'.
compress:input=encfile output=compfile type=zip filename=mymessage.dat
The parameters are:
•input - the file to compress (optional - defaults to {tempfn}).
•output - The name of the compressed file to be created.
•type - zip, gzip or bzip2 (optional - defaults to zip) - the type of compression to use.
•password - the password to use to encrypt the file (optional - zip type only)
•compression - the level of compression (0 = less compression, quicker, 9 = more compression, slower) (optional - zip & gzip types only)
•filename - the filename of the compressed file inside the compressed archive file
Upload a file using FTP.
The syntax is:
ftp: [input=<name>] [ssl=none|ftps|ftpes|implicit|explicit)] [ccc=(yes|no)] host=<hostname> [passive=(yes|no)] [modez=(yes|no)] username=<username> password=<password> path=<target path> [checkcert=(yes|no)] [port=<port>]
For instance, to ftp the filename in the variable {compfile} to the server myftpserver.com with VPOP3's target filename you could use
ftp:input=compfile host=myftpserver.com username=myusername password=mypassword path=/store/{fn}
The parameters are:
•input - the file to upload (optional - defaults to {tempfn}).
•ssl - none, ftps, ftpes, implicit, explicit - type of SSL encryption to use. ftps and implicit are identical and indicate that FTP is performed on a different port from normal (usually 990). ftpes and explicit are identical and indicate that FTP is performed on the normal FTP port, and the connection is explicitly switched to encrypted once the connection has started. (optional - defaults to none)
•ccc - yes or no. Indicates whether the 'CCC' (Clear Command Channel) command is used. This makes FTP work better through firewalls, but requires support from the server. (optional - defaults to no. Only if SSL is used)
•host - the FTP server address/name
•passive - yes or no. Indicates whether passive FTP is used (optional - defaults to no)
•modez - yes or no. Indicates whether modez is used (on-the-fly compression). This requires server support. (optional - defaults to no)
•username - the username to log on to the FTP server
•password - the password to use to log on to the FTP server
•path - the path to store the uploaded file
•compression - the level of compression (0 = less compression, quicker, 9 = more compression, slower) (optional - zip & gzip types only)
•checkcert - yes or no. Indicates whether to check the FTP server certificate matches the server name (optional - defaults to no. Only if SSL is used)
•port - the FTP port to use (optional, defaults to 21)
If you are not sure about these, you should contact the FTP server administrator who should be able to help.
Upload a file using SFTP.
The syntax is:
sftp: [input=<name>] host=<hostname> username=<username> password=<password> path=<target path> [serverkeyfingerprints=<fingerprint>] [port=<port>]
For instance, to sftp the filename in the variable {compfile} to the server mysshserver.com with VPOP3's target filename you could use
sftp:input=compfile host=mysshserver.com username=myusername password=mypassword path=/store/{fn}
The parameters are:
•input - the file to upload (optional - defaults to {tempfn}).
•host - the SSH/SFTP server address/name
•username - the username to log on to the SSH/SFTP server
•password - the password to use to log on to the SSH/SFTP server
•path - the path to store the uploaded file
•serverkeyfingerprints - the SSH server finger print to allow (optional - defaults to allow any)
•port - the SFTP port to use (optional, defaults to 22)
If you are not sure about these, you should contact the SSH/SFTP server administrator who should be able to help.