-   Linux - Software (
-   -   Procmail+Postfix vacation message issues (

fedora_user 07-26-2006 05:14 AM

Procmail+Postfix vacation message issues
I am trying to setup a vacation message using procmail with postfix. I have added the following script to .promailrc :

# Uncomment the lines below if you need log output for testing.

# vim: ft=procmail

# User-managed vacation recipe for procmail
# Written by Jason Thaxter
# (

# * Include this file in the procmail file.
# * Set $VACATION_PASSWORD. (for security, this is mandatory)
# * Define $VACATION_SENDER in your procmail recipe: it will be "from" this
# address.
# * E-mail a message with $VACATION_PASSWORD and $VACATION_ON in the subject
# line. The body of the message becomes the vacation message. $VACATION_ON
# can be set prior to the INCLUDERC, but it defaults to "vacation on".
# * To turn it off, e-mail a message with $VACATION_PASSWORD and $VACATION_OFF
# in the subject line. Likewise, $VACATION_OFF defaults to "vacation off".

# Note that you probably want this to execute *after* any mailing list or spam
# delivery recipes. You can set $VACATION_SKIP to disable vacation processing
# if it's inconvenient to skip this recipe.

# -----------------------------------------------------------------------------
# Configurable variables: These variables allow you to use this vacation recipe
# as an include and customize it from your main procmail file.
# lockfile:
# cache file:
# cache size:
# message file
# what to use as the xloop header
# base token for default $VACATION_ON and $VACATION_OFF
# so you could set this and not those individually

#Change these variables

# -----------------------------------------------------------------------------


# check if we should send vacation message, add user to cache
# if i haven't been instructed to skip processing
* ? test -z $VACATION_SKIP
# if i have a vacation message file
* ? test -f $VACATION_MSG
# and the message is not from a daemon or mailer
# not declared spam by spamassassin
* !^X-Spam-Flag: YES
# not discernably in a mailing list
* !^List-
* !^(Mailing-List|Approved-By|BestServHost|Resent-(Message-ID|Sender)):
* !^X-[^:]*-List:
* !^X-(Sent-To|(Listprocessor|Mailman)-Version):
# and not x-loop
# add it to the cache

:0 ehc
# if the name was not in the cache
# if we can find who we're sending it to
# and who we are sending this "From"
* ? test -n ${VACATION_MSG_SEND_TO}
* ? test -n ${VACATION_SENDER}
| (formail -r \
-I"Precedence: junk" \
cat $VACATION_MSG ) | \

# Add/remove vacation message
# First make sure that the sender has
# the correct username
* ^TO_\/[-\.a-z_]+@
*$ ^From:.*$\MATCH
# the correct email domain
# only do this if we have a password set
# and it's in the subject line
* $^Subject:.*${VACATION_PASSWORD}

# if subject line matches magic cookie for ON:
* $^Subject:.*${VACATION_ON}
# pipe the body into the vacation message file
| formail -I "" > $VACATION_MSG

# add message to the body
| cat - ; \
echo; \
echo '---------- VACATION -----------------'; \
echo 'The above text was installed as your vacation message'

# if subject line matches magic cookie for OFF:
# delete the vacation file and notify
* $^Subject:.*${VACATION_OFF}
| cat -; \
echo '---------- VACATION -----------------'; \
echo 'Removing message and cache: '; \
rm -vf $VACATION_MSG; \
echo ; \
echo "Removed vacation message."


I am getting the following output from procmailvacation.log:

lost+found orbit-root procmailvacation.log
[root@puny tmp]# more procmailvacation.log
procmail: [19038] Wed Jul 26 10:06:04 2006
procmail: Assigning "VACATION_LOCK=/home/spamtest1/.vacation.lock"
procmail: Assigning "VACATION_CACHE=/home/spamtest1/.vacation_cache"
procmail: Assigning "VACATION_CACHE_SZ=8192"
procmail: Assigning "VACATION_MSG=/home/spamtest1/.vacation_mesg"
procmail: Executing "hostname"
procmail: Assigning ""
procmail: Assigning ""
procmail: Assigning "VACATION_COOKIE=vacation"
procmail: Assigning "VACATION_ON=vacation on"
procmail: Assigning "VACATION_OFF=vacation off"
procmail: Assigning "VACATION_PASSWORD=password"
procmail: Assigning ""
procmail: Assigning ""
procmail: Assigning ""
procmail: Assigning "VACATION_SENDMAILFLAGS=-oi -t"
procmail: Assigning "SENDMAIL_CMD=/usr/sbin/sendmail -oi -t"
procmail: Assigning "SHELL=/bin/sh"
procmail: Executing " test -z $VACATION_SKIP"
procmail: Match on " test -z $VACATION_SKIP"
procmail: Executing " test -f $VACATION_MSG"
procmail: Non-zero exitcode (1) from " test -f $VACATION_MSG"
procmail: No match on " test -f $VACATION_MSG"
procmail: No match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)\/[-\.a-z_]+@"
procmail: Bypassed locking "/var/spool/mail/spamtest1.lock"
procmail: Assigning "LASTFOLDER=/var/spool/mail/spamtest1"
procmail: Opening "/var/spool/mail/spamtest1"
procmail: Acquiring kernel-lock
procmail: Notified comsat: "spamtest1@11487:/var/spool/mail/spamtest1"
From Wed Jul 26 10:06:03 2006
Subject: password vacation on
Folder: /var/spool/mail/spamtest1

Unfortunately I cannot see an obvious error, or perhaps that is because I dont know how to read them that well.

Any help will be much appreciated.

fedora_user 07-27-2006 03:54 AM

help please help

fedora_user 08-02-2006 08:54 AM

come on guys - please help me, iam desperate

fedora_user 08-04-2006 04:21 AM

procmail auto reply script not working-need help understanding log
if this post is in the wrong place can someone please tell me so i will go elsewhere.
If i smell please can someone tell so i can put in some nice smelling spray
If you know the answer to my problem please can you post it.
If you know but dont want to tell me please can you let me know.
If any other reason please let me know.

Thank you

fedora_user 08-07-2006 06:23 AM

need to setup vacatione message
Hi people

This is the second time iam trying to pursue an answer to my problem and I hope someone can help:
I need to setup auto-reply message for staff members when they are on leave. I wish for them to be able to set it up themselves and that they write out their own message.
My setup is postfix and procmail and spamassassin.
I hope someone can help, as i have been trying to resolve this for some weeks.

Regards and thank you in advance.

billymayday 08-07-2006 06:46 AM

Have you looked at vacation?

fedora_user 08-07-2006 07:25 AM

Thanks for the reply, from what ive read it seems the sort of this that i need. But i dont think this will allow the individual Windows user to setup their own vacation message. Users do not have any access to shell.

All times are GMT -5. The time now is 02:39 AM.