gambler has asked for the wisdom of the Perl Monks concerning the following question:

Being a lazy SOB I though if I would ask if anybody out there knows a good source for the code to a decent auto-responder. I just want to be able to let people know that there email has been recieved and include a brief message. Thanks in advance. Gambler

Replies are listed 'Best First'.
Re: Looking for Email auto-responder
by stefan k (Curate) on Feb 12, 2001 at 22:03 UTC
    I don't know what this has to do with Perl in particular...

    Anyway, if you're on a unix system (which you didn't specify), you should have a look at

    • man forward
    • man procmail

    Regards
    Stefan K

    $dom = "skamphausen.de"; ## May The Open Source Be With You! $Mail = "mail@$dom; $Url = "http://www.$dom";
Re: Looking for Email auto-responder
by cajun (Chaplain) on Feb 12, 2001 at 23:15 UTC
    Be aware if you belong to mailing lists, this sort of thing is frowned upon. Last week some dude had an 'out of office reply' setup for his mail. The first one of these out of office replies to the list aggrivated everyone. Hehehe, then his MDA wasn't smart enough to know what NOT to respond to. It then started responding to his own out of office messages. What a mess. After several hundred messages and lots of peoples nerves getting frazzled, someone called his office and got one of his co-workers to shut down his machine.
      cajun writes:

      Be aware if you belong to mailing lists, this sort of thing is frowned upon.

      Be further aware that this is a tricky thing to get right on the first try - doubly so if you're trying to get out the door on vacation. :-)

      ObPerl: use Mail::Alias;

      There's a great wealth of people trying to solve it without generating loops (like the example above) and without replying to every message received from a given individual.

      (Of course, now we're talking about some kind of simple data persistance problem... or maybe not so simple, depending on how long you'll be away, and how much mail you'll get...)

      As a final caution, a recent discussion about this cropped up on comp.risks - be guarded about the kinds of information you put in your vacation autoresponder.

      People who put their lights on timers, stop the newspaper, and have the neighbor's kid take in the mail, still don't think twice before automating a program to send mail to the world specifying who they are, who they work for, where they're going, how long they'll be away, who their boss is (for emergency contact purposes), etc., etc.

      It's quite possible that your vacation autoresponder will inadvertantly send it's message to a much wider audience than you anticipate at first glance - or that the information might be forwarded, as in the case of a list. If you must use an autoresponder, keep it simple.

      ObMailGeek: anybody know of a "Standard" header that "most" autoresponders will stick in the 822 headers? TIA.

      Peace,
      -McD

Re: Looking for Email auto-responder
by zigster (Hermit) on Feb 12, 2001 at 22:10 UTC
    I dont have a linux system to hand but IIRC there is a vacation function that is pretty linux standard. Create a file .vacation in your home directory and it is bounced back to all people that email you. A possibly subverted use but it may be of help.

    For a complete solution procmail is your baby.
    --

    Zigster

Re: Looking for Email auto-responder
by baku (Scribe) on Feb 12, 2001 at 22:31 UTC

    This is only a Perl problem once you know how to "hook in" to your eMail software. If you're using sendmail, qmail, procmail, or postfix, there are different mechanisms for doing this. Something like a .forward (or .qmail, or .vacation) file might be what you are looking for.

    Check the appropriate manual pages for your OS and/or eMail delivery agent. (Note that the program which delivers eMail, the MDA - e.g. "procmail" - may not be the program which receives eMail from the network, the MTA - e.g. "sendmail")

    The next question would be, what do you want to do? Simply replying with a text message can be done by any of the above MDA's. If you want to do something more complex, we'll need to know more about your OS and MDA set-up.