autoresponder: email receptionist

MeepZor Free Software

autoresponder -- An Email Answering Script

A script for answering mail. Put it in your .forward or .qmail file, and it will reply to all incoming messages with the response you specify, optionally including the original message as an attachment.

Latest Release

The currently stable version of autoresponder is 1.16.7, released on 6 August 2002. It fixed a number of parsing problems and added the --verbose and --version options.

Downloading

You can download the package or any of its parts from the list at the bottom of this page.

Security

On Friday, 11 January 2002, someone reported to BUGTRAQ that the autoresponder package could be used by spammers to bypass filters. Essentially, the spammer S would send a message to an autoresponding address with a spoofed origin address R; the autoresponder would then 'reply' and send the spam to R, bypassing any controls it might have in place against S.

As of version 1.15.0, the autoresponder package provides additional controls to allow dealing with this and other spam-related scenarios:

Download

The files and package are available for download from the listing at the bottom of this page.

Mailing List

There is a mailing list for announcements and discussions about the autoresponder package. It is managed by Majordomo, so to join send a message containing the single word 'subscribe' in it to <autoresponder-discuss-request@MeepZor.Com>.


Man page for autoresponder

Until such time as more detailed documentation is written, I'll let the man page suffice. The information below was originally generated by man2html, but considerable frobbing of the output was necessary.


autoresponder(1) Updated: March 2002 Section: User Commands (1)

NAME

autoresponder - An Email Receptionist

 

SYNOPSIS

autoresponder --from email-address [--accept-for pattern] [--bcc address-list] [--cc address-list] [--edit-response] [--errors-to address-list] [--file reply-text-file] [--history-add email-address] [--history-db database-file] [--history-list] [--history-remove email-address] [--ignore-from pattern] [--ignore-header fieldname:pattern] [--ignore-interval seconds] [--ignore-precedence pattern] [--ignore-subject pattern] [--[no]include-original] [--precedence mailpri] [--sender email-address] [--subject printf-string] [--[no]verbose] [--version] [--work-dir directory]

 

DESCRIPTION

autoresponder is a rather hackish script to deal with incoming mail; a sort of email receptionist. It sends a standard reply back to the sender. It's designed to be invoked through .forward or .qmail files.

 

OPTION SYNTAX

Option values may be separated from their keywords by either an equals-sign ('=') or a space; the following are equivalent:

    --from john.doe@nowhere.com
    --from=john.doe@nowhere.com

Options are taken from the command line. If a ~/.autoresponderrc file exists, its contents are read and prefixed to the command line arguments. Blank lines, lines containing only whitespace, and lines beginning with a '#' (with or without leading whitespace) are treated as comments and ignored. The effect is equivalent to

    autoresponder `cat ~/.autoresponderrc` command-line-args

As a consequence, options in the ~/.autoresponderrc file may be specified either as one per line or multiple options per line, but '\' continuation characters should not be used.

Some options may appear on the command line more than once, such as

    --ignore-from foo --ignore-from bar

The individual option descriptions indicate whether this applies.

OPTIONS

--from email-address
The address to put into the 'From:' field of the response. Mail settings may prevent this from taking effect if this is not the same as the actually responding account; some systems take a dim view of such masquerades. Note: This option is required.
--accept-for pattern
Only reply if one or more of the specified regular expressions appears in the original message's To: or Cc: fields. In other words, don't reply to blind mailings. The default is to reply regardless of the recipient of the original message. Use this option with care, since it can block messages from mailing lists to which you are subscribed! This option may occur multiple times.
--bcc address-list
A comma-separated list of addresses to include in the response's Bcc field. The default is to have no Bcc list.
--cc address-list
A comma-separated list of addresses to include in the response's Cc field. The default is to have no Cc list.
--edit-response
Indicates that the contents of the response file (--file) should be modified and substitutions applied. If the file contains any of the following special sequences, they will be replaced as described:
%F
Replaced by the eddress information of the sender of the original message.
%L
The current local time is substituted. The offset from Universal is included.
%S
Replaced by the original subject of the message (after any reply prefixes have been removed).
%T
Replaced by the eddress to which the original message was sent.
%U
The current Universal (GMT) time is substituted.

Time values are formatted with strftime(3) using "%a, %d %b %Y %T"; this is based on the HTTP standard date syntax. %U string will have "GMT" appended, and %L string will have the local offset from Universal time appended (e.g., "-0800").

Note: For large response files this option can have a significant impact on the script's performance.

--errors-to address-list
A comma-separated list of addresses to include in the response's Errors-To field; these should receive notification of any problems if the response doesn't reach its destination. The default is to have no Errors-To list. Note: This header field is somewhat controversial, and may be ignored by many systems, which will use the one of the "From:", "From", or "Sender:" field values to report errors.
--file reply-text-file
The name of the file comprising the response text. Only text files are supported at this time. If omitted, the reply text sent is:
  This is an automatic response.  Your message has been
  received.
  
