Am 2015-03-01 12:38, schrieb Mick:
Hello Markus,
Thanks very much for your reply. I didn't come across Cookbook in my
searches but I don't think I will need it now as I'm very pleased to
report I got my first test policy implemented yesterday evening. Don't
laugh, all it does so far is block senders where 'sender' doesn't
match 'sasl-user'. Everyone has to start somewhere right? It does put
me in a place where I can write customised policies now. I was
thinking of using mysql but everyone seems to use Berkeley DB? Maybe
worth considering as it has a locking arrangement.
One of my user email accounts was compromised a couple of months ago
and over a period of 5 hours thousands of SPAM messages were sent.
Grrrr! Since then I have become rather paranoid checking the mail log
whenever I can looking for "Relay=' and auth failures manually barring
IPs that repeatedly fail to log in. I need to relax a bit so decided
to try and write a SPAM limitation policy, as in ;
if (X number of messages sent in Y time), {
external relay access blocked until user resets password
}.
To do this I needed to read the SASL_USERNAME field into PERL in
order to log and count SMTP requests to their account, now I can,
thanks to help given here. I think by Thursday I will have a test
version of it up and running.
The reject_sender_login_mismatch in smtpd_sender_restriction already
does that
as a native postfix check:
http://www.postfix.org/postconf.5.html#smtpd_sender_restrictions
The Accounting/Quota module in mtpolicyd can be used to count/limit
mails
per sasl user in a SQL database supported by perl-DBI (SQLite, MySQL,
etc.):
https://www.mtpolicyd.org/getting-started.html#Mail::MtPolicyd::Cookbook::HowtoAccountingQuota
Markus
--
Markus Benning, https://markusbenning.de/