RE: dovecot disk space settings
Ok, what about placing a dummy file of 5GB or so on the partition, that you can remove when necessary?
-----Original Message----- Subject: Re: dovecot disk space settings
I don't want to restrict each mailbox size. It's just to prevent running out space completely.
Why? (If I may ask)
To provide mailboxes with unlimited space. And to make it easier to administrate. My question is about an emergency option if someone has forgotten to migrate to new hardware. It's possible but a bit harder if the partition is out of space and there is no free byte left.
Best,
Marcel
-----Original Message----- Subject: Re: dovecot disk space settings
I don't want to restrict each mailbox size. It's just to prevent running out space completely.
Why? (If I may ask)
To provide mailboxes with unlimited space. And to make it easier to administrate. My question is about an emergency option if someone has forgotten to migrate to new hardware. It's possible but a bit harder if the partition is out of space and there is no free byte left.
Best,
Marcel
On 22/10/2019 11:38, Marc Roos via dovecot wrote:
Ok, what about placing a dummy file of 5GB or so on the partition, that you can remove when necessary?
Or just monitor your disk space availability with a monitoring program (Nagios, CheckMK, whatever) and manage your disk space accordingly, you don't want to stop receiving email for your users, nor do you want to run out of disk space, and unless you have elastic storage in the cloud or something, you actually need to make decisions on managing available space (i.e. impose user limits, archive off old emails, buy new storage) and those decisions are not usually something that can be done automatically, unless you're using managed storage in the cloud.
-- Giles Coochey
On 22/10/2019 6:38 PM, Marc Roos via dovecot wrote:
Ok, what about placing a dummy file of 5GB or so on the partition, that you can remove when necessary?
I recently wrote a script to check disk space every week and email me an alert if there was less than 5G. Would that be an approach for you? Enclosing below as an example. You'd need to adapt to your own environment.
#!/bin/bash
MAILSPACE=$( df -h | grep "/dev/sdd" | awk '{ print $4 }' | sed 's/G//g' )
if [ "$MAILSPACE" -lt "5" ] ; then MESSAGE="Alert, only $MAILSPACE Gb of space left on Mail Drive" df -h > /tmp/diskalert.txt mutt -s "$MESSAGE" me@example.com < /tmp/diskalert.txt else # Uncomment to debug MESSAGE="Safe for now: $MAILSPACE Gb of space left on Mail Drive" #echo $MESSAGE fi
On Tue, 22 Oct 2019, Plutocrat wrote:
I recently wrote a script to check disk space every week and email me an alert if there was less than 5G.
Every week? Unless you're using a telephone modem, an out of control mail loop or being the victim of a joe-job can consume 5Gb of space in no time. I recommend a more frequent interval if you're in the single digit Gb's.
MAILSPACE=$( df -h | grep "/dev/sdd" | awk '{ print $4 }' | sed 's/G//g' ) if [ "$MAILSPACE" -lt "5" ] ; then
If free space dips below 1Gb, (e.g. 900M), this will either fail or do the opposite of what you want. Maybe
MAILSPACE=$( df -k | awk '/\/dev\/sdd/{print int($4/(1024*1024)}' )
Joseph Tam <jtam.home@gmail.com>
participants (4)
-
Giles Coochey
-
Joseph Tam
-
Marc Roos
-
Plutocrat