[Exim] Wishlist for "stat" expansion item

Góra strony
Delete this message
Reply to this message
Autor: Dean Brooks
Data:  
Dla: exim-users
Temat: [Exim] Wishlist for "stat" expansion item
Hi,

Here is a possible wishlist request for a "stat" expansion operator
for Exim4.

Proposed syntax would be something like:

    ${stat{filename}{lookup-value}}


where the lookup-value would be an enumerator for one of the stat() values.

For example:

${stat{/var/mail/$local_part}{size}} --> Size of mailbox
${stat{/var/mail/$local_part}{uid}} --> UID of mailbox owner
${stat{/var/mail/$local_part}{mtime}} --> Last modify time of mailbox

You could even have an enumerator option of "exists" that would instead
simply return true or false based upon whether the stat worked or not,
which would provide an expansion alternative to the exists operator.

Perhaps a real-life example would be the following, which is presently
impossible(??) to do without using ${run} or something similar:

quotareject:
driver = redirect
check_local_user
allow_fail
condition = "${if >{${stat{/var/mail/$local_part}{size}}{5M}} {yes}{no}}"
data = :fail: Mailbox is over quota
fail_verify_recipient

I've been trying to figure out a way to do the above router without
the stat function, and it's the only way I can think of to do it.
This would allow a way to do quota-checks at ACL time by way of
recipient verification.

Regards,

Dean Brooks
dean@???