| 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. |
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/
http://opensource.dazoot.ro/member/catalin/vmgrucheck/vmgrucheck.py
http://opensource.dazoot.ro/member/catalin/vmgrucheck/python-setuid.c
Make sure you have Qmail SPP working
Copy vmgrucheck.py to /var/qmail/plugins
Copy python-setuid.c to /var/qmail/plugins
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"
Compile python-setuid.c with:
gcc python-setuid.c -o vmgrucheck
Setuid the binary file and change owner to root
chmod a+s vmgrucheck chown root vmgrucheck*
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
Restart Qmail