<?php
$content=file_get_contents('http://192.168.1.11/eximstats/#Rejected%20ip%20count');
$pos = strpos($content,'<h2>Top 50 rejected ips by message count</h2>');
$content = substr($content, $pos);
$pos = strpos($content, '<hr>');
$content = substr($content, 0, $pos);
preg_match_all('/\d*\.\d*\.\d*\.\d*/', $content, $output);
foreach($output as $index => $val)
{
foreach($val as $val2)
{
if ((substr($val2, 0, 3)!='127')and(substr($val2, 0, 7)!='192.168'))
{
$mass[]=$val2;
}
}
}
$str = implode("\n", $mass);
$file = fopen ("/etc/exim4/mail-spammers","w+");
fputs ( $file, $str);
fclose ($file);
echo ('ok')
?>
cat /etc/dovecot/dovecot-sql.conf.ext
driver = mysql
connect = host=localhost dbname=mail user=mail password=password
default_pass_scheme = CRAM-MD5
password_query = SELECT `username` as `user`, `password` FROM `mailbox` WHERE `u sername` = '%n@%d' AND `active`='1'
user_query = SELECT CONCAT('/var/mail/', `domain`, '/', `maildir`) \
AS `home`, 26 AS `uid`, 26 AS `gid`, concat('dict:storage=', \
CAST(ROUND(quota / 1024) AS CHAR), '::proxy::sqlquota') \
AS quota, CONCAT('*:storage=', CAST(quota AS CHAR), 'B') AS quota_rule \
FROM `mailbox` WHERE `username` = '%n@%d' AND `active`='1'