8 Vacation Automatic Message Reply

For automatically generated responses to email (autoreply), specifically vacation messages, the MTA uses Message Disposition Notifications (MDNs) and the Sieve scripting language. MDNs are email messages sent by the MTA to a sender and/or postmaster reporting on a message's delivery disposition. MDNs are also known as read receipts, acknowledgments, receipt notifications, or delivery receipts. The Sieve is a simple scripting language used to create mail filters.

This chapter describes the vacation autoreply mechanism. In most cases, you do not need to modify the default configuration. However, you might want to configure your system such that an MTA relay performs vacation processing rather than the back-end message stores.

Vacation Autoreply Overview

Vacation Sieve scripts are generated automatically from the various LDAP vacation attributes (see "Vacation Autoreply Attributes"). They can also be specified explicitly for additional flexibility. The underlying mechanism for tracking vacations is a set of files, one per intended recipient, that keep track of when replies were sent to the various senders.

By default, the MTA evaluates vacation on the back-end store systems. However, because MTA relays do not do as much work as back-end stores, for performance reasons, you can have the MTA evaluate vacation on the mail relay machines instead of on the back-end store. Use of this feature, however, can result in vacation responses being sent out more often than intended because different relays handle different messages. If you do not want vacation messages to be sent out more often than you intend, you may share the tracking of files between the relays. If this is also unacceptable to you, you can always have vacation evaluated on the back-end store systems.

Configuring Autoreply

Delivery addresses are generated through a set of patterns. The patterns used depend upon the values defined for the mailDeliveryOption attribute. One delivery address is generated for each valid mailDeliveryOption that is set in the recipient's LDAP entry. The patterns are defined by the setting of the delivery_options MTA option, which consists of a comma-separated list of option=pattern pairs. The default autoreply option=pattern pair is:

^*!autoreply=$M+$D@bitbucket

Table 8-1 shows the prefix characters used for the autoreply rule in the first column and their definitions in the second column.

Table 8-1 Prefix Characters for the Autoreply Rule in delivery_options

Prefix Character Definition

!

Enables the generation of the autoreply Sieve script.

#

Allows the processing to take place on relays.

^

Option is only evaluated if the vacation dates indicate that it should be evaluated.

*

Option is only evaluated for users, not groups.

@

Extracts preferred language information from various message header fields as well as from LDAP entries associated with envelope From: addresses. For this information to be available at the correct time, the message must pass through the reprocess channel when autoreply is engaged. This is done by adding the @ flag to the autoreply delivery option. The addition of a channel hop increases message processing overhead.


The autoreply rule itself specifies an address destined for the bitbucket channel. The mail is considered delivered by this method once the autoreply is generated, but the MTA machinery requires a delivery address. Anything delivered to the bitbucket channel is discarded.

To Configure Autoreply on the Back-end Store System

The default autoreply rule in delivery_options causes the autoreply to take place on the mail server that serves the user. If you want vacation messages to be evaluated on the back-end store system, you do not have to configure anything. This is the default behavior.

To Configure Autoreply on a Relay

If you want to evaluate vacation on the relay rather than on the back-end store system to enhance performance, add the # prefix to the autoreply pattern. This can be done by performing the following steps:

  1. Use the msconfig command to determine the current setting of delivery_options:

    msconfig
    msconfig> show delivery_options
    
  2. If the delivery_options MTA option is not set, determine the current default by using the show -default command and then cutting and pasting to set the option to that default:

    msconfig> show -default delivery_options
    delivery_options: *mailbox=$M%$\$2I$_+$2S@ims-ms-daemon,&members=*,*native=$M@native-daemon,/hold=@hold-daemon:$A,*unix=$M@native-daemon,&file=+$F@native-daemon,@members_offline=*,program=$M%$P@pipedaemon,#forward=**,^*!autoreply=$M+$D@bitbucket,#*&nomail=$M+$D@bitbucket
    msconfig> set delivery_options "*mailbox=$M%$\$2I$_+$2S@ims-ms-daemon,&members=*,*native=$M@native-daemon,/hold=@hold-daemon:$A,*unix=$M@native-daemon,&file=+$F@native-daemon,&@members_offline=*,program=$M%$P@pipe-daemon,#forward=**,^*!autoreply=$M+$D@bitbucket,#*&nomail=$M+$D@bitbucket"
    
  3. Once the option is set, you can use the edit option command to edit the option value and add the # if it is missing:

    msconfig# edit option delivery_options
    *mailbox=$M%$$2I$_+$2S@ims-ms-daemon,&members=*,*native=$M@native-daemon,/hold=@
    hold-daemon:$A,*unix=$M@native-daemon,&file=+$F@native-daemon,&@members_offline=
    *,program=$M%$P@pipe-daemon,#forward=**,^*!autoreply=$M+$D@bitbucket,#*&nomail=$
    M+$D@bitbucket
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    "/var/tmp/manage.jgaiy2" [Incomplete last line] 1 line, 254 characters
    
  4. After changing the delivery_options option, use the msconfig diff command to verify that you have made the correct change. Then write the change out after you have made sure that it is correct:

    msconfig# diff
    < role.mta.delivery_options = *mailbox=$M%$$2I$_+$2S@ims-ms-daemon,&members=*,*native=$M@native-daemon,/hold=@hold-daemon:$A,*unix=$M@native-daemon,&file=+$F@native-daemon,&@members_offline=*,program=$M%$P@pipe-daemon,#forward=**,^#*!autoreply=$M+$D@bitbucket,#*&nomail=$M+$D@bitbucket
    msconfig# write -remark="Enable autoreply processing on relays"
    

    Autoreply processing now takes place on the relays.

To Share Autoreply Information Between Relays

For information about sharing autoreply information between relays, see the discussion about the vacation_template autoresponse periodicity MTA option in Messaging Server Reference.

Vacation Autoreply Theory of Operation

The vacation action, when invoked, works as follows:

  1. Oracle Communications Messaging Server checks to make sure that the vacation action was performed by a user-level rather than a system-level Sieve script. An error results if vacation is used in a system-level script.

  2. The "no vacation notice" internal MTA flag is checked. If it is set, processing terminates and no vacation notice is sent.

  3. The return address for the message is checked next. If it is blank, processing terminates and no vacation notice is sent.

  4. The MTA checks to see if the user's address or any of the additional addresses specified in the :addresses tagged argument appear in a To:, Cc:, Resent-to:, or Resent-cc: header field for the current message. Processing terminates and no vacation notice is sent if none of the addresses is found in any of the header fields.

  5. Messaging Server constructs a hash of the :subject argument and the reason string. This string, along with the return address of the current message, is checked against a per-user record of previous vacation responses. Processing terminates and no response is sent if a response has already been sent within the time allowed by the :days argument.

  6. Messaging Server constructs a vacation notice from the :subject argument, reason string, and :mime argument. Two basic forms for this response message are possible:

    • A message disposition notification of the form specified in RFC 2298, with the first part containing the reason text.

    • A single part text reply. (This form is only used to support the "reply" autoreply mode attribute setting.)

The mailautoreplymode is automatically set to reply when vacation messages are configured through mshttpd.

The "no vacation notice" MTA flag is clear by default. It can be set by a system-level Sieve script through the use of the nonstandard novacation action. The novacation Sieve action is only allowed in a system-level Sieve script. It generates an error if it is used in a user-level script. You can use this action to implement site-wide restrictions on vacation replies such as blocking replies to addresses containing the substring "MAILER-DAEMON."

Per-user per-response information is stored in a set of flat text files, one per local user. The location and naming scheme for these files is specified by the setting of the mta.vacation_template option. This option should be set to a file: URL.

Maintenance of these files is automatic and controlled by the mta.vacation_cleanup integer MTA option setting. Each time one of these files is opened, the value of the current time in seconds modulo this value is computed. If the result is zero the file is scanned and all expired entries are removed. The default value for the option is 200, which means that there is 1-in-200 chance that a cleanup pass is performed.

The machinery used to read and write these flat text files is designed in such a way that it should be able to operate correctly over NFS. This enables multiple MTAs to share a single set of files on a common file system.

Vacation Autoreply Attributes

The set of user LDAP directory attributes that the vacation action uses are:

  • Attribute defined by the MTA option mta.ldap_autoreply_addressess This attribute provides the ability to generate :addresses arguments to sieve vacation. This option has no value by default. The attribute can be multivalued, with each value specifying a separate address to pass to the :addresses vacation option.

  • Attribute defined by mta.ldap_personal_name Alias processing keeps track of personal name information specified in this attribute and uses this information to construct From: fields for any MDNs or vacation replies that are generated. Use with caution to avoid exposing personal information.

  • vacationStartDate Vacation start date and time. The value is in the format YYYYMMDDHHMMSSZ. This value is normalized to GMT. An autoreply should only be generated if the current time is after the time specified by this attribute. No start date is enforced if this attribute is missing. The MTA can be instructed to look at a different attribute for this information by setting the mta.lda_start_date MTA option to a different attribute name. This attribute is read and checked by the code that generated the Sieve script. Vacation processing is aborted if the current date is before the vacation start date. This attribute cannot be handled by the script itself because at present Sieve lacks date/time testing and comparison facilities.

  • vacationEndDate Vacation end date and time. The value is in the format YYYYMMDDHHMMSSZ. This value is normalized to GMT. An autoreply should only be generated if the current time is before the time specified by this attribute. No end date is enforced if this attribute is missing. The MTA can be instructed to look at a different attribute for this information by setting the mta.ldap_end_date MTA option to a different attribute name. This attribute is and checked by the code that generated the Sieve script. Vacation processing is aborted if the current date is after the vacation end date. This attribute cannot be handled in the script itself because at present Sieve lacks date/time testing and comparison facilities.

  • mailAutoReplyMode Specifies autoreply mode for the user mail account. Valid values of this attribute are:

    • echo - Create a multipart that echoes the original message text in addition to the added mailAutoReplyText or mailAutoReplyTextInternal text.

    • reply - Send a single part reply as specified by either mailAutoReplyText or mailAutoReplyTextInternal to the original sender. These modes appear in the Sieve script as nonstandard :echo and :reply arguments to the vacation action. echo produces a "processed" message disposition notification (MDN) that contains the original message as returned content. reply produces a pure reply containing only the reply text. An illegal value does not manifest as any argument to the vacation action and this produces an MDN containing only the headers of the original message. Selecting an autoreply mode of echo causes an automatic reply to be sent to every message regardless of how recently a previous reply was sent. The MTA can be instructed to use a different attribute for this information by setting the mta.ldap_autoreply_mode MTA option to a different attribute name.

  • mailAutoReplySubject Specifies the contents of the subject field to use in the autoreply response. This must be a UTF-8 string. This value gets passed as the :subject argument to the vacation action. The MTA can be instructed to use a different attribute for this information by setting the mta.ldap_autoreply_subject MTA option to a different attribute name.

  • mailAutoReplyText Autoreply text sent to all senders except users in the recipient's domain. If not specified, external users receive no vacation message. The MTA can be instructed to use a different attribute for this information by setting the mta.ldap_autoreply_text MTA option to a different attribute name.

  • mailAutoReplyTextInternal Auto-reply text sent to senders from the recipients domain. If not specified, then internal users get the mail autoreply text message. The MTA can be instructed to use a different attribute for this information by setting the mta.ldap_autoreply_text_int MTA option to a different attribute name. The MTA passes either the mailAutoReplyText or mailAutoReplyTextInternal attribute value as the reason string to the vacation action.

  • mailAutoReplyTimeOut Duration, in hours, for successive autoreply responses to any given mail sender. Used only when mailAutoReplyMode=reply. If value is 0 then a response is sent back every time a message is received. This value is converted to the nonstandard :hours argument to the vacation action. (Normally the Sieve vacation action only supports the :days argument for this purpose and does not allow a value of 0.) If this attribute does not appear on a user entry, a default time-out is obtained from the mta.autoreply_timeout_default MTA option. The MTA can be instructed to use a different attribute for this information by setting the mta.ldap_autoreply_timeout MTA option.

The MTA can choose between multiple LDAP attributes and attribute values with different language tags and determine the correct value to use. The language tags in effect are compared against the preferred language information associated with the envelope from address. Currently the only attributes receiving this treatment are mta.ldap_autoreply_subject (normally mailAutoReplySubject), mta.ldap_autoreply_text (normally mailAutoReplyText), mta.ldap_autoreply_text_int (normally mailAutoReplyTextInternal), mta.ldap_spare_4, mta.ldap_spare_5, mta.ldap_prefix_text and mta.ldap_suffix_text.

It is expected that each attribute value has a different language tag value. If different values have the same tag value the choice between them is essentially random.

Other Auto Reply Tasks and Issues

This section describes auto reply tasks and issues not described in the configuration section.

To Send Autoreply Messages for Email That Have Been Automatically Forwarded from Another Mail Server

An autoreply problem can occur when the MTA receives a message that has been automatically forwarded from another system in some other administrative domain. For example, if a customer has a home account with example.com and the customer sets that account to automatically forward messages to their work account at example.org and if example.org uses Messaging Server and that user has set his account to autoreply a vacation message, then Messaging Server has a problem sending out a vacation message.

The problem occurs because the example.com mail server changes the envelope To: address from user@example.com to user@example, but it does not change the To: header, which remains user@example.com. When the MTA receives the message, it looks at the header address only. It attempts to match this address with an address in the LDAP user directory. If it finds a match with someone who has set autoreply, then a vacation message is sent. Because there is no LDAP address match to user@example.com, no vacation message is sent. The problem is that the actual address is in the envelope and not in the header.

Because the recipient's address known to the remote system doing automatic forwarding is not known to correspond to the user by the local system, there needs to be a way for the recipient to make such addresses known to the local system so vacation replies are sent when necessary.

The :addresses argument to the Sieve vacation action provides this capability. It accepts a list of addresses that correspond to the recipient for purposes of making this check. The attribute defined by the MTA option ldap_autoreply_addresses allows specification of such addresses in the user's LDAP entry.

To provide autoreply capability for messages that have been automatically forwarded from mail servers in some other administrative domain, the user or administrator would set the email addresses from where those messages may be forwarded to the attribute defined by mta.ldap_autoreply_addresses.