exim.pl VERSION=11 to track IDs to prevent retries from being counted multiple times

Version 1.43


Manual update required to get version 11: wget -O /etc/exim.pl http://files.directadmin.com/services/exim.pl.11 Each email retry will count against a send limit. The design "flaw" in the way the limit works is that each attempt (including retries) will count as a send. The exim.pl doesn't know that a send is a retry, thus counts it as another send, to be certain it gets counted. It could figure out if it's a retry by checking the /etc/virtual/usage/user.bytes file for another entry with the same ID, however we felt the overhead of scanning the entire file for each email delivery would be too great on the system. For this reason, the exim send counter will usually be higher than the counter used by DA during the tally, as DA has the extra time to figure out what is or is not a retry. (only done once per day, instead of once per send) This has actually just given me an idea... of creating a folder,eg: /etc/virtual/usage/username_ids and anytime an email is added to the tracking logs: /etc/virtual/username.bytes /etc/virtual/username the exim.pl would also create: /etc/virtual/username_ids/<message-ID> The overhead of checking if a file exists is quite low.. and would allow the counter: /etc/virtual/username to be skipped if the ID already exists in username_ids/* The username_ids folder would be removed daily in the email rotation script. diff of the exim.pl: 3c3 < #VERSION=11 --- > #VERSION=10 290,319c290,293 < my $is_retry = 0; < if ($mid ne "") < { < if (! -d "/etc/virtual/usage/${name}_ids") < { < mkdir("/etc/virtual/usage/${name}_ids", 0770); < } < < my $id_file = "/etc/virtual/usage/${name}_ids/$mid"; < < if (-f $id_file) < { < $is_retry = 1; < } < else < { < open(IDF, ">>$id_file"); < print IDF "$timestamp"; < close(IDF); < chmod (0660, $id_file); < } < } < < if ($is_retry != 1) < { < open(USAGE, ">>/etc/virtual/usage/$name"); < print USAGE "1"; < close(USAGE); < chmod (0660, "/etc/virtual/usage/$name"); < } --- > open(USAGE, ">>/etc/virtual/usage/$name"); > print USAGE "1"; > close(USAGE); > chmod (0660, "/etc/virtual/usage/$name");

Interested to try DirectAdmin? Get a 30-day Free Trial!