On 09-Feb-06 Ian Douglas wrote:
Hi Folks,
My little business currently has an automated brochure service describing the products we sell. The company has an "info" email address to which people can send keywords and receive an automatically generated email response describing that particular product. At the moment this "autoresponder" function is carried out by an ancient PC chugging away in a forgotten corner running Microsoft Outlook Express and using this program's message filtering rules to select and return the appropriate email/s in response to the keywords in incoming emails. It seems to work quite well and reliably but I was wondering if there was a Linux email prog which we could run on our fileserver to do this? I looked at this a year or so ago and found that although kmail (for example) could filter messages on keywords in the message body it was unable to respond by using this keyword to select an appropriate email reply (out of a possible 20) and actually send it (although kmail may have improved since then).
Do any ALUGers already have a Linux based automated brochure service / email autoresponder running on their server? If so could you pass on some tips on how you set it up?
There's more than one aspect to this question!
First, you ask about email clients that can respond automatically in this way. The one I've been using for years, XFMail, has this kind of thing built in. More recent versions and more info can be found at
http://archimedes.sourceforge.net/cgi-bin/archimedes
You can set up various kinds of rules to act on mail messages in various ways.
A rule can act on a message which is one of: -- incoming (action when mail is received) -- outgoing (action when mail is sent) -- special (action triggered on "resident" mail by user's right click)
Rules look for text matches (regexp style) in one of: -- Message (anywhere in the entire message) -- Header (anywhere in the headers) -- Recipients -- Body -- Subject: -- From: -- To: -- Cc: -- Bcc: -- Sender: -- Flags
Action triggered by rule can be one of: -- Move to specified folder -- Forward to specified address -- Respond (delete and send specified file as response message) -- Resend (similar to Respond) -- Discard -- Execute (execute specified command with message as standard input)
So you could choose to apply a Body match to an Incoming mail to Execute a command to mail an appropriate brochure.
However, apart from "Execute" (where the command can be a shell script which can choose amongst several options), different specific matches require different rules.
Secondly, therefore, it might be better to take all incoming mail to "info" and pipe it into a shell script ('awk' is often good for this kind of thing, though 'perl' advocates will jump in and point out that 'perl' is very good too). This script will then "parse" the message and decide on appropriate action. So, rather than delegate the work to a mail client (which is somewhat overkill, I think), that is how I would prefer to approach the task.
On of the optional actions which the script could have available is simply to pass it on to whoever reads mail for "info" in the case that none of the auto-responses is appropriate.
So, when a user mails info with one of the keywords, the script selects the appropriate brochure and mails it back. It is not difficult to write such a script. When none of the keywords triggers is activated, the script just passes it on to "info".
Hoping this helps, Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 09-Feb-06 Time: 09:30:26 ------------------------------ XFMail ------------------------------