--history-add email-address
Adds the specified email address to the do-not-reply history database. The entry will be eligible for removal after the number of seconds specified by the --ignore-interval option. Only other history database options will be processed. Requires that the --history-db option be specified. This option may occur multiple times.
--history-db history-file
Specifies the name of an SDBM database to use to track responses so that a flood of inbound messages from the same address won't result in an equal-sized flood of outbound autoresponses. Include the directory path, but do not specify the .pag or .dir suffix.
--history-list
Displays the entries in the do-not-reply history database and when they become eligible to receive autoresponses. Only other history database options will be processed. Requires that the --history-db option be specified.
--history-remove email-address
Removes the specified address from the do-not-reply database. The address immediately becomes eligible to receive autoresponses. Only other history database options will be processed. Requires that the --history-db option be specified. This option may occur multiple times.
--ignore-from pattern
Specifies a regular expression pattern (see 'man perlre') used to match origins to which replies should not be sent. This option may occur multiple times. Matches are performed in a case-INSENSITIVE manner. This option may occur multiple times.
--ignore-header fieldname:pattern
Identifies the name of a field in the message header, and a regular expression pattern (see 'man perlre') against which to compare its value. If a match is detected, an autoresponse is not sent. Matches are performed in a case-INSENSITIVE manner. This option may occur multiple times.
--ignore-interval seconds
If history tracking is enabled, this value specifies the minimum number of seconds that must pass before another autoresponse will be sent to the same source address. For normal operations the minimum value allowed is 30 seconds; When used with --history-add, the minimum value is 0 (meaning never send an autoresponse). If omitted, the default is the minimum.
--ignore-precedence pattern
Specifies a regular expression pattern (see 'man perlre') used to match message precedences to which replies should not be sent. This option may occur multiple times. Matches are performed in a case-INSENSITIVE manner. This option may occur multiple times.
--ignore-subject pattern
Specifies a regular expression pattern (see 'man perlre') used to match the subjects of messages to which replies should not be sent. This option may occur multiple times. Matches are performed in a case-INSENSITIVE manner. This option may occur multiple times.
--[no]include-original
Indicates whether or not the original message should be included in the response as a MIME attachment. The default is to not attach the original message.
--no-reply-to pattern
Deprecated in release 1.11. Use --ignore-from instead.
--precedence mailpri
Specifies the precedence of the autoresponse message. The default value is "bulk".
--sender email-address
An email address to put into the message "From" field (distinct from the "From:" field). This is useful for environments which don't honour the Errors-To field. Defaults to the value of the --errors-to option if one is set, otherwise to the value of the --from option.
--subject printf-string
A string to be used when constructing the Subject: of the response message. "%s" in the string will be replaced by the subject of the original message, after removal of any leading "Re: " or "Sv: " strings. The default is "Re: %s".
--[no]verbose
Controls whether detailed processing messages are displayed. By default they are not.
--version
Displays the programme version and exits. Don't put this into your rc file, or the autoresponder won't do anything!
--work-dir directory
Specifies where temporary files should be placed; this may be important if large messages are sent to the autoresponder's address. The default value is "/tmp".

The conditional expressions (--ignore-from, --ignore-subject, and --ignore-precedence) are handled with a Boolean OR operation. That is, if any of the patterns match, the message will be ignored and no reply will be sent.

 

EXIT STATUS

autoresponder returns an exit status of 1 if there are problems with the command-line options. Otherwise, the exit status is zero indicating a successfully processed message.

 

EXAMPLES

All of these examples are of usage in .qmail files, and assume that the autoresponder script is invoked using the following single line in the .qmail file:

    | /home/doe/autoresponder-script

This is because .qmail files cannot contain continuation lines. Therefore, the examples show modifications to the autoresponder-script file, not the .qmail file proper.

If /home/doe/autoresponder-script contains:

#!/bin/sh
/home/doe/autoresponder \
    --from=john.doe@nowhere.com \
    --no-reply-to="MAILER-DAEMON@.*" \
    --ignore-header="X-Spam-Status:^yes" \
    --subject="On holiday (was: %s)" \
    --file=$HOME/vacation.txt
This will cause all messages received by the account to get an response back, unless the incoming message came from a MAILER-DAEMON address or the value of the X-Spam-Status header field starts with the word 'yes'. The subject of the response will be altered; if the original subject was "Meeting Tuesday", the subject of the automatic response would be "On holiday (was: Meeting Tuesday)". Note: If this is the only entry in the .qmail file, no copy of the original message will be kept.

