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-04-27, 19:33:45

Author Topic: How to limit qmail send  (Read 6759 times)

0 Members and 1 Guest are viewing this topic.

Offline itdungpt

  • Junior Member
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile
How to limit qmail send
« on: 2015-03-19, 05:25:53 »
[root@qt ~]# ps aux | grep qmail
qmailr    1216  0.0  0.0   4092   532 ?        S    Mar06   7:12 qmail-rspawn
qmailr    2790  0.0  0.0  35000  1716 ?        S    Mar11   0:00 /var/qmail/bin/qmail-remote.orig virgilio.it noreply@hellobank.it jordan7@virgilio.it
qmaill    3832  0.0  0.0   4072   644 pts/0    S    11:18   0:00 /var/qmail/bin/splogger smtp
root      3833  0.0  0.0   4100   456 pts/0    S    11:18   0:00 /usr/bin/tcpserver -v -R -c 200 0 110 /var/qmail/bin/qmail-popup qt.movietnamco.com /home/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir
qmaill    3836  0.0  0.0   4072   644 pts/0    S    11:18   0:00 /var/qmail/bin/splogger authlib
qmaill    3838  0.0  0.0   4072   644 pts/0    S    11:18   0:00 /var/qmail/bin/splogger submission
qmaill    3839  0.1  0.0   4072   644 pts/0    S    11:18   0:00 /var/qmail/bin/splogger imap4
qmaill    3840  0.0  0.0   4072   648 pts/0    S    11:18   0:00 /var/qmail/bin/splogger imap4-ssl
qmaild    3841  0.0  0.0   4100   468 pts/0    S    11:18   0:00 /usr/bin/tcpserver -v -R -H -l qt.movietnamco.com -x /etc/tcprules.d/tcp.smtp.cdb -c 10 -u 7791 -g 2108 0 587 /usr/bin/recordio /var/qmail/bin/qmail-smtpd /home/vpopmail/bin/vchkpw /bin/true
qmaill    3843  0.0  0.0   4072   644 pts/0    S    11:18   0:00 /var/qmail/bin/splogger pop3-ssl
qmaill    3844  0.0  0.0   4072   648 pts/0    S    11:18   0:00 /var/qmail/bin/splogger pop3
qmaill    3845  0.0  0.0   4072   648 pts/0    S    11:18   0:00 /var/qmail/bin/splogger smtp-ssl
qmaild    3846  0.0  0.0   4100   464 pts/0    S    11:18   0:00 /usr/bin/tcpserver -v -R -H -l qt.movietnamco.com -x /etc/tcprules.d/tcp.smtp.cdb -c 10 -u 7791 -g 2108 0 465 /usr/bin/recordio /var/qmail/bin/qmail-smtpd /home/vpopmail/bin/vchkpw /bin/true
qmaild    3847  0.0  0.0   4100   468 pts/0    S    11:18   0:00 /usr/bin/tcpserver -v -R -H -l qt.movietnamco.com -x /etc/tcprules.d/tcp.smtp.cdb -c 10 -u 7791 -g 2108 0 25 /usr/bin/recordio /var/qmail/bin/qmail-smtpd /home/vpopmail/bin/vchkpw /bin/true
qmails    3848  1.2  0.0  10624   800 pts/0    S    11:18   0:02 qmail-send
qmaill    3849  0.2  0.0   4072   652 pts/0    S    11:18   0:00 /var/qmail/bin/splogger send
root      3879  0.0  0.0   4092   456 pts/0    S    11:18   0:00 qmail-lspawn ./Maildir/
qmailr    3880  0.8  0.0   4092   496 pts/0    S    11:18   0:01 qmail-rspawn
qmailq    3881  0.0  0.0   4064   440 pts/0    S    11:18   0:00 qmail-clean
qmailr    3916  0.0  0.0  35000  1768 pts/0    S    11:18   0:00 /var/qmail/bin/qmail-remote.orig terra.com.br anonymous@movietnamco.movietnamco carolinefav@terra.com.br
qmailr    3942  0.0  0.0  35000  1772 pts/0    S    11:18   0:00 /var/qmail/bin/qmail-remote.orig terra.com.br anonymous@movietnamco.movietnamco cncopias@terra.com.br
qmailr    3952  0.0  0.0  35000  1764 pts/0    S    11:18   0:00 /var/qmail/bin/qmail-remote.orig terra.com.br anonymous@movietnamco.movietnamco robertson.souza@terra.com.br
qmailr    3967  0.0  0.0  35000  1772 pts/0    S    11:18   0:00 /var/qmail/bin/qmail-remote.orig automar.com.br anonymous@movietnamco.movietnamco gisele@automar.com.br
qmailr    4003  0.0  0.0  35000  1768 pts/0    S    11:19   0:00 /var/qmail/bin/qmail-remote.orig automar.com.br anonymous@movietnamco.movietnamco silvana@automar.com.br
qmailr    4004  0.0  0.0  35000  1764 pts/0    S    11:19   0:00 /var/qmail/bin/qmail-remote.orig automar.com.br anonymous@movietnamco.movietnamco rosana@automar.com.br
qmailr    4006  0.0  0.0  35000  1768 pts/0    S    11:19   0:00 /var/qmail/bin/qmail-remote.orig automar.com.br anonymous@movietnamco.movietnamco rene@automar.com.br
qmailr    4019  0.0  0.0  35000  1772 pts/0    S    11:19   0:00 /var/qmail/bin/qmail-remote.orig automar.com.br anonymous@movietnamco.movietnamco waldemir.recanello@automar.com.br
qmailr    4076  0.0  0.0  35000  1768 pts/0    S    11:19   0:00 /var/qmail/bin/qmail-remote.orig terra.com.br anonymous@movietnamco.movietnamco lilia.mello@terra.com.br
qmailr    4111  0.0  0.0  35000  1768 pts/0    S    11:19   0:00 /var/qmail/bin/qmail-remote.orig nortel.com anonymous@movietnamco.movietnamco mcidri@nortel.com
qmailr    4143  0.0  0.0  35000  1768 pts/0    S    11:19   0:00 /var/qmail/bin/qmail-remote.orig postmaster.twitter.com anonymous@movietnamco.movietnamco follow-gnavnpyrho=ubgznvy.pbz-653cc@postmaster.twitter.com
qmailr    4278  0.0  0.0  35000  1768 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig gmail.com.br anonymous@movietnamco.movietnamco recrutamento.cooperativa@gmail.com.br
qmailr    4397  0.0  0.0  35000  1764 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig automar.com.br anonymous@movietnamco.movietnamco carlos.fernandes@automar.com.br
qmailr    4411  0.0  0.0  35000  1764 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4418  0.0  0.0  35000  1764 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig gruponicolasmateos.com anonymous@movietnamco.movietnamco franpoveda@gruponicolasmateos.com
qmailr    4419  0.0  0.0  35000  1760 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig gruponicolasmateos.com anonymous@movietnamco.movietnamco franpoveveda@gruponicolasmateos.com
qmailr    4422  0.0  0.0  35000  1764 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig gruponicolasmateos.com anonymous@movietnamco.movietnamco fernando@gruponicolasmateos.com
qmailr    4426  0.2  0.0  35000  1764 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig gruponicolasmateos.com anonymous@movietnamco.movietnamco natalia.borja@gruponicolasmateos.com
qmailr    4439  0.0  0.0  35000  1768 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4441  0.0  0.0  35000  1764 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4443  0.0  0.0  35000  1772 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4445  0.0  0.0  35000  1764 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4448  0.0  0.0  35000  1764 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4450  0.0  0.0  35000  1768 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4455  0.0  0.0  35000  1764 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4459  0.0  0.0  35000  1772 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4462  0.0  0.0  35000  1772 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4472  0.0  0.0  35000  1768 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4475  0.0  0.0  35000  1768 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4477  0.1  0.0  35000  1768 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4479  0.0  0.0  35000  1768 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4481  0.0  0.0  35000  1764 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4483  0.0  0.0  35000  1768 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4488  0.0  0.0  35000  1764 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4492  0.0  0.0  35000  1768 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4495  0.0  0.0  35000  1768 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4498  0.0  0.0  35000  1764 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4505  0.0  0.0  35000  1768 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4525  0.1  0.0  35000  1768 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4527  0.0  0.0  35000  1768 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4529  0.0  0.0  35000  1768 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4531  0.0  0.0  35000  1764 pts/0    S    11:20   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4536  0.2  0.0  35000  1764 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4541  0.1  0.0  35000  1764 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4554  0.1  0.0  35000  1768 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4557  0.1  0.0  35000  1772 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4577  0.1  0.0  35000  1764 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4582  0.1  0.0  35000  1764 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4597  0.0  0.0  35000  1768 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4601  0.3  0.0  35000  1772 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4604  0.2  0.0  35000  1768 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4607  0.2  0.0  35000  1772 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4609  0.0  0.0  35000  1768 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4617  0.0  0.0  35000  1772 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4619  0.1  0.0  35000  1768 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4621  0.6  0.0  35000  1768 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4623  0.0  0.0  35000  1768 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4641  0.2  0.0  35000  1768 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4660  0.3  0.0  35000  1768 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
qmailr    4669  0.1  0.0  35000  1764 pts/0    S    11:21   0:00 /var/qmail/bin/qmail-remote.orig hellobank.it  noreply@hellobank.it
root      4751  0.0  0.0 103248   868 pts/0    S+   11:21   0:00 grep qmail
qmailr    4875  0.0  0.0  35000  1712 ?        S    Mar11   0:00 /var/qmail/bin/qmail-remote.orig tiscali.it noreply@hellobank.it ila.fantin@tiscali.it
qmailr   21688  0.0  0.0  35000  1712 ?        S    Mar11   0:00 /var/qmail/bin/qmail-remote.orig tiscali.it noreply@hellobank.it brunomauriello@tiscali.it
qmailr   22501  0.0  0.0  35000  1720 ?        S    Mar11   0:00 /var/qmail/bin/qmail-remote.orig virgilio.it noreply@hellobank.it s.tenaz@virgilio.it
qmailr   23399  0.0  0.0  35000  1716 ?        S    Mar10   0:00 /var/qmail/bin/qmail-remote.orig tiscali.it noreply@hellobank.it ingegnerechiappetta@tiscali.it
qmailr   32469  0.0  0.0  35000  1716 ?        S    Mar11   0:00 /var/qmail/bin/qmail-remote.orig virgilio.it noreply@hellobank.it med.nucleare.augusta@virgilio.it




