[exim] Fwd: Quota Problem

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Gordon Dickens
Datum:  
To: exim-users
Betreff: [exim] Fwd: Quota Problem
In my previous post I should have mentioned that I have reproduced this
issue with both exim 4.84 (on Debian 8) and exim 4.86 (on FreeBSD 10.1).

FYI,

Gordon


-------- Forwarded Message --------
Subject:     Quota Problem
Date:     Sun, 14 Feb 2016 11:24:18 -0500
From:     Gordon Dickens <gordon@???>
To:     exim-users@???




I've been staring at this problem for almost a day now and I would
appreciate some fresh eyes taking a look. In short, I have converted my
transport to extract its data from address_data, which is a mysql lookup
in my router, instead of doing another mysql lookup directly in the
transport. However, although everything worked properly in the
transport using the mysql lookup, now with the quota extracted from
address_data, mail is rejected each time with the following log message:

mailbox is full (MTA-imposed quota exceeded while writing to
tmp/1455462543.H946610P6695.spock.discoduck.org)

Although the quota is set to 999MB and the message is less than 337
bytes in size and the current mail storage directory size is 384KB.

It appears that exim is not converting my quota in megabytes to bytes in
my transport if I extract the quota from address_data.

For example, when I debug using "exim -d+deliver+transport" then I see
the following values although the quota is set to 999MB:

Exim quota = 999 old size = 6421 this message = 337 (not included)

My transport is extracting the quota with "quota =
${extract{quota}{$address_data}}" where address_data is a mysql lookup
in my router. However, if I place the mysql lookup directly in the
transport then everything works and my debug values are then:

Exim quota = 1047527424 old size = 6421 this message = 337 (not included)

So, if I use the mysql lookup in the transport then exim converts the
quota value from megabytes to bytes, however, if I extract the quota
from address_data in my transport then it does not convert the value
from megabytes to bytes.

Am I being incredibly stupid or is this a bug or something else?

Here is my virtual_domains router:

virtual_domains:
driver = redirect
domains = +local_domains
allow_fail

   address_data = ${lookup mysql{\
         select smtp, users.sa_tag*10 AS sa_tag, users.on_spamassassin
AS on_spamassassin, \
         users.uid AS uid, users.gid AS gid, users.quota AS quota from
users,domains \
         where localpart = '${quote_mysql:$local_part}' \
                 and domain = '${quote_mysql:$domain}' \
                 and domains.enabled = '1' \
                 and users.enabled = '1' \
                 and users.domain_id = domains.domain_id}{$value}fail}


data = ${extract{smtp}{$address_data}}

file_transport = virtual_delivery
reply_transport = address_reply
pipe_transport = address_pipe

Here is my virtual_delivery transport which extracts the quota from
address_data and which does not work properly since the quota is not
converted from megabytes to bytes:

virtual_delivery:
   driver = appendfile
   envelope_to_add
   return_path_add
   mode = 0600
   maildir_format = true
   create_directory = true
   directory = ${extract{smtp}{$address_data}}
   user = ${extract{uid}{$address_data}}
   group = ${extract{gid}{$address_data}}
   quota = ${extract{quota}{$address_data}}
   quota_is_inclusive = false
   quota_warn_threshold = 80%
  maildir_use_size_file = true
   quota_warn_message = "To: $local_part@$domain\n\
                         Subject: Mailbox quota warning\n\n\
                         This message was automatically generated by the
mail delivery software.\n\n\
                         You are now using over 75% of your allocated
mail storage quota.\n\n\
                         If your mailbox fills completely, further
incoming messages will be automatically\n\
                         returned to their senders.\n\n\
                         Please take note of this and remove unwanted
mail from your mailbox.\n"



Here is my virtual_delivery transport modified to get the quota from a
mysql lookup and which works properly by converting the quota from
megabytes to bytes:

virtual_delivery:
   driver = appendfile
   envelope_to_add
   return_path_add
   mode = 0600
   maildir_format = true
   create_directory = true
   directory = ${extract{smtp}{$address_data}}
   user = ${extract{uid}{$address_data}}
   group = ${extract{gid}{$address_data}}
   quota = ${lookup mysql{select users.quota from users,domains \
                 where localpart = '${quote_mysql:$local_part}' \
                 and domain = '${quote_mysql:$domain}' \
                 and users.domain_id = domains.domain_id}{${value}M}}
   quota_is_inclusive = false
   quota_warn_threshold = 80%
maildir_use_size_file = true
   quota_warn_message = "To: $local_part@$domain\n\
                         Subject: Mailbox quota warning\n\n\
                         This message was automatically generated by the
mail delivery software.\n\n\
                         You are now using over 75% of your allocated
mail storage quota.\n\n\
                         If your mailbox fills completely, further
incoming messages will be automatically\n\
                         returned to their senders.\n\n\
                         Please take note of this and remove unwanted
mail from your mailbox.\n"