ClayRabbit
Verified User
Here comes the plugin which allows admin to set message limit or completely (almost disable SMTP for any user.
SMTP Limiter Plugin
Version 0.943
http://ruweb.net/DA/SMTP_Limiter.tar.gz
For now install/uninstall scripts is not completed, so you need to made some preparations manually.
Installation instructions:
1) Backup your current /etc/exim.conf and /etc/exim.pl
2) Upload and install plugin into DirectAdmin and activate it.
3) [...skipped...] Directories creation and adding cronjob handled by install/uninstall scripts since version 0.91.
4) You need to add some modifications to your exim.comf.
NOTE: APPLY THIS MODIFICATIONS AT YOUR OWN RISK. This plugin is beta. We need some testing, but it's not recommended to test this plugin on production servers. It can be incompatible with your exim configuration and modifications below can cause mail delivery problems on your SMTP-server. Luckily, you always can restore your original exim.conf and exim.pl from backup. Just don't forget to keep an eye on exim logs.
So if you want to continue, applly following modifications to your exim.conf:
4.1) Аfter
add
4.2) Аfter
add
4.3) Аfter
add
Note: If line "authenticated = *" appear more than once inside your exim.conf, then you probably should add "set acl_c0 = ${perl{find_user}}" after each ocurrence of this line.
4.4) Аfter
add
4.5) Аfter
add
4.6) If you have line
(inside your lookuphost router) you should comment it:
4.7) After:
add:
5) Replace your exim.pl with exim.pl included in archive (It's inside 'scripts' folder. After installation (2) full path will be /usr/local/directadmin/plugins/SMTP_Limiter/scripts/exim.pl.) and make sure it has chmod 755.
6) Restart exim
7) All should work now (At least I hope so.)
Comments, suggestions, questions, and bug-reports are welcome! =)
SMTP Limiter Plugin
Version 0.943
http://ruweb.net/DA/SMTP_Limiter.tar.gz
For now install/uninstall scripts is not completed, so you need to made some preparations manually.
Installation instructions:
1) Backup your current /etc/exim.conf and /etc/exim.pl
2) Upload and install plugin into DirectAdmin and activate it.
3) [...skipped...] Directories creation and adding cronjob handled by install/uninstall scripts since version 0.91.
4) You need to add some modifications to your exim.comf.
NOTE: APPLY THIS MODIFICATIONS AT YOUR OWN RISK. This plugin is beta. We need some testing, but it's not recommended to test this plugin on production servers. It can be incompatible with your exim configuration and modifications below can cause mail delivery problems on your SMTP-server. Luckily, you always can restore your original exim.conf and exim.pl from backup. Just don't forget to keep an eye on exim logs.
So if you want to continue, applly following modifications to your exim.conf:
4.1) Аfter
Code:
acl_smtp_rcpt = check_recipient
acl_smtp_data = check_message
Code:
acl_not_smtp = check_not_smtp
4.2) Аfter
Code:
begin acl
Code:
check_not_smtp:
deny set acl_c0 = ${perl{find_user}}
condition = ${if def:acl_c0{${if exists{/etc/virtual/.smtp_deny/$acl_c0} {yes}}}}
message = User $acl_c0 is not allowed to use SMTP
accept
4.3) Аfter
Code:
accept hosts = +auth_relay_hosts
endpass
message = authentication required
authenticated = *
Code:
set acl_c0 = ${perl{find_user}}
4.4) Аfter
Code:
check_message:
Code:
deny condition = ${if def:acl_c0{${if exists{/etc/virtual/.smtp_deny/$acl_c0} {yes}}}}
message = User $acl_c0 is not allowed to use SMTP
4.5) Аfter
Code:
begin routers
Code:
check_limits:
driver = redirect
domains = ! +local_domains
condition = ${if def:acl_c0{${if first_delivery{${perl{check_limits}{$acl_c0}}}}}}
allow_fail
data = ":fail: You ($acl_c0) have reached your message limit"
4.6) If you have line
Code:
condition = "${perl{check_limits}}"
Code:
# condition = "${perl{check_limits}}"
4.7) After:
Code:
accept hosts = +relay_hosts
Code:
set acl_c0 = ${lookup{$sender_host_address}lsearch{/etc/virtual/pophosts_user}\
{${perl{find_user}{$value}}}}
5) Replace your exim.pl with exim.pl included in archive (It's inside 'scripts' folder. After installation (2) full path will be /usr/local/directadmin/plugins/SMTP_Limiter/scripts/exim.pl.) and make sure it has chmod 755.
6) Restart exim
7) All should work now (At least I hope so.)
Comments, suggestions, questions, and bug-reports are welcome! =)
Last edited: