Autoresponders (or ‘Out of office replies’) are supported by VPOP3. This article explains some of the advanced features of VPOP3’s autoresponders.
Autoresponders can be set by administrators by editing the user in the settings, and going to the Autoresponder tab, or by the user themselves by logging into their VPOP3 Webmail account and going to Tools -> Autoresponder. For this article we will be using the administration user interface, but the Webmail user interface is similar.
Multiple Autoresponders
The first thing to understand is that each user can have multiple autoresponders defined, with ‘rules’ telling VPOP3 when to use each autoresponder. VPOP3 will check each of the ‘rules’ in order until it finds an appropriate one, then it will trigger that autoresponder and then it will not check further rules.
This can mean that you can set up different autoresponders ahead of time, and have them scheduled to run when you wish, for instance, when you are on holiday, or at weekends, etc. You can also have different autoresponders for different senders, so you could send one autoresponse message to incoming messages and another one to internal messages.
Creating an Autoresponder
To create your autoresponder click on the Add Autoresponder button in the Autoresponder page.
Note that there are tips available on this page if you hover the cursor over the ? icons.
The Autoresponder Name is a name for your own use of the autoresponder. This could be something like “summer holidays”, etc. This is not sent to anyone else, it is just to help you manage the autoresponders.
The Response Text is the text of the autoresponder message. Usually this will be plain text, but for advanced use, you can enter HTML source code. If VPOP3 detects a <HTML> tag at the start of the message, it treats the message as HTML.
The Copy original message to setting lets you specify other people to receive the original message. This can be useful if you want someone else to deal with your messages while you are away. You can specify multiple addresses by separating them with spaces or commas.
Don’t send to the same sender within X hours tells VPOP3 not to send multiple autoresponse messages to the same sender within the specified time period. This can be useful to prevent people being swamped by your autoresponse messages.
The Autoresponder From address and Autoresponder Reply-To address settings specify where the autoresponse message should appear to come from, and where replies to that message should be sent. By default those are your username@your.default.domain. For most people that is OK, but if not, then you can change it here. If you specify the From address as Real Name <email.address@domain> then VPOP3 will handle that appropriately.
The Autoresponder Subject Prefix is text which is added onto the original subject when sending the autoresponse (eg ‘Re:’), the Autoresponder Subject is the entire subject used when sending the autoresponse.
Append Original Message tells VPOP3 whether to add the original message onto to the bottom of the autoresponse.
Send response to and Send response to original sender indicate where the automatic responses should go (the default is to just go to the original sender). You can specify multiple addresses by separating them with spaces or commas.
The Attachments section lets you upload attachments to be sent with the autoresponse message.
Autoresponder Templates
The VPOP3 administrator can create autoresponder templates in the Settings -> Autoresponder page in the VPOP3 settings. These are not editable by the user (but see the Macros section below), but can be used if you want to have a standard format for autoresponse messages. Users can select to use a template when defining autoresponder rules.
Autoresponder “Macros”
The autoresponder text (and Subject, Copy original message to and From in v6.12 and later) can contain special text which is expanded as the autoresponse is triggered. This can be a keyword surrounded by {} braces, a custom field defined as {$name[:default]}, or basic flow control commands {if ..}, {else} and {endif} or a comment {rem}
Simple Macros
The standard macros are:
- User – the account name of the user whose autoresponder is being triggered
- Originator – the email address of the incoming message sender
- Subject – the proposed subject of the autoresponse message
- OrigSubject – the subject of the incoming email message
- Date – the current date in the locale’s default format
- LongDate – the current date in the locale’s long format
- ShortDate – the current date in the locale’s short format
- Time – the current time in the locale’s default format
- TimeNoSecs – the current time in the locale’s default format (without seconds)
- ConditionName – the name of the autoresponder rule which was triggered
- ConditionDateFrom – the ‘From’ date of the autoresponder rule which was triggered
- ConditionDateTo – the ‘To’ date of the autoresponder rule which was triggered
- ConditionTimeFrom – the ‘From’ time of the autoresponder rule which was triggered
- ConditionTimeTo – the ‘To’ time of the autoresponder rule which was triggered
- ConditionDateTimeFrom – the ‘From’ date/time of the autoresponder rule which was triggered
- ConditionDateTimeTo – the ‘To’ date/time of the autoresponder rule which was triggered
- ConditionDOW – the Days-of-week of the autoresponder rule which was triggered
- ConditionMatches – the number of times this autoresponder rule has been triggered
- StartDate – the start date of the autoresponder rule (using DateFrom & DateTimeFrom) – in the locale’s long format (“unknown” if not specified)
- StartDate-1 – the day before the start date of the autoresponder rule – in the locale’s long format (“unknown” if not specified)
- EndDate – the end date of the autoresponder rule (using DateTo & DateTimeTo) – in the locale’s long format (“unknown” if not specified)
- EndDate+1 – the day after the end date of the autoresponder rule (using DateTo & DateTimeTo) – in the locale’s long format (“unknown” if not specified)
- Date:<format> – the current date in the specified format
- StartDate:<format> – the start date of the autoresponder rule in the specified format
- StartDate-1:<format> – the day before the start date of the autoresponder rule in the specified format
- EndDate:<format> – the end date of the autoresponder rule in the specified format
- EndDate+1:<format> – the day after the end date of the autoresponder rule in the specified format
- Time:<format> – the current time in the specified format
Date format specifiers
If the date macro has a custom format specified, VPOP3 uses the format specifiers as defined here
Time format specifiers
If the time macro has a custom format specified, VPOP3 uses the format specifiers as defined below:
- h – Hours with no leading zero for single-digit hours; 12-hour clock
- hh – Hours with leading zero for single-digit hours; 12-hour clock
- H – Hours with no leading zero for single-digit hours; 24-hour clock
- HH – Hours with leading zero for single-digit hours; 24-hour clock
- m – Minutes with no leading zero for single-digit minutes
- mm – Minutes with leading zero for single-digit minutes
- s – Seconds with no leading zero for single-digit seconds
- ss – Seconds with leading zero for single-digit seconds
- t – One character time marker string, such as A or P
- tt – Multi-character time marker string, such as AM or PM
Lua Script
You can include a Lua script segment by surrounding the Lua script with <lua> and </lua>. The output of any Lua ‘print’ commands is inserted into the autoresponse text at the location of the Lua script segment.
The Lua script will have access to a global table called Autoresponder with the following fields. Some of these can be modified by the script as shown below.
- ID – the internal numeric ID of the autoresponder
- OwnerID – the internal numeric ID of the autoresponder owner
- Name – the name of the autoresponder
- Text – the autoresponder text
- Keep – boolean whether the original message should be kept after responding (modifiable)
- CheckLog – numeric indicating how far back the autoresponder log should be checked for duplicate senders (modifiable)
- Sender – the email address the response should appear to come from (modifiable)
- ReplyTo – the email address replies to the response should go to (modifiable)
- Subject – the autoresponder subject setting (modifiable)
- SubjectPrefix – the autoresponder subjectprefix setting (modifiable)
- AppendMsg – whether the original message should be appended to the autoresponse message (modifiable)
- To – a table containing a list of addresses for the response to be sent to (modifiable)
- CopyTo – a table containing a list of addresses for the original message to be copied to (modifiable)
- Attachments – a table containing a list of attachment names to be added to the autoresponse message (modifiable)
Comments
If you include text like {rem a comment} this will be omitted from the response message – this can be useful to comment complex autoresponders
Custom Fields
If you include text like {$name} then a custom field called ‘name’ will be included in the response message. When configuring an autoresponder rule to refer to this autoresponder, the user will be prompted to enter data for this field.
If you add (defaulttext) after the name, then that text will be used if the user does not enter data.
For instance {$manager (theboss@mycompany.com)} will prompt the user for a field called ‘manager’. If the user enters some data there, then that value will be used in space of this macro, but if the user leaves that field blank, the text ‘theboss@mycompany.com’ will be used instead.
Custom field names can include the characters a-z, 0-9 and _, but must begin with a letter.
Flow Control
Autoresponders can include basic flow control statements based on custom fields.
{if $name}
This inserts a block of text if the custom field ‘name’ is set.
{ifnot $name}
This inserts a block of text if the custom field ‘name’ is not set.
{else}
This inserts a block of text if the previous {if}/{ifnot} was not matched
{endif}
This terminates the conditional statement
For instance, you could use:
{if $alternatecontact} Please contact {$alternatecontact} while {user} is away until {enddate+1} {else} Please contact sales@ourcompany.com while {user} is away until {enddate+1} {endif}
Autoresponder Rules
To create or edit an autoresponder rule click on Add Rule in the Autoresponder page. Remember VPOP3 will check the rules in order, stopping at the first one whose conditions match. You can reorder rules as appropriate.
Again the Rule Name is just for your own reference.
The Autoresponder option lets you choose the autoresponder to use if this rule’s conditions match. You can choose any user rules, rule templates or <None>. <None> lets you define conditions where no autoresponder will trigger.
Enable this rule enables this rule, if the rule is disabled, then it is ignored, just as if it was not present.
Prevent user changes for this autoresponder stops the user from changing this rule via the Webmail settings.
The Conditions section lets you define the conditions under which this rule will match. Note that the Sender and Subject conditions are what the incoming messages should contain for the rule to match, NOT what the autoresponse message will contain!
The Custom Fields section contains any custom fields used by any Macros in the autoresponse message.