Viktor Dukhovni:
> They are best left alone, but can be deleted with care, something
> along the lines of:
> 
>       # postfix stop
>       # postsuper -s
>       # cd /var/spool/postfix
>       # (find defer -type f -print;
>          find deferred -type f -print) | 
>         perl -lne '
>               if (m{^defer/(?:.*/)?(.*)$}) {
>                   $defer{$1} = $_;
>               } elsif (m{^deferred/(?:.*/)?(.*)$}) {
>                   delete $defer{$1};
>               }
>               END {
>                   while (($id, $path) = each(%defer)) {
>                       if (unlink($path)) {
>                           printf "%s defer log deleted\n", $id;
>                       } else {
>                           warn "unlink: $path: $!\n";
>                       }
>                   }
>               }
>           '

I had a similiar issue some years ago. A heavy loaded defer queue was so slow.
I noticed these orphaned files in defer/. I had the feeling the qmgr acts 
faster after removing them.
For that reason I implemented a cronjob to search (but not delete) orphaned 
files once a day.

cd ${QUEUE_DIR}/defer/
for deferinfo in `find . -type f`; do
  if [ ! -f "../deferred/${deferinfo}" ]; then
    ORPHANED_FILES="${ORPHANED_FILES} ${QUEUE_DIR}/defer/${deferinfo}"
fi
done
if test ! -z "${ORPHANED_FILES}"; then
  echo
  echo '* Infodateien ohne Queuedateien:'
  echo '--------------------------------'
  echo ${ORPHANED_FILES} | xargs ls -la
fi

That cronjob produces output very rarely but mostly after manual interaction
( postsuper -r ALL and so )

Andreas

Reply via email to