atom feed8 messages in net.sourceforge.lists.courier-usersRE: [courier-users] Vacation Notices ?
FromSent OnAttachments
Thomas von HasselJun 20, 2003 6:30 am 
Bowie BaileyJun 20, 2003 8:50 am 
Eduardo RoldanJun 20, 2003 8:51 am 
Thomas von HasselJun 20, 2003 9:29 am 
Jesse KeatingJun 20, 2003 10:12 am 
Bowie BaileyJun 20, 2003 10:29 am 
Stephen ReeseJun 24, 2003 5:51 pm 
Sam VarshavchikJun 24, 2003 6:49 pm 
Subject:RE: [courier-users] Vacation Notices ?
From:Stephen Reese (sre@prcdigital.com)
Date:Jun 24, 2003 5:51:29 pm
List:net.sourceforge.lists.courier-users

Ok I've created three files .courier .mailfilter and autoreply I've set permissions of all three files to 700 and the owner is the same user:group that owns the $HOME. I am also using mail drop due to my spamassassin requirements though the autoreply doesn't seem to reply?

.courier file contents:

| /usr/lib/courier/bin/maildrop

.mailflter file contents:

FROM='sre@prcdigital.com' import SENDER if ($SENDER eq "") { SENDER=$FROM }

cc "./Maildir"

AUTOREPLYFROM=$FROM `/usr/lib/courier/bin/mailbot -A "X-Sender: $FROM" -A "From: $AUTOREPLYFROM" -m "./autoreply" $SENDMAIL -t -f ""`

EXITCODE = 0 exit

Autoreply just contains a text message:

n/a

Does anyone notice what I'm missing here?

-----Original Message----- From: cour@lists.sourceforge.net [mailto:cour@lists.sourceforge.net] On Behalf Of Bowie Bailey Sent: Friday, June 20, 2003 11:50 AM To: Thomas von Hassel Cc: cour@lists.sourceforge.net Subject: RE: [courier-users] Vacation Notices

From: Thomas von Hassel [mailto:tho@elements.dk]

Now that summer holidays are comming up i need a quick and dirty solution to make auto reply/vacation notice. Courier MTA with mysql auth and default delivery. I'm not using the webmail feature.

Quick and dirty...Ok, here ya go!

This is the setup that I use for my accounts that need an autoreply.

For this to work, you need to be using maildrop. You can set it as the DEFAULTDELIVERY for everyone in '/etc/courier/courierd', or just run it from '$HOME/.courier' for a particular user. Keep in mind that if you set DEFAULTDELIVERY to maildrop, it will still be overridden by anything in '$HOME/.courier'.

In the user's home directory, create a .mailfilter file. Mine looks like this:

FROM='myad@domain.com' import SENDER if ($SENDER eq "") { SENDER=$FROM }

cc "!us@domain.com"

AUTOREPLYFROM=$FROM `/usr/lib/courier/bin/mailbot -A "X-Sender: $FROM" -A "From: $AUTOREPLYFROM" -m "./autoreply" $SENDMAIL -t -f ""`

EXITCODE = 0 exit

Note that the mailbot command should be all one line.

Create a file called 'autoreply' in the home directory with the text of the autoreply message. This file can even be an html message if you include the proper headers at the top. If I'm doing something fancy, I'll generally create the email in my mail client and send it to my mailbox. Then I can grab the message file and cut out the message and necessary headers for the autoreply.

FROM is the address you want the autoreply to be sent from. It does not necessarily need to be the same as your email address.

To save a copy of the original email to your mailbox or forward it somewhere else, use the 'cc' line. Note that the original email will be discarded unless you specifically send it somewhere. You can use "!us@domain.com" as above to forward the email or "./Maildir" to save it to your mailbox. If you want to discard the original email, just delete the 'cc' line.

SENDMAIL is set in my '/etc/courier/maildroprc' file:

SENDMAIL="/usr/lib/courier/bin/sendmail -f \"$FROM\""

Hmmm... This seems to conflict with the '-f ""' definition in the .mailfilter file. Hadn't noticed that before. In any case, it seems to be working fine.

There may be better, cleaner, or even easier ways to do this, but this is one quick and dirty method and it works well for me.

Bowie