MRatWork Forum by Mustafa Ramadhan
Sawo Project - Kloxo-MR Discussions => Kloxo-MR Tips and Tricks => Topic started by: chrisf on 2014-02-19, 08:41:30
-
This is a update and rewrite of the first script. Please read:
http://forum.mratwork.com/kloxo-mr-tips-and-tricks/sendmail-userid-usage-limits-(script-v1-0b)/ (http://forum.mratwork.com/kloxo-mr-tips-and-tricks/sendmail-userid-usage-limits-(script-v1-0b)/)
The idea behind this update is no longer to send the mail piped line by line to the original sendmail. Malformed email, or an extra carriage return/enter was causing the script to halt and not send. To overcome this, I use a bash script to check with our database (OK to send mail) and then pipe it directly to the qmail sendmail program. It gets it unaltered. If a limit is reached, it simply doesn't pass it to the qmail sendmail.
This also made it faster, and under load, it performs better. The logging has been changed, and can be either on or off. It will log the time, working directory of the script which invoked it, user, user id, current count / Max count, and status.
If you already installed v1.0 you do not have to redo the SQL, but the configuration file and all else have changed. Right before running the new install script, issue this command
rm -rf /usr/sbin/sendmailwrapper
Install is
cd /tmp
wget http://cc-server1.us/sendmail_wrapper20140219.zip
unzip sendmail_wrapper20140219.zip
./smw_install.sh
Log can be found at: /var/log/sendmail-limits.log and is rotated automatically daily, saving previous 10.
Read the txt file for details BEFORE running the install script, configuration is easy. Again, report any issues. This is a must for a shared hosting environment.
Enjoy!
-
Works well !!! Kloxo works fine, php scripts works fine. Fantastic job !
-
this is major for everybody from free / payd host to personal vps on which site can be hacked on a user level and accout used as provy for spam... thnx
-
Hello chrisf, I'm using your script and it works great, mails start to get dropped when the limit is reached and I get the notification e-mail, so thank you alot for this!
I am however not sure how to add users to the groups even after reading the instructions.
Could you provide an example of the configuration as such:
userA should belong to group 1
userB should belong to group 2
how would this look in the config file?
thanks again!
-
The hourly script stop working when many users send e-mail above limit:
[root@online stanislawbil]# /usr/sbin/sendmailwrapper/smw_cron_hourly
sendmail: fatal: file /etc/postfix/main.cf: parameter mail_owner: unknown user name value: postfix
Died at /usr/sbin/sendmailwrapper/smw_cron_hourly line 38.
-
@Asciiker - a new version will be released in a few weeks, a command line tool simplifies configuration.
@Spacedust, how many overages does it take? I've had 80. That line where it is exiting is for sending the email. In the new version I have rewrote the send routines and will have you test to let me know.
-
Links are down. Please bring them back !
-
Bring it back !!!
-
These messages are looking wrong:
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on xxx.pl X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=NO_RELAYS autolearn=unavailable autolearn_force=no version=3.4.0 Delivered-To: xxx.pl-admin@xxx.pl Received: (qmail 18465 invoked by uid 0); 19 Sep 2015 08:00:01 -0000 Date: 19 Sep 2015 08:00:01 -0000 Message-ID: <20150919080001.18464.qmail@xxx.pl> From: root@xxx.pl Subject: Mail limit report To: admin@xxx.pl The following clients have violated sender limits: (Hourly ~ groups 1 and 2) 1:gatek89:7812 (720/100) - 2015-09-19 09:56:23
-
hello, it's 25 an hour or for 1 day?
is count in tables client_sendmail will reset for 1 hour or not?
because my client with > 25 cannot send email anymore before i reset count to 0
thanks
-
my bad, i not set cron :D
thanks @chrisf for the great script
-
chrisf can you add message body to these reports ?
-
uhm... sorry for bother you guys.
but, i install the script at leaseweb cloud vps, and i got error (in folder /tmp):
-bash: ./smw_install.sh: Permission denied
can't you help me. please :D
-
Permission of 'smw_install.sh' muat 755 or run with 'sh ./smw_install.sh'.
-
Permission of 'smw_install.sh' muat 755 or run with 'sh ./smw_install.sh'.
works! thanks
-
hello sorry to bother you again guys.
when my clients created email account for they domain and they use roundcube, in database i see user is "apache" not they username.
so if i have 5 clients, each of they create 3 email account, they belonging to the user "apache".
it's normal or not? thanks
-
hello sorry to bother you again guys.
when my clients created email account for they domain and they use roundcube, in database i see user is "apache" not they username.
so if i have 5 clients, each of they create 3 email account, they belonging to the user "apache".
it's normal or not? thanks
Website for cp and webmail are under 'apache' user.
-
when i change from roundcube to afterlogic, database sendmailwrapper not counting sent mail.
when i change it again to roundcube, it's counting again.
how to uninstall or not displayed webmail except roundcube?
so to limit and prevent spam, in my host webmail client is only roundcube (in this case i can limit it from user "apache").
-
Go to 'webmail applications' and select 'roundcube'.
-
Go to 'webmail applications' and select 'roundcube'.
uhm.. my client will can change it again at "webmail applications menu".
i mean, the list of webmail applications only roundcube. is posibble?
-
Need uninstall afterlogic with 'yum remove *afterlogic* -y; rm -rf /home/kloxo/webmail/afterlogic'.
-
Could you provide an example of the configuration as such:
userA should belong to group 1
userB should belong to group 2
how would this look in the config file?
thanks again!
yes i need it..i didn;t see in txt .. just
Clients in group...
1 can send 25 per hour
2 75 per hour
3 can send 300 per half day (12 hours)
4 500 per half day
5 can send 2000 per day (24 hours)
6 5000 per day
i only change this
# chrisf sendmail-wrapper v1.1b
5;
i dont know to add some user into another group, please help?