Skip to content

drate.1

Manvendra Bhangui edited this page Feb 25, 2024 · 3 revisions

NAME

drate - rate control email delivery for domains

SYNOPSIS

drate -d domain [ -D ratelimit_dir ] -r rate_expression [ -u -c -R ]

or

drate -d domain [ -D ratelimit_dir ] [ -s -l ]

or

drate -t -d domain [ -C count -f ]

DESCRIPTION

drate(1) displays or sets delivery rate for qmail-remote(8). The actual rate limiting happens in slowq-send(8), which uses the special slowq indimail queue. drate(1) locks the file domain in ratelimit_dir before writing the following four lines.

 line 1 - Rate Expression
 line 2 - Delivery Count since sampling started
 line 3 - Start Time since the sampling started
 line 4 - End   Time of the last sample

By default, slowq-send(8) resets statistics one day after the first sample. You can change the default by setting RATELIMIT_INTERVAL environment variable to the desired number of seconds. You can manually reset the interval using -R option of drate(1).

OPTIONS

-l
List domains have rate control definitions. Use -s to additionally display the configured rate and delivery statistics for listed domains.

-t
Run in test mode as if mail is getting delivered. Every invocation will update the email count and the end time. It will calculate the current rate and return error with it gets exceeded. This option simulates rate calcuation that happens during delivery and shouldn't be used on a production system

-C count
Run the test count times

-f
Force update email counts and end time.

-s
Display configured rate and delivery statistics for domain.

-d domain
Use this argument to set the domain name. domain can be the special word .global in case rate limiting has been applied for all domains that does not have a rate definition. See spawn-filter(8)

-r rate_expression
Use this argument to set the rate expression in terms of deliveries/sec. To set a delivery rate of 500 emails / hr, you can use 500/3600 for the rate expression. You can also give the prefix '+' or '-' to increase or decrease the existing rate

-D ratelimit_dir
The directory to store or retrieve delivery rate parameters and statistics. If not specified it defaults to /var/indimail/queue/slowq/ratelimit.

-c
Consolidate all rate expressions. When you give the '+' or '-' prefix in the rate_expression, the expressions are simply appended without any mathematical computation. It is valid to have an expression 1790/3600+10/3600. This option will collapse the expression to 0.5

-R
Reset all statistics in ratelimit_dir/domain. This will cause slowq-send(8) to start counting from start.

-u
Display time in UTC instead of local time zone.

SEE ALSO

slowq-send(8), qmail-remote(8),

Clone this wiki locally