## ## Add these lines to your qpopper's popper.conf file to configure ## rate-limiting services via the HAPPYMAIL patch. ## # # Happymail values may be given as a bare number, as a number plus a # letter indicating the unit of measure, or as just a unit of measure. # Numbers must be positive whole numbers. (The standard base notations # apply: 0400 is equal to 0x100 or 256.) # # Time units allowed: "s" for seconds, "m" for minutes, "h" for hours, # "d" for days(!). # # Space units allowed: "b" for bytes, "k" for kilobytes, "m" for # megabytes, "g" for gigabytes. The multiplier here is 1024, not 1000. # # Bare numbers are assumed to be in seconds or bytes, except as noted. # Bare units are assumed to be one of that unit -- one minute, one # megabyte, etc. # # Buffer size for mailbox bulk-copy routines. Values under 1024 are # considered kilobytes, and multiplied up. This value can be given on # the command line with "-z <##>". Default: system-dependent set happymail-bufsiz=16k # # The next five parameters let you specify the amount of time that users # must waut between mail checks, as a function of: # (a) a mandatory minimum time value for all users (happymail-base) # (b) a scaling factor derived from the size of the user's inbox # (happymail-rate-seconds and happymail-rate-bytes) # (c) a quantity of mail to which this scaling factor is not applied # (happymail-free), and # (d) a maximum wait time for any user (happymail-max). # # happymail-base is the base timer for all users. Default: 0 seconds. set happymail-base=50s # # happymail-free is the amount of mail (in bytes) a user may have in the # inbox before we start adding to the base timer. Default: 0 bytes. #set happymail-free=1048576 # or: #set happymail-free=1048576b # or: #set happymail-free=1024k # or: set happymail-free=1m # # happymail-rate-seconds and happymail-rate-bytes add seconds # to the individual timer for each bytes in the inbox. Default: # 0 seconds per byte. # # This would "cost" a user 90 seconds for each 10 MB: # set happymail-rate-seconds=90 # set happymail-rate-bytes=10485760 # or: # set happymail-rate-seconds=90s # set happymail-rate-bytes=10m # # A little more hard-line: two minutes per half-MB. # set happymail-rate-seconds=120 # set happymail-rate-bytes=5242880 # or: # set happymail-rate-seconds=2m # set happymail-rate-bytes=512k # # Seriously draconian: 1 minute per 25K. # set happymail-rate-seconds=60 # set happymail-rate-bytes=25600 # or: # set happymail-rate-seconds=60s # set happymail-rate-bytes=25k # # This is what we're currently using at uchicago.edu: 1 minute per MB. set happymail-rate-seconds=1m set happymail-rate-bytes=m # # The maximum timer length a user should get, to prevent those with # outrageously large inboxes from getting hours or days more than you # really need them to. Default: 0 (no maximum). set happymail-max=45m # # COMMAND-LINE USE: # # All five happymail parameters can be overriden on the command line using # the terrifying notation "-h BBB+AAA:ZZZ@FFF!MMM", where: # BBB - happymail-base: base delay period for all users # AAA - happymail-rate-seconds: time added for additional mailbox size # ZZZ - happymail-rate-bytes: size unit which adds AAA time to timer # FFF - happymail-free: amount of mailbox that's "free" # MMM - happymail-max: maximum timer length for users with any size inbox # # As in the config file, BBB, AAA, and MMM will accept time-unit suffixes: # "s" for seconds, "m" for minutes, "h" for hours, "d" for days(!). # # ZZZ and FFF will accept size-unit suffixes: # "b" for bytes, "k" for kilobytes, "m" for megabytes, "g" for gigabytes. # # "-h 5m" applies a 5-minute timer to each user. # "-h 1m+60:10m" starts each user with a one-minute timer, then adds # 60 seconds for each 10 MB in the inbox. # "-h 60+1m:10240k" same thing, different units # "-h 5m+1m:1m@10m 5 minute base timer, plus another minute per megabyte # after the first 10 megabytes # "-h 5m+1m:1m@10m!1h" same, but never assign anyone more than a one-hour timer # "-h 5m+1m:1m!1h" same, without the free mail # # For convenience, timers are ultimately always rounded down to a round # number of minutes, and users are given 30 seconds of latitude to help # dodge clock skew. So a user "charged" 282 seconds of wait time will # really only need to wait 210 seconds: 282 -> 240 -> 210. # # # NOTIFICATIONS # # A user receiving a rejection gets a message like this: # -ERR [HAPPYMAIL] Please wait at least 7 minutes between checks. [0:90:10485760@0!0 [49093847] => 0 + 420 => 7] # # This message appears in the server's syslog, too, prefixed by the # username and the client's hostname/IP address. # The ugly code at the end tells support staff why the 7-minute timer # was imposed, using the same notation as the "-h" command-line option: # 0 base + 90 seconds per 10485760 bytes, with 0 free, with a mailbox # 49093847 bytes in size, is 0 seconds plus a 420-second adjustment, or # 7 minutes. The first part is copied exactly from the config file or # command line settings, but units are converted to base units (seconds, # bytes). You can do the math: # 49093847 (inbox size) - 0 (free) = 49093847 bytes accounted # 49093847 / 10485760 (rate-bytes) = 4 * 90 (rate-seconds) = 421 seconds # 421 seconds rounded down to a minute is 7 minutes # # Since the happymail-max value is 0, a 7-minute timer is applied. If it # were nonzero, timers larger than the max timer length would be # attenuated to that period. For example: # # -ERR [HAPPYMAIL] Please wait at least 5 minutes between checks. [0:90:10485760@0!300 [49093847] => 0 + 420 > 300] # # This is the same user with the same mailbox, but with happymail-max set # to 5 minutes. The ugly code shows that although the happymail algorithm # computed a 420-second delay for this user, it was attenuated to 300 seconds # because of the happymail-max setting. # # INQUIRING HAPPYMAIL SETTINGS AND VERSION # # When the HAPPYMAIL patch is applied, the POP3 "CAPA" command shows # the HAPPYMAIL patchlevel and the HAPPYMAIL parameters for the current # session: # X-HAPPYMAIL pl8 bufsiz:16384 base:50 rate:60s/1048576b free:1048576b max:2700s #