Skip to content

Commit 3f42ba1

Browse files
committed
system: gromox-cleaner.service and timer unit
References: GXH-111, GXH-117
1 parent 3c9e741 commit 3f42ba1

File tree

6 files changed

+61
-2
lines changed

6 files changed

+61
-2
lines changed

Makefile.am

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ phplib_LTLIBRARIES = mapi.la
3030
endif
3131
dist_sysusers_DATA = system/sysusers-gromox.conf
3232
dist_tmpfiles_DATA = system/tmpfiles-gromox.conf
33-
dist_unit_DATA = system/gromox-delivery.service \
33+
dist_unit_DATA = system/gromox-cleaner.service system/gromox-cleaner.timer \
34+
system/gromox-delivery.service \
3435
system/gromox-delivery-queue.service system/gromox-event.service \
3536
system/gromox-http.service system/gromox-imap.service \
3637
system/gromox-midb.service system/gromox-pop3.service \
@@ -312,7 +313,8 @@ dist_man_MANS = \
312313
doc/exchange_nsp.4gx doc/exchange_rfr.4gx \
313314
doc/exmdb_local.4gx doc/exmdb_provider.4gx \
314315
doc/gromox.7 doc/gromox.cfg.5 doc/gromox-abktconv.8 \
315-
doc/gromox-abktpull.8 doc/gromox-dbop.8 doc/gromox-dscli.8 \
316+
doc/gromox-abktpull.8 doc/gromox-cleaner.service.8 \
317+
doc/gromox-dbop.8 doc/gromox-dscli.8 \
316318
doc/gromox-e2ghelper.8 \
317319
doc/gromox-eml2mbox.8 doc/gromox-eml2mt.8 doc/gromox-exm2eml.8 \
318320
doc/gromox-exm2ical.8 doc/gromox-exm2mt.8 doc/gromox-exm2tnef.8 \

doc/gromox-cleaner.service.8

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.\" SPDX-License-Identifier: CC-BY-SA-4.0 or-later
2+
.\" SPDX-FileCopyrightText: 2020-2022 grommunio GmbH
3+
.TH gromox\-cleaner.service 8 "" "Gromox" "Gromox admin reference"
4+
.SH Name
5+
gromox\-cleaner.service, gromox\-cleaner.timer \(em Soft-deleted
6+
message/attachment removal
7+
.SH Description
8+
gromox\-cleaner.service is a systemd unit that invokes gromox\-mbop(8) to clear
9+
out soft-deleted messages from stores, as well as reclaim space by deleting
10+
orphaned on-disk attachment files which are no longer referenced by any
11+
message. Usually, the service is invoked periodically from
12+
gromox\-cleaner.timer.
13+
.SH Configuration
14+
/etc/gromox/gromox.cfg is read for the following directives:
15+
.TP
16+
\fBsoftpurge_purgetime\fP
17+
Controls the lifetime of soft-deleted messages. Messages which have the
18+
soft-delete flag (a.k.a. "hidden flag" in Exchange) and which have their
19+
PR_LAST_MODIFICATION_TIME older than this interval are hard-deleted.
20+
.br
21+
Default: \fI30days\fP
22+
.SH See also
23+
\fBgromox\fP(7), \fBgromox\-mbop\fP(8)

doc/gromox.7

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ delivery-queue(8gx) \(em LMTP/SMTP frontend for local delivery
8787
user_filter(4gx) \(em Service plugin for application of user login limits
8888
.SS Auxiliary services
8989
.IP \(bu 4
90+
gromox\-cleaner.service(8) \(em Soft-deleted message/attachment removal
91+
.IP \(bu 4
9092
pam_gromox(4gx) \(em a PAM plugin to authenticate with Gromox
9193
.IP \(bu 4
9294
event(8gx) \(em Folder change notification daemon

doc/gromox.cfg.5

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ service had separate configuration files, but the number of directives that
99
needed explicit configuration were reduced over time to the point that there
1010
were too many distinct files for little value, and so, gromox.cfg came to be.
1111
.SH Configuration directives
12+
.PP
13+
This manpage does not describe all possible directives. Please also consult the
14+
manpages of gromox daemons and command-line utilities for more.
1215
.TP
1316
\fBautoreply_silence_window\fP
1417
If an autoreply message (other than a bounce report, e.g. out-of-office) is to

system/gromox-cleaner.service

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[Unit]
2+
Description=Gromox mailbox cleaner
3+
Requisite=gromox-http.service
4+
After=gromox-http.service
5+
6+
[Service]
7+
# Fallback if EnvironmentFile hasn't got any value
8+
Environment=softdelete_purgetime=30d
9+
EnvironmentFile=/etc/gromox/gromox.cfg
10+
ExecStart=/usr/sbin/gromox-mbop foreach.here.mb ( purge-softdelete -d ${PURGETIME} -r / ) ( purge-datafiles )
11+
MemoryDenyWriteExecute=yes
12+
PrivateDevices=yes
13+
PrivateNetwork=yes
14+
PrivateUsers=no
15+
ProtectControlGroups=yes
16+
ProtectKernelModules=yes
17+
ProtectKernelTunables=yes
18+
SystemCallFilter=@default @file-system @basic-io @system-service
19+
Type=oneshot

system/gromox-cleaner.timer

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Unit]
2+
Description=Periodic purge of softdeleted items in Gromox mailboxes
3+
4+
[Timer]
5+
OnCalendar=daily
6+
Persistent=true
7+
WakeSystem=no
8+
9+
[Install]
10+
WantedBy=timers.target

0 commit comments

Comments
 (0)