Autoresponse

From test.coolscript.org
Jump to navigation Jump to search

With this script you can configure a automatic response email in case a new mail arrives (out of office).
There are various configuration possibilities to make sure that the autoresponse will not
blame you by eg responding to a forum or email groups.

Features[edit]

  • MySQL support to track the autoresponse status
  • Autoresponse tracks the sender so we we remeber the sender address and respond only onces.
  • Optional you can configure a static list to allow autosponse to use only.
  • Filters
    • By Sender or Domain
    • By Subject
  • Schedule
    • Optional Schedule by DateFrom / DateTo
  • Management
    • Can switch on/off autoresponse by email request




Requirements[edit]

  • Sendmail or any other MTA which is supporting procmail
  • MySQL
  • Perl



Procmail Configuration Sample[edit]

You can setup autorsponse within the procmail file: /home/username/.procmailrc
Sample for user john-public:

  • EMail: john-public@domain.com
  • Additional Apply Autoresponse: /usr/local/autoresponse/autoresponse-mail.pl john-public
    • Note that autoresponse-mail.pl requires the alias to be set in the first command argument
:0 c
* ^To.*@domain.com
| /path/to/autoresponse/autoresponse-mail.pl john-public


Alias Configuration Sample[edit]

Alternativ you can setup autorsponse within the alias file: /etc/aliases
Sample for user john-public:

  • EMail: john-public@domain.com
  • Alias (Mailbox): john-public
  • Additional Apply Autoresponse: /usr/local/autoresponse/autoresponse-mail.pl john-public
    • Note that autoresponse-mail.pl requires the alias to be set in the first command argument
john-public: john-public,"|/usr/local/autoresponse/autoresponse-mail.pl john-public"


After changes are made in the alias file then please set them by running:

#: newaliases


SQL Tables[edit]

Overview of SQL Tables:

Tables
Table ToBeEdit Description
alias Yes Alias data such as email,status and other settings
filter Yes Filter data to discard autoresponse messages
valid types are
  • mailfrom
  • subject
  • mailfromsubject
response_addresses No Tracking table for mailfrom addresses
static_addresses Yes Tracking table for static mailfrom addresses



Alias Table[edit]

Configuration table for all aliases

Tables
Table Description
enabled Enable switch for this alias
mailto_filter The mailto address, like john-public@domain.com
subject The autoresponse string, this can be any
body The body of the mail
date_from Filter for date-range, specify yyyy-mm-dd hh:mm
date_to Filter for date-range, specify yyyy-mm-dd hh:mm
display_name Mail display name (does not work properly)
use_default specify to use the default address filter or if you want to use your own
alias The alias name, this must be the same name as the previous used argument
demo Switch in Demo, that means that we will never send a autoresponse but behave like this.
check_cc Check the cc address too
check_subject Beta, we try to auresponse on a subject level. Not finished yet!
send_report If autoresponse becomes disabled and we see previous activity, then we will report those.
response_address Mail address for the above report function
mgmt_enabled Automatic switch on/off autoresponse by subject. Ready to test.
msg_on Ready to test.
msg_off Ready to test.



Filter Table[edit]

Configuration table for all aliases

Tables
Table Description
enabled Enable switch for this alias
aliasid The ID to the alias
type The ID to the alias, valid types: mailfrom, subject
filter_text Any text


Static Addresses Table[edit]

Purpose: Autoresponse ONLY to domains listed in this table Configuration table for all aliases

Tables
Table Description
enabled Enable switch for this alias
aliasid The ID to the alias
address Any text


Basic Configuration[edit]

Configurations, such as Logs, Mails, Sql are bein made in /etc/autoresponse.xml.


<?xml version="1.0"?>
<CONFIG>
 <Sql Server="localhost"  User="someuser" Pass="somepass"  Database="autoresponse"/>
 <Mail Enable="1" Server="localhost" MailAdmin="postmaster@domain.com"/>
 <Log SyslogServer="localhost"  Verbose="1"/>
</CONFIG>