VMailMgr Users Check - Qmail SPP Plugin

Author: Catalin Constantin
Contact: dazoot@gmail.com
Date: 1 Dec 2006
Web site:http://opensource.dazoot.ro/member/catalin/vmgrucheck/
Copyright: This document has been placed in the public domain.

Contents

About

This is a simple Qmail SPP plugin which checks at SMTP level the existence of VMailMgr users.

The script is written in Python and requires Python cdb package to read VMailMgr passwd.cdb files.

Also, since the VMailMgr uses one system user per domain, the script needs to be ran with setuid root.

To achieve this, it is required to use python-setuid.c from: http://www.nongnu.org/prua/

Download

http://opensource.dazoot.ro/member/catalin/vmgrucheck/vmgrucheck.py

http://opensource.dazoot.ro/member/catalin/vmgrucheck/python-setuid.c

Install

  1. Make sure you have Qmail SPP working

  2. Copy vmgrucheck.py to /var/qmail/plugins

  3. Copy python-setuid.c to /var/qmail/plugins

  4. Edit python-setuid.c and update the first 2 define lines with path to your python binary and path to vmgrucheck.py:

    #define PYTHON "/usr/local/bin/python2.3"
    #define FULLPATH "/var/qmail/plugins/vmgrucheck.py"
    
  5. Compile python-setuid.c with:

    gcc python-setuid.c -o vmgrucheck
    
  6. Setuid the binary file and change owner to root

    chmod a+s vmgrucheck
    chown root vmgrucheck*
    
  7. Edit /var/qmail/control/smtpplugins - Qmail SPP Configuration file and add a entry under [rcpt] for the vmgrucheck binary file

    # plugins to execute on RCPT command
    [rcpt]
    plugins/vmgrucheck
    
  8. Restart Qmail

Source Code Preview

Click here to see the source code.

Links: Open Source, Qmail Spp, VMailMgr