Hosted by PSE.pl | Created: 2002-11-11 | Last update: 2004-03-11 19:49:55 UTC | GnuPG signature of this page
anfiTop | anfiUp | Andrzej Filip | Mirror Sites | GnuPG Keys | New!google
googleMy Postings | slashdotJournal | Showing Gratitude
Personal | Sendmail | Exim | General MTA | Cyrus IMAP | UUCP

File Status Map (sendmail)

Abstract

The document describes how to add file status map to sendmail.

The map can chek presence of file or directory and report files size. It can be used for rela time checks if given cyrus mailbox exists.


Copyright (c) 2002 Andrzej Filip

Usage

After you compile in support for fstat map define fstat map in you sendmail.mc:

Pass test name in key and path of file/directory as first parameter e.g.

$(fstat d $@ /absolute_directory_path $)

The map implements three checks:

Install

  1. Apply the patch (the gpg signature) - in main directory of sendmail distribtion execute

    patch -p1 < fstat-8.12.11.patch
    
  2. In devtools/Site/site.config.m4 add the following line:

    APPENDDEF(`confMAPDEF',`-DFSTATMAP')dnl
    
  3. Recompile and reinstall sendmail.

Tests

  1. Add the following lines to *.mc file and generate new sendmail.cf:
    LOCAL_CONFIG
    Kfstat fstat
    LOCAL_RULESETS
    Scheck_fstat
    R$-:$*  $: $(fstat $1 $@ $2 $)
    
  2. Use the following commands for tests:
    • Directory presence test:
      echo "check_fstat d:_absolute_directory_path_" | sendmail -bt -d60.5 -d21.12
      
    • File presence test:
      echo "check_fstat f:_absolute_file_path_" | sendmail -bt -d60.5 -d21.12
      
    • File size test:
      echo "check_fstat s:_absolute_file_path_" | sendmail -bt -d60.5 -d21.12
      

Additional

I created the map to allow real time checks if cyrus mailbox exists by checking presence of top level directory of the mailbox.

I think it may be used for the same purpose with other virtual mailbox (no OS account) servers.