Koozali.org: home of the SME Server

Controlling email via Bandwidth usage

Offline shawnbishop

  • *****
  • 298
  • +0/-0
Controlling email via Bandwidth usage
« on: December 02, 2009, 06:39:01 AM »
Good Day

I have a complex request and want to know if it can be done.

I would like to control email as follows by email size time the amount of recipients ( email x amount of recipients), so not the recipients limit number. eg

1 . I send 1MB email to 20 recipients = 20MB , = OK
2. I send   100K email to 200 recipients = 20MB = OK
3. I send 1MB email to 50 recipients = 50MB = not delivered..

So if the limit on the bandwidth is exceeded then the mail is not delivered, hopefully I have made some sense??

( This is not quotas on the local mailbox, this is outgoing smtp mail to users not on the local mailserver)

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Controlling email via Bandwidth usage
« Reply #1 on: December 02, 2009, 12:45:45 PM »
shawnbishop

I'm not aware of that sort of control.
You seem to be concerned about bandwidth usage so the following will help.

You can specify the number of remote & local concurrent messages for qmail, and the number of Instances for qpsmtpd and smtpd which will effectively control the email load imposed on available bandwidth
ie less messages are processed at the same time, so email messages get processed more slowly thus consuming less available bandwidth, which still allows bandwidth for other forms of Internet access.

As well the HTBWondershaper script, now available as a contrib, can control the outgoing bandwidth usage generally so that your system does not grind to a halt when a large batch of email message are sent etc.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Controlling email via Bandwidth usage
« Reply #2 on: December 02, 2009, 04:00:22 PM »
I have a complex request and want to know if it can be done.

I would like to control email as follows by email size time the amount of recipients ( email x amount of recipients), so not the recipients limit number. eg

1 . I send 1MB email to 20 recipients = 20MB , = OK
2. I send   100K email to 200 recipients = 20MB = OK
3. I send 1MB email to 50 recipients = 50MB = not delivered..

So if the limit on the bandwidth is exceeded then the mail is not delivered, hopefully I have made some sense??

It can be done, but you would need to write a custom qpsmtpd plugin.

Your first recourse should be to use human engineering. Tell your users not to do 3, then audit mail logs, and sanction any violators.

Offline shawnbishop

  • *****
  • 298
  • +0/-0
Re: Controlling email via Bandwidth usage
« Reply #3 on: December 02, 2009, 09:48:19 PM »
Thanks Charlie

The Human Engineering has failed as such..so the custom plugin would have to be done, and therein is the challenge, any ideas?

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Controlling email via Bandwidth usage
« Reply #4 on: December 02, 2009, 10:30:59 PM »
shawnbishop

Did you read my post ?
If you don't require absolute limits as per your list, but are really just trying to implement a form of QoS, then the workarounds I suggested are practical and easily implemented with a few db commands and/or yum install of a contrib.

If you know how to write a custom plugin or are willing to pay Charlie to do it, then of course go for that method.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline shawnbishop

  • *****
  • 298
  • +0/-0
Re: Controlling email via Bandwidth usage
« Reply #5 on: December 03, 2009, 05:42:02 AM »
Hi mary

Yes I did read your post, I was looking at controlling the email at the qmail level, but I am going through the script to see if it would help

Thanks

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Controlling email via Bandwidth usage
« Reply #6 on: December 03, 2009, 06:26:26 AM »
shawnbishop

Quote
I was looking at controlling the email at the qmail level...

Well that was my first suggestion:
"You can specify the number of remote & local concurrent messages for qmail, and the number of Instances for qpsmtpd and smtpd which will effectively control the email load imposed on available bandwidth "
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.