[ingo] Procmail vacation script -- ctime vs mtime

Zachary Kotlarek zach at kotlarek.com
Fri Jan 14 04:31:06 UTC 2011


The procmail vacation script uses `ls -lcn ...` to get the ctime for the idcache file and, if that file is sufficiently old, delete it.

I can't figure out why it's asking for the ctime of the idcache instead of the mtime. I can't find anything in the procmail setup that would modify the ctime but not the mtime, and it's entirely possible for the ctime to get updated without any action from the vacation tools, if someone chmods the the directory or somesuch.

Does anyone know why I'd want the ctime? If not, I'd suggest this one-character patch to use mtime instead:
(available as a file at: http://zinux.cynicbytrade.com/svn/local/horde/files/procmail.diff)

diff -urN horde.orig/ingo/lib/Script/procmail.php horde/ingo/lib/Script/procmail.php
--- horde.orig/ingo/lib/Script/procmail.php	2009-09-16 07:37:22.000000000 -0500
+++ horde/ingo/lib/Script/procmail.php	2011-01-13 22:16:11.000000000 -0600
@@ -474,7 +474,7 @@
                     $this->_action[] = '  * ^TO_' . $address;
                     $this->_action[] = '  {';
                     $this->_action[] = '    FILEDATE=`test -f ${VACATION_DIR:-.}/\'.vacation.' . $address . '\' && '
-                        . $this->_params['ls'] . ' -lcn --time-style=+%s ${VACATION_DIR:-.}/\'.vacation.' . $address . '\' | '
+                        . $this->_params['ls'] . ' -ln --time-style=+%s ${VACATION_DIR:-.}/\'.vacation.' . $address . '\' | '
                         . 'awk \'{ print $6 + (' . $days * 86400 . ') }\'`';
                     $this->_action[] = '    DATE=`' . $this->_params['date'] . ' +%s`';
                     $this->_action[] = '    DUMMY=`test -f ${VACATION_DIR:-.}/\'.vacation.' . $address . '\' && '



More information about the ingo mailing list