Hi,

I'm running the latest version of Courier-MTA, with user information stored
in a MySQL database and have implemented a basic out of office responder
using the maildrop filtering engine and mailbot.

Using the following in maildroprc almost produces the exact results we
require, with one exception. $LOGNAME is equal to
[EMAIL PROTECTED], when I believe that $LOGNAME should contain
the email address of the intended recipient of the mail who is out of the
office.

Does $LOGNAME only work with system accounts as opposed to MySQL or LDAP
backends?  Is there a variable which would contain the intended recipients
email address which can then be used for the from address in the out of
office reply?


/etc/courier/maildroprc

#
## MAILDROPRC
#

# test for vacation file, if it exists, send autoresponse
#
`test -f vacation.txt`
if ($RETURNCODE==0)
{
   # test for vacation message subject, use it if found
   #
   `test -f vacation_subject.txt`
   if ($RETURNCODE==0)
   {

      SUBJECT=`cat vacation_subject.txt`
      cc "| /usr/lib/courier/bin/mailbot -t vacation.txt -A 'From: $LOGNAME'
-A 'Subject: $SUBJECT' /usr/lib/courier/b


   # otherwise, regular "Re:" syntax for subject is automatic
   #
   }
   else
   {

      cc "| /usr/lib/courier/bin/mailbot -t vacation.txt -A 'From: $LOGNAME'
/usr/lib/courier/bin/sendmail -f ''"

   }

   # test for any cc addresses, forward to those addresses if present
   #
   `test -f vacation_cc_addresses.txt`
   if ($RETURNCODE==0)
   {

      # grab cc addresses
      #
      CCADDRESSES=`cat vacation_cc_addresses.txt`

      # do we need to keep a copy of messages in this account or not?
      #
      `test -f vacation_keep_messages.txt`
      if ($RETURNCODE==0)
      {
         cc "! -f \"$FROM\" $CCADDRESSES"
      }
      else
      {
         to "! -f \"$FROM\" $CCADDRESSES"
      }
   }
}

Thank you in advance.

Regards

Toby Heywood


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to