[exim] message_size_limit messages to the recipient when exc…

Top Page
Delete this message
Reply to this message
Author: Mark Elkins
Date:  
To: exim-users@exim.org
Subject: [exim] message_size_limit messages to the recipient when exceeded
Hi,

I run the latest exim on a server that receives mail for multiple
domains, I thus use MySQL to manage my users.

In my Transports - I have:

mysql_delivery:
  driver = appendfile
  directory = /var/spool/mail/$domain/$local_part/
  maildir_format = true
  directory_mode = 0755
  create_directory = true
  user = smmsp
  group = smmsp
  mode = 0660
  message_size_limit = ${lookup mysql {select imsize from admin where
punyuser='${local_part}@${domain}'}}M
  quota = ${lookup mysql {select mquota from admin where
punyuser='${local_part}@${domain}'}}M
  quota_is_inclusive=false
  quota_warn_threshold = 80%
  quota_warn_message = "\
    To: $local_part@$domain\n\
    Subject: Mailbox is 80% full\n\n\
    This message is automatically created by the mail delivery system.\n\n\
    The size of your mailbox has exceeded the warning threshold of 80%.\n\
    Please consider cleaning out old e-mail or reducing the number of
days\n\
    you keep mail on the system (a setting in your local e-mail reader).\n"


So Quote Warnings are quite good, over a threshold and send a warning. :-)

Both quota and message_size_limit are read from a user database table -
which users can edit - to an extent. My default message_size_limit is
10M (10MB). Some users bitch at me for loosing their e-mail - they have
been sent an e-mail bigger than 10Mb and its not delivered. Is there a
friendly way to automatically generate a message to the end user in a
similar fashion to the quota warning messages - something like.....

message_size_exceeded = "\
    To: $local_part@$domain\n\
    Subject: Oversized message delivery failed\n\n\
    This message is automatically created by the mail delivery system.\n\n\
    The user $original_sender tried to send you a $real_size message
with a Subject of $subject but your personal message limit size is set
to $message_size_limitMB\n
    Perhaps you should consider changing the Maximum E-Mail Message Size
via the web portal at http://somesystem.com\n\n
    Regards, The Postmaster\n"

where variables something like $original_sender $real_size message,
$subject, $max_mess (I just made them up) are also magically expanded
correctly...

Possible?

-- 
Mark James ELKINS  -  Posix Systems - (South) Africa
mje@???       Tel: +27.128070590  Cell: +27.826010496
For fast, reliable, low cost Internet in ZA: https://ftth.posix.co.za