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?
Best wishes,
Ian.
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 ------------------------------
(Ted Harding) wrote:
Secondly, therefore, it might be better to take all incoming mail to "info" and pipe it into a ... script
You can use existing local delivery agents such as procmail (with pretty horrible syntax) or maildrop (which is what I use, but not for auto-responding) to match expressions and send replies.
Whichever way you chose to implement your autoresponder, make sure you avoid mail loops: - don't respond to bounces - don't respond to yourself (use a X-Loop header, see "man procmailex", or X-BeenThere, or "delivered-to" headers if your MTA uses them). - don't respond to mailing lists ("Precedence: list" header, or headers starting with "List-"). Remember that even though _you_ won't subscribe that address to a mailing list, someone-else might do so maliciously. - and if you want to get fancy you could worry about per-address rate-limiting.
See also for example: http://www.python.org/cgi-bin/faqw-mm.py?req=edit&file=faq03.006.htp http://www.goldmark.org/netrants/auto-resp/ http://untroubled.org/qmail-autoresponder/procedure.txt
-- Martijn
Martijn Koster mak-alug@greenhills.co.uk
Whichever way you chose to implement your autoresponder, make sure you avoid mail loops: [...]
Oh yes. Mail loops will make you very unpopular, in debt or cut off.
Please realise that you will always have some risk of "collateral damage" with autoresponses to faked From lines and you may not realise it until your mailserver gets blacklisted by some of the more trigger-happy groups. I strongly suggest using a "semi-automatic responder" if you can find one. I tend to use scripts, but maybe someone has seen a nice "send form reply" GUI?
Hope that helps,
On Thu, Feb 09, 2006 at 09:30:29AM -0000, Ted Harding wrote:
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
It's a little bit on the dead side isn't it! I tried XFMail a while ago but have returned to mutt. XFMail seemed to be going in the sort of direction I wanted but development (including the above) seems to have petered out.
On Thursday, February 09, 2006 9:30 AM, Ted Harding wrote:
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. ... 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) ... Rules look for text matches (regexp style) in one of: ... -- Body ... Action triggered by rule can be one of: ... -- Respond (delete and send specified file as response message) ...
Excellent!
Thanks for your suggestion Ted. I spent the weekend installing and experimenting with XFMail and, although it appears to be quite an old program, it seems to do exactly what I want and is now "live" happily autoresponding away.
Yes, I can see why others, and indeed yourself, suggested that using a mail client as an autoresponder may be a bit of an overkill and is not very efficient; but it makes the task very quick and easy to set-up and configure. The only real problem I had was how to stop it automatically inserting "I'm on vacation" into the "Subject:" line. Thankfully XFMail's help pages, although rather basic, provided the solution and explained how to replace the subject line with custom text.
Thanks once again to you all for your very useful suggestions!
Ian.
On 13-Feb-06 Ian Douglas wrote:
On Thursday, February 09, 2006 9:30 AM, Ted Harding wrote:
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. ... 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) ... Rules look for text matches (regexp style) in one of: ... -- Body ... Action triggered by rule can be one of: ... -- Respond (delete and send specified file as response message) ...
Excellent!
Thanks for your suggestion Ted. I spent the weekend installing and experimenting with XFMail and, although it appears to be quite an old program, it seems to do exactly what I want and is now "live" happily autoresponding away.
Happy that it works as you wish! Yes (as indeed someone else mentioned) it is indeed an old program which has not been developed further since about 2000/2001. And the version which I now use is even older (1.3-alpha from March 1998), replacing one I started using about 1996. (I do have a more recent version or two around, but didn't like the changed button-bar icons which they introduced).
The motive which led me to XFMail in the first place was the fact that you can open, simultaneously in distinct windows, as many messages as you like (including one you are composing), so it is easy to cross-reference between messages.
Another aspect, which I only appreciated as an advantage after some time of use, is that it supports (indeed as default) the "MH" mailbox format, in which each message is a separate file (whose name is a number).
This can make it very easy to locate messages by using text search tools such as 'grep' and then pipe located messages to other tools such as 'awk' or 'perl'. E.g. if I want to see when you sent messages to ALUG (and which I have retained):
grep "spamcatcher1" Mail/LISTS/ALUG/* 2>/dev/null | grep From: | awk 'BEGIN{FS=":"}{print $1}'
gives me the following files:
Mail/LISTS/ALUG/1633 Mail/LISTS/ALUG/1660
so now
for i in `grep "spamcatcher1" Mail/LISTS/ALUG/* 2>/dev/null | grep From: | awk 'BEGIN{FS=":"}{print $1}'` ; do cat $i | grep "^Date:" ; done
gives the results:
Date: Mon, 13 Feb 2006 08:35:30 -0000 Date: Thu, 9 Feb 2006 08:11:47 -0000
And maybe this sort of thing could some day be a possibility for your "responder"? (Though clearly you already seem to have things running as you want).
All best wishes, Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 13-Feb-06 Time: 09:52:11 ------------------------------ XFMail ------------------------------