[ingo] Procmail vacation script -- ctime vs mtime

Jan Schneider jan at horde.org
Sat Jan 22 17:43:58 UTC 2011


Zitat von Zachary Kotlarek <zach at kotlarek.com>:

> 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 . '\' && '
>
> --
> Ingo mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: ingo-unsubscribe at lists.horde.org
>

This piece of code seem to have been working fine for the last 7 years  
for everyone else, so I'm a but reluctant to change it, especially  
since I don't use procmail.

This is the patch that added it:  
http://git.horde.org/diff.php/ingo/lib/Script/procmail.php?rev=1.51&rt=horde&r1=1.44&r2=1.45

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the ingo mailing list