please help me limit qmail send

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: How to limit qmail send
« Reply #1 on: 2015-03-19, 08:06:35 »
In  latest qmail-toaster, still no options for limiting sending mail but possible 'ban' certain domain to make this domain unable using sendmail (usually php using mail() funtions for sendmail).
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline itdungpt

  • Junior Member
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: How to limit qmail send
« Reply #2 on: 2015-03-19, 09:27:37 »
i don't want ban mail user
i want limit them.

i want limit proccess qmail on kloxomr

CPU overload because many proccess qmail.


Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: How to limit qmail send
« Reply #3 on: 2015-03-19, 10:47:50 »
With 'ban' method, only sending mail via sendmail will be ban (usually from php mail()). Send mail via smtp still ok.
..:: 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: How to limit qmail send
« Reply #4 on: 2015-03-19, 11:43:32 »
Mustafa - how to make a ban ?

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: How to limit qmail send
« Reply #5 on: 2015-03-19, 12:22:02 »
1. Execute 'cat /var/log/maillog|grep PWD' and then you can see (example):
Code: [Select]
Mar 18 04:30:25 oln3 root: sendmail: CALLER="/opt/php54s/usr/bin/php -c /opt/php54s/custom/php54s.ini ../bin/common/background.php /tmp/backgroundtlhlI8" PWD="/usr/local/lxlabs/kloxo/httpdocs" BAN="no"
Mar 18 11:24:51 oln3 root: sendmail: CALLER="php-fpm: pool devel" PWD="/home/devel/forum.mratwork.com" BAN="no"

