Page MenuHomePhorge

No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
diff --git a/docs/docs/administration/postfix.md b/docs/docs/administration/postfix.md
index 0916dc4..e683812 100644
--- a/docs/docs/administration/postfix.md
+++ b/docs/docs/administration/postfix.md
@@ -1,90 +1,98 @@
# Postfix
Postfix has the following relevant queues:
* Active: Email that is going to be delivered
* Deferred: Email that failed to be delivered, but is being retried until delivery succeeds.
* Hold: Email that was place on hold is not automatically retried.
## Inspecting mail queues
The following will generate an overview of mails in the queues, grouped by sender:
```
kolabctl postfix mailq-count-senders
```
-This can take a significant time (15min with > 50k messages).
+!!! note
+ This can take significant time (15min with > 50k messages).
+ For quicker results look at the "Print queued emails" section below, which will stream results immediately.
To get a quick count:
```
kolabctl postfix find /var/spool/postfix/deferred/ -type f -print | wc -l
```
## Putting mails on hold by sender address
The following will move mails from a specific sender, that are currently in the active or deferred queue, to the hold queue.
```
kolabctl postfix mailq-put-on-hold $sender
```
To delete emails that are currently in the hold queue, by sender:
```
kolabctl postfix mailq-purge-hold-queue --from $sender --now
```
## Print queued emails
Print all queued emails, from all queues.
```
kolabctl postfix postqueue -p
```
+Print queued mail from the active queue.
+
+```
+kolabctl postfix postqueue -j | jq -r 'select(.queue_name == "active") | "\(.queue_id) \(.sender) -> \(.recipients[])"'
+```
+
## Delete emails from all queues by sender
To delete emails that are currently in any queue, by sender:
```
kolabctl postfix bash -c "postqueue -p | grep $sender | grep -oE '^[0-9A-F]*' | postsuper -d -"
```
## Delete emails from hold queue by age
To delete emails that are currently in the hold queue (older than 50 days in this example):
```
kolabctl postfix bash -c "find /var/spool/postfix/hold -type f -mtime +50 -printf '%f\n' | sed 's/[*!]\$//' | postsuper -d -"
```
## Delete all emails in a queue
To delete all emails that are currently in a queue:
```
postsuper -d ALL hold
```
## Release emails from the hold queue
To release all emails in the hold queue:
```
kolabctl postfix postsuper -H ALL
```
## Print a message by id
```
kolabctl postfix postcat -q $messageid
```
!!! note
Exclude the the queue indicator from the message id, so strip the '!' from a message in the hold queue.
## Process the mailqueue immediately
```
kolabctl postfix postqueue -f
```

File Metadata

Mime Type
text/x-diff
Expires
Sat, Apr 4, 7:19 AM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18792063
Default Alt Text
(2 KB)

Event Timeline