[ingo] Ingo's Procmail vacation - /bin/sh: date: No such file or directory
David Powell (YANQ)
tech at yanq.org.au
Fri Aug 1 02:56:05 UTC 2008
Hi All,
I'm having some trouble setting up Ingo's vacation script using procmail
as the filter's backend. I'm running Horde Groupware Webmail 1.1 (Horde
3.2, Ingo 1.2) and procmail 3.22 on Debian stable (linux kernel 2.6.18-4).
Other filters (such as moving emails to specific folders based on
particular headers) are all working fine. It's just the vacation script
that I've noticed a problem with.
Here are the relevant lines written to the procmail log when a message
gets received (and the vacation email should be triggered):
/bin/sh: date: No such file or directory
/bin/bash: line 0: test: -gt: unary operator expected
procmail: Skipped "* ^TO_NOSPAM at domain.org.au"
procmail: Skipped "* !^X-Loop: NOSPAM at domain.org.au"
procmail: Skipped "* !^X-Spam-Flag: YES"
procmail: Skipped "* !^FROM_DAEMON"
procmail: Skipped "| formail -rD 8192
${VACATION_DIR:-.}/.vacation.NOSPAM at domain.org.au"
I think the problem is related to that first error (date: No such file
or directory). But the system has the date program installed and it
works fine when executed by any user. I can't see anywhere else where
'date' is referred to in the generated procmail script (which I've
copied below).
Anyway, within ingo's backends.php file I have the following variables
set for the procmail script:
'script' => 'procmail',
'scriptparams' => array(
'path_style' => 'maildir',
'variables' => array(
'PATH' => '/usr/bin',
'DEFAULT' => '$HOME/Maildir/',
'VACATION_DIR' => '$HOME'
And finally, if it helps here is the procmail script that is generated
in the users home directory when I enable the vacation script:
##### Vacation #####
:0
{
FILEDATE=`test -f ${VACATION_DIR:-.}/'.vacation.NOSPAM at domain.org.au'
&& ls -lcn --time-style=+%s
${VACATION_DIR:-.}/'.vacation.NOSPAM at domain.org.au' | awk '{ print $6 +
(86400) }'`
DATE=`date +%s`
DUMMY=`test -f ${VACATION_DIR:-.}/'.vacation.NOSPAM at domain.org.au' &&
test $FILEDATE -le $DATE && rm
${VACATION_DIR:-.}/'.vacation.NOSPAM at domain.org.au'`
START=1217340000
END=1235739600
:0 h
SUBJECT=| formail -xSubject:
:0 Whc: ${VACATION_DIR:-.}/vacation.lock
* ? test $DATE -gt $START && test $END -gt $DATE
:0 Whaf
* ^TO_NOSPAM at domain.org.au
* !^X-Loop: NOSPAM at domain.org.au
* !^X-Spam-Flag: YES
* !^FROM_DAEMON
| formail -rD 8192 ${VACATION_DIR:-.}/.vacation.NOSPAM at domain.org.au
:0 ehc
| (formail -rI"Precedence: junk" \
-a"From: <NOSPAM at domain.org.au>" \
-A"X-Loop: NOSPAM at domain.org.au" \
-i"Subject: Mail delivery notice - NOSPAM at domain.org.au (Re:
$SUBJECT)" ; \
echo -e "Please note:\r\n\r\nBLAH BLAH BLAH" \
) | $SENDMAIL -fNOSPAM at domain.org.au -oi -t
}
--
David Powell
Technical Officer
Youth Affairs Network of Queensland
30 Thomas, WEST END Q 4101
Tel: (07) 3844 7713
Fax: (07) 3844 7731
Email: tech at yanq.org.au
Web: http://www.yanq.org.au
NOTICE:This communication and all attachments contains information which is confidential and the copyright of Youth Affairs Network Qld (YANQ)or a third party. If you are not the intended recipient of this communication please delete and destroy all copies and telephone/email (details above) YANQ. If you are the intended recipient of this communication you should not copy, disclose or distribute this communication without the authority of YANQ. Any views expressed in this communication are those of the individual sender, except where the sender specifically states them to be the views of YANQ. Except as required at law, YANQ does not represent, warrant and/or guarantee that the integrity of this communication has been maintained or that the communication is free of errors, virus, interception or interference.
More information about the ingo
mailing list