So, you know where sendmail came from. In this example is '/home/devel/forum.mratwork.com'.

2. If you want ban '/home/devel/forum.mratwork.com', add '/home/devel/forum.mratwork.com' to '/var/qmail/control/badsendmailfrom' file.

3. Next time you will see:
Code: [Select]
Mar 18 11:24:51 oln3 root: sendmail: CALLER="php-fpm: pool devel" PWD="/home/devel/forum.mratwork.com" BAN="yes"
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: How to limit qmail send
« Reply #6 on: 2015-03-19, 12:24:21 »
Learn '/var/qmail/bin/sendmail-wrapper' file to know how it's work.
..:: 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: How to limit qmail send
« Reply #7 on: 2015-03-19, 20:36:22 »
Does it work also for /home/user/domain.pl/script.php or it has to be specified out there ?

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: How to limit qmail send
« Reply #8 on: 2015-03-19, 21:13:55 »
No, only work for PWD (equal to documentroot of website).
..:: 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: How to limit qmail send
« Reply #9 on: 2015-03-21, 21:08:06 »
This gives nothing - because if domain is hacked then I won't be adding more and more infected scripts into this script...

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: How to limit qmail send
« Reply #10 on: 2015-03-21, 21:14:30 »
If your client is client1 and his/her domain is domain1.com, usually document root is /home/client1/domain1.com.

So, to ban for sendmail just enough add ' /home/client1/domain1.com'. Add ' /home/client1/domain1.com/test.php is not work.
..:: 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: How to limit qmail send
« Reply #11 on: 2015-03-22, 17:32:54 »
I've tested this and it wasn't blocked. Why don't you implement sendmail-limits normally (with a limit of 100 messages per hour for all and a database ?)

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: How to limit qmail send
« Reply #12 on: 2015-03-22, 18:28:49 »
Change content of '/var/qmail/bin/sendmail-wrapper' with:
Code: [Select]
#!/bin/sh

## MR -- listing of the document root of website to banned
file="/var/qmail/control/badsendmailfrom"

banned="no"
pwded=$(pwd)

if [ -f $file ] ; then
for i in $(cat $file|tr '\' ' ') ; do
if [ "${i}" == "${pwded}" ] ; then
banned="yes"
fi
done
fi

## MR -- save to log for sendmail info
/bin/logger -p mail.info "sendmail: CALLER=\"$(ps -ocommand= -p $PPID|tr '\n' ' '|tr -s ' '|sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')\" PWD=\"${pwded}\" BAN=\"${banned}\""

if [ "${banned}" == "no" ] ; then
/var/qmail/bin/sendmail-qmail "$@"
fi
..:: 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

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix

Page created in 0.069 seconds with 18 queries.

web stats analysis