[TriLUG] autoreply in sendmail?

Jon Carnes jonc at nc.rr.com
Mon Mar 11 11:09:47 EST 2002


Most folks use procmail for this.  You put a file called .procmailrc in your
home directory and setup something like the following in the file:

=== Example procmail script for Vacation message ===
SHELL=/bin/sh    # created by vacation script on plasma

:0 Whc: vacation.lock
* ^TOjonc
* !^FROM_DAEMON
* !^X-Loop: jonc at haht.com
| formail -rD 8192 vacation.cache

:0 ehc         # if the name was not in the cache
| (formail -rA"Precedence: junk" \
  -A"X-Loop: jonc at haht.com" ; \
  cat $HOME/vacation.msg \
  ) | $SENDMAIL -oi -t

:0
!   jonc at salsa.haht.com \

=== End of script example ===

This example creates a local lock file called vacation.lock.
It looks for a message that is specifically to "jonc" (as opposed to cc or
bcc, or a member of a list).
It ingnores any messages that are from "DAEMON"
It ingnores any message with a header called: X-LOOP: jonc at haht.com
It checks a local cache file called "vacation.cache and looks to see if the
sender is in the cache - if so, ignore the message - if not, add the user
and keep processing

The next section creates a response to any message that falls through.
It marks the message as junk
Adds a header: X-LOOP: jonc at haht.com
Uses text from the local file "vacation.msg" as the body of the message
Sends the message out as a response to the incoming message

The message is then forwarded to an external server so that I can pick it up
while I'm traveling...

Hope this Helps - Jon
----- Original Message -----
From: <gregbrown at mindspring.com>
To: <trilug at trilug.org>
Sent: Monday, March 11, 2002 9:58 AM
Subject: [TriLUG] autoreply in sendmail?


> Is there a way to set up an autoreply in sendmail?  I've checked the man
pages for sendmail and mail but I didn't see anything regarding an auto
reply.
>
> Thanks!
>
> Greg
>
> _______________________________________________
> TriLUG mailing list
>     http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ:
>     http://www.trilug.org/~lovelace/faq/TriLUG-faq.html




More information about the TriLUG mailing list