Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-03-28, 13:06:15

Author Topic: sendmail userid usage limits [script v1.0b]  (Read 21598 times)

0 Members and 1 Guest are viewing this topic.

Offline chrisf

  • Senior Master
  • **
  • Posts: 883
  • Karma: +11/-1
  • Gender: Male
  • Be the change that you wish to see in the world.
    • View Profile
    • Conviction's Hosting
sendmail userid usage limits [script v1.0b]
« on: 2014-01-17, 21:41:58 »
Major battle we must fight as hosting providers are spammers ruining our servers IP credibility.  KloxoMR uses qmail-toaster, which is a very efficient MTA, it lacks a few features.

Major problem is sendmail.  It can forge domain, to/from, the only thing that is a result... IP ban.

Sendmail limiter is a wrapper script which uses mysql to keep track of sendmail, and limit by hour, half day, and full day.  You can even completely ban a client/user from sendmail.

Full logging abilities, even able to let you know which directory the script which is sending mail is at.

You can use for just limiting,  just logging, or both. ;)

Install is easy with my auto installer, you have a few things to do manually (mysql database, cron).

SSH:
Code: [Select]
cd /tmp
wget http://cc-server1.us/sendmail_wrapper.zip
unzip sendmail_wrapper.zip

Read sendmail-chrisf.txt, full instructions :)

Please report performance issues or bugs.  I am developing other scripts to help manage the client settings, and a auto group script to increase group by days active.

:)
« Last Edit: 2014-01-17, 21:44:59 by chrisf »
Christopher

Knowledge in: PHP, Perl, MySQL, Javascript, Actionscript, FLASH, HTML, CSS
Server Administrator / Developer: https://convictionshosting.com

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: sendmail userid usage limits [script v1.0b]
« Reply #1 on: 2014-01-18, 00:25:34 »
Testing tomorrow :)

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: sendmail userid usage limits [script v1.0b]
« Reply #2 on: 2014-01-18, 19:53:42 »
I've installed it. I can tell if it's working, because there is no much mails in queue.
« Last Edit: 2014-01-18, 19:58:17 by Spacedust »

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: sendmail userid usage limits [script v1.0b]
« Reply #3 on: 2014-01-18, 20:13:10 »
It seems to be working:

The following clients have violated sender limits: (Hourly ~ groups 1 and 2)  1:gregor76:7848 (773/50) - 2014-01-18 20:02:24

Does this mean user tried to send 773 mails while he is actually able to send 50 mails per hour ?

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: sendmail userid usage limits [script v1.0b]
« Reply #4 on: 2014-01-18, 22:56:08 »
This script is sending me mails each hour which is a bit annoying.

Offline chrisf

  • Senior Master
  • **
  • Posts: 883
  • Karma: +11/-1
  • Gender: Male
  • Be the change that you wish to see in the world.
    • View Profile
    • Conviction's Hosting
Re: sendmail userid usage limits [script v1.0b]
« Reply #5 on: 2014-01-18, 23:51:03 »
/usr/sbin/sendmailwrapper/smw_config.pl
Turn reporting off, emails will stop. ;)  also, with reporting on, it only sends an email if there are violators.

Yes, that means he TRIED to send 773 for that hour, with 50 being the maximum per hour, and any mail over that was dropped and not sent.

Look at /var/log/sendmail-limits.log for more information.
« Last Edit: 2014-01-19, 04:31:19 by chrisf »
Christopher

Knowledge in: PHP, Perl, MySQL, Javascript, Actionscript, FLASH, HTML, CSS
Server Administrator / Developer: https://convictionshosting.com

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: sendmail userid usage limits [script v1.0b]
« Reply #6 on: 2014-01-19, 00:37:15 »
Great. It works fantastic !

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: sendmail userid usage limits [script v1.0b]
« Reply #7 on: 2014-02-03, 23:48:31 »
Kloxo shouldn't be blocked !

/usr/local/lxlabs/kloxo/httpdocs - lxlabs:501 0/100 (OK)

Offline chrisf

  • Senior Master
  • **
  • Posts: 883
  • Karma: +11/-1
  • Gender: Male
  • Be the change that you wish to see in the world.
    • View Profile
    • Conviction's Hosting
Re: sendmail userid usage limits [script v1.0b]
« Reply #8 on: 2014-02-04, 01:41:19 »
this is new because of spawn-fcgi, kloxo was sending under root.

I have been so busy programming,  I need to write a commandline utility.  goto the database and under kloxo set the ignore flag to 1.

I will update the sendmail-wrapper as well. ;)
Christopher

Knowledge in: PHP, Perl, MySQL, Javascript, Actionscript, FLASH, HTML, CSS
Server Administrator / Developer: https://convictionshosting.com

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: sendmail userid usage limits [script v1.0b]
« Reply #9 on: 2014-02-04, 18:41:02 »
this is new because of spawn-fcgi, kloxo was sending under root.

I have been so busy programming,  I need to write a commandline utility.  goto the database and under kloxo set the ignore flag to 1.

I will update the sendmail-wrapper as well. ;)


That's why I don't get any e-mails from Kloxo now. This is really urgent, because I'm sending messages to my customers via Kloxo. Do you confirm this ?

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: sendmail userid usage limits [script v1.0b]
« Reply #10 on: 2014-02-04, 19:56:29 »
@Spacedust,

Try change 'phpcgi_user="lxlabs"' in /etc/init.d/kloxo
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: sendmail userid usage limits [script v1.0b]
« Reply #11 on: 2014-02-04, 20:05:08 »
@Spacedust,

Try change 'phpcgi_user="lxlabs"' in /etc/init.d/kloxo

It's already set this way.

sendmail_limits.log shows this:

[Tue, 04 Feb 2014 20:04:14 +0100] /usr/local/lxlabs/kloxo/httpdocs - lxlabs:501 1/100 (OK)

but there is no mail and maillog shows nothing :/

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: sendmail userid usage limits [script v1.0b]
« Reply #12 on: 2014-02-04, 20:14:30 »
So, it's not related to spawn-fcgi.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline chrisf

  • Senior Master
  • **
  • Posts: 883
  • Karma: +11/-1
  • Gender: Male
  • Be the change that you wish to see in the world.
    • View Profile
    • Conviction's Hosting
Re: sendmail userid usage limits [script v1.0b]
« Reply #13 on: 2014-02-04, 21:10:25 »
@spacedust, it says in that log it is (OK) which means it got sent.  I am checking and fixing right now.
Christopher

Knowledge in: PHP, Perl, MySQL, Javascript, Actionscript, FLASH, HTML, CSS
Server Administrator / Developer: https://convictionshosting.com

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: sendmail userid usage limits [script v1.0b]
« Reply #14 on: 2014-02-04, 21:59:30 »
@spacedust, it says in that log it is (OK) which means it got sent.  I am checking and fixing right now.

So why no logs in maillog for such e-mail and no e-mail received ? (spam folder checked).

 


Top 10 Social Networking:    Facebook    Twitter    LinkedIn    Pinterest    Google Plus    Tumblr    Instagram    VK    Flickr    Vine

Page created in 0.066 seconds with 17 queries.

web stats analysis