35 lines
1.8 KiB
Markdown
35 lines
1.8 KiB
Markdown
## Purpose
|
|
You may need to troubleshoot the outgoing SMTP email queue / active sessions in iRedMail for one reason or another. This can provide useful insight into the reason why emails are not being delivered, etc.
|
|
|
|
### Overall Queue Backlog
|
|
You can run the following command to get the complete backlog of all email senders in the queue. This can be useful for tracking the queue's "drainage" over-time.
|
|
|
|
```sh
|
|
# List the total number of queued messages
|
|
postqueue -p | egrep -c '^[A-F0-9]'
|
|
|
|
# Itemize and count the queued messages based on sender.
|
|
postqueue -p | awk '/^[A-F0-9]/ {id=$1} /from=<[^>]+>/ && $0 !~ /from=<>/ {print id; exit}'
|
|
```
|
|
|
|
!!! example "Example Output"
|
|
- 10392 problematic@bunny-lab.io
|
|
- 301 prettybad@bunny-lab.io
|
|
- 39 infrastructure@bunny-lab.io
|
|
- 20 nicole.rappe@bunny-lab.io
|
|
|
|
### Investigating Individual Emails
|
|
You can run the following command to list all queued messages: `postqueue -p`. You can then run `postcat -vq <message-ID>` to read detailed information on any specific queued SMTP message:
|
|
|
|
```sh
|
|
postqueue -p
|
|
postcat -vq 4dgHry5LZnzH6x08 # (1)
|
|
```
|
|
|
|
1. Example message ID gathered from the previous `postqueue -p` command.
|
|
|
|
### Attempt to Gracefully Reload Postfix
|
|
You may want to try to unstick things by gracefully "reloading" the postfix service via `postfix reload`. This will ensure that we don't drop / disconnect / lose all of the active outgoing SMTP sessions in the queue. It may not help resolve issues, but it's worth noting down:
|
|
|
|
### Reattempt Delivery
|
|
You can attempt redelivery via running `postqueue -f` to try to free up the queue. Postfix will immediately re-attempt delivery of all queued messages instead of waiting for their scheduled retry time. It does not override remote rejections or fix underlying delivery errors; it only accelerates the next delivery attempt. |