<acct-file>set by the Hub
The line sets how many days the engine keeps a closed accounting file before deleting it. The default is 8d, and there is a never value.
🔴 It applies only while move-to is off. As soon as files start moving to another directory, the retention period does not apply to them at all — you have to look after the archive yourself.
This is the only automatic cleanup of accounting. Nothing else deletes the files; the node’s free space threshold concerns the spool and messages, not the accounting directory.
The period is set in days. This line has no smaller unit: an hour or a minute cannot be written here.
Seven days work for us precisely because we do not set move-to. A week is a sensible period: the main stream goes out via webhook and sits in our database, while the file is read by the “Accounting stats” module and is also needed to reconcile or recover a gap over the recent period.
The period is matched to why the file is needed at all:
| Value | When |
|---|---|
| 7d–8d | the file is a backup, the main accounting goes elsewhere |
| 30d and more | the file is the only source of statistics |
| never | the files are picked up and deleted by an external collector |
With moving enabled the line does not apply — with any value.
# a week for the backup file: the main accounting goes out via webhook <acct-file /var/log/pmta/acct.csv> max-size 25M delete-after 7d</acct-file>
what people get wrong and how it ends2 mistakes▶
§ 3.3.11.1
our experience
2 relations
ls -la --time-style=long-iso /var/log/pmta/acct*.csv | head -3
3 articles
◇What the node tells about itself and through which channelsSeven observation surfaces: the web monitor, the console in four formats, the log, accounting, accounting search, metrics and export to external analytics.◇Two inbound report processors and what to do with themBounces by message and complaints are parsed by two identically structured blocks; each has its own address list and its own pair of decisions about the message’s fate.◇Five ways for a queue to hand off a messageA queue does not have to use SMTP: it can write to a file, run a program, call over HTTP or discard.