Menu

Tree [r1] /
 History

HTTPS access


File Date Author Commit
 LICENSE 2010-03-07 sebastianwe [r1] First import
 Makefile 2010-03-07 sebastianwe [r1] First import
 README 2010-03-07 sebastianwe [r1] First import
 smwrapper.c 2010-03-07 sebastianwe [r1] First import
 smwrapper.conf 2010-03-07 sebastianwe [r1] First import
 smwrapper.h 2010-03-07 sebastianwe [r1] First import

Read Me

SMWrapper

Wrapper program for sendmail that looks for X-PHP-Script and manages Script limits 
and IP limits. Invokes real sendmail when no limit is reached.
Limits can be configured in /etc/smwrapper.conf

Features:
 - Limit websites to send only a defined amount of mails per hour
 - Limit sender ip adresses per website to send only a defined amount of mails per hour
 - Set a maximum mail size
 - Automatically inform user and administrator per email
 - Logging to syslog (mail authority)

Required:
 - PHP >=5.3 with mail.add-x-header enabled
 - any sendmail application (postfix, qmail, sendmail, exim4, ...)
 - syslog

1. Installation

make
make install

Per default smwrapper is installed as /usr/bin/smwrapper. 
There are two ways to get it working:

	1. Leave it at this place (good for single applications that should use the smwrapper)
 	 - Update /etc/smwrapper.conf and set sendmail to your sendmail binary (e.q. /usr/bin/sendmail)
 	 - Update each application config that should use the wrapper (e.q. /etc/php5/apache2-php/php.ini):
   
	   <php.ini>
	   sendmail_path = smwrapper -t -i
	   mail.add-x-header = On

	2. Move real sendmail and copy smwrapper to its old path (good to get it globally working)
	 - mv /usr/bin/sendmail /usr/bin/sendmail_old
	 - cp /usr/bin/smwrapper /usr/bin/sendmail
	 - Update /etc/smwrapper.conf and set sendmail to /usr/bin/sendmail_old

2. Configuration

see comments in /etc/smwrapper.conf

3. Files

/usr/bin/smwrapper		sendmail wrapper that invokes real sendmail after limit checks
/tmp/smwrapper/			temp path that stores temporary mails, make sure to set rights correctly!
/var/cache/smwrapper/stats	logs checked emails

Log entries are passed to syslog in category mail. Look at /var/log/messages or /var/log/mail.*

4. Uninstall

make clean

Deletes everything that has been installed except for config and log files
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.