User Tools

Site Tools


reference:bandwidth_management_script

Bandwidth Control

(VPOP3 Enterprise Only)

Every time a connection is made to a VPOP3 service, or a user logs into a service, VPOP3 Enterprise runs a Lua function which can assign the connection a bandwidth pool, or assign a bandwidth limit on the connection.

VPOP3 runs a function called 'GetBandwidth' in a file called bandwidth.lua in the VPOP3 directory.

The function signature is: GetBandwidth(Params)

The Params parameter is a Lua table with the following entries

  • clientip - The IP address of the client computer connecting to VPOP3
  • serveraddress - The local IP address of the VPOP3 service which is being connected to
  • serverport - The local TCP port which is being connected to
  • servertype - The local service type (eg POP3, IMAP4, SMTP)
  • serverid - The numeric ID of the service being connected to
  • serverbandwidth - The configured bandwidth for the service being connected to
  • bandwidth - The current bandwidth limit on the connection
  • username - The currently logged in user (if any)
  • usernumber - The internal numeric user ID of the currently logged in user (if any)
  • userbandwidth - The configured bandwidth limit of the currently logged in user (if any) - this is not currently used

The function returns a number indicating the bandwidth limit to apply

  • 0 = no limit
  • 1 to 999999999 = bandwidth limit (in bytes per second) of this connection
  • -1 to -1000 = bandwidth pool to use (as a negative number, -1 = bandwidth pool 1, etc)
reference/bandwidth_management_script.txt · Last modified: 2018/11/14 10:45 by 127.0.0.1