/home/techsupport/archive/inbound.mbox
| /home/techsupport/autoresponder \
    --file=ack.txt \
    --from="Tech Support <donotreply@Nowhere.Com>" \
    --errors-to="human-response@Nowhere.Com" \
    --include-original \
    --work-dir=/home/techsupport/autoresponder.work
As a complete .qmail file, this will save the inbound message in an mbox-formatted file, and send an automatic reply back to the sender. The text of the reply will come from the file ack.txt, and the original message will be attached. The reply itself will not itself replyable-to; this should avoid loops when handling spam sent from a bogus address. Any errors encountered in the delivery of the reply may be sent to the 'human-response' address. Working files are created in the autoresponder.work subdirectory.
 

SECURITY CONSIDERATIONS

Use of the --work-dir option is strongly recommended. Otherwise, message files will be created in the default directory (/tmp), and sensitive information may be exposed.

Similarly, use of the history tracking and --accept-for capabilities are recommended to ward off spam.

 

RESTRICTIONS

In the work directory, autoresponder will create files for the incoming message and the result of parsing it. These files may or may not be automatically cleaned up depending upon the version of the MIME::Parser module you have installed. Older versions will require manual cleanup; a crontab entry such as the following may be appropriate:

0 * * * * touch workdir/marker && find workdir/ -cmin +60 -type f | xargs rm -f workdir/marker

This will delete on an hourly basis any work files that are more than an hour old.

 

FILES

workdir/regdata-*.data
workdir/*
database-file.dir, database-file.pag

 

SEE ALSO

Perl modules MIME::Parser, MIME::Entity, MIME::Base64, Mail::Address, Getopt::Long.


Download

Icon  Name                            Last modified      Size  Description
[DIR] Parent Directory - [TXT] ChangeLog 06-Aug-2002 13:43 5.1K Record of bug fixes and functionality changes [TXT] INSTALL 15-Jan-2002 16:46 713 Installation instructions [TXT] LICENCE.txt 15-May-2001 18:34 8.1K Software licence [TXT] MANIFEST 06-Aug-2002 13:43 558 Package manifest [TXT] Makefile.in 24-Apr-2002 06:03 1.0K autoconf input file [TXT] TODO 06-Aug-2002 13:46 779 Project wishlist [TXT] acinclude.m4 30-Mar-2002 00:45 2.2K M4 macro file (for autoconf) [   ] autoresponder-1.10.0.tar.gz 30-Dec-2000 15:40 4.9K gzipped tar archive [   ] autoresponder-1.10.1.tar.gz 14-Jan-2001 18:10 7.2K gzipped tar archive [   ] autoresponder-1.11.tar.gz 24-Jan-2001 22:24 7.3K gzipped tar archive [   ] autoresponder-1.12.0.tar.gz 15-May-2001 18:36 21K gzipped tar archive [   ] autoresponder-1.12.1.tar.gz 16-May-2001 22:12 21K gzipped tar archive [   ] autoresponder-1.12.2.tar.gz 17-May-2001 08:38 22K gzipped tar archive [   ] autoresponder-1.12.3.tar.gz 22-May-2001 08:21 24K gzipped tar archive [   ] autoresponder-1.13.0.tar.gz 01-Aug-2001 19:36 24K gzipped tar archive [   ] autoresponder-1.14.0.tar.gz 18-Sep-2001 15:10 24K gzipped tar archive [   ] autoresponder-1.15.0.tar.gz 15-Jan-2002 16:48 27K gzipped tar archive [   ] autoresponder-1.15.1.tar.gz 18-Jan-2002 16:08 27K gzipped tar archive [   ] autoresponder-1.15.2.tar.gz 25-Jan-2002 14:44 27K gzipped tar archive [   ] autoresponder-1.16.0.tar.gz 30-Mar-2002 00:50 29K gzipped tar archive [   ] autoresponder-1.16.1.tar.gz 12-Apr-2002 15:17 29K gzipped tar archive [   ] autoresponder-1.16.5.tar.gz 24-Apr-2002 14:00 31K gzipped tar archive [   ] autoresponder-1.16.6.tar.gz 29-May-2002 14:26 31K gzipped tar archive [   ] autoresponder-1.16.7.tar.gz 06-Aug-2002 14:12 32K gzipped tar archive [   ] autoresponder-1.16.7.tar.gz.asc 06-Aug-2002 14:13 366 PGP signature [TXT] autoresponder.1 06-Aug-2002 13:57 14K man page source [TXT] autoresponder.in 26-Jul-2003 20:19 23K autoconf input file [TXT] configure 29-May-2002 14:25 36K Installation configuration script [TXT] configure.in 12-Apr-2002 15:06 2.9K autoconf input file [TXT] install-sh 15-May-2001 18:33 5.5K Installation helper script