Use a sendmail-compatible binary to print the mail queue.
Which command is equivalent to mailq?
sendmail -bp prints the queue and is the compatibility form of mailq.
Detailed explanation
sendmail -biIncorrect. -bi rebuilds the aliases database.
Incorrect. -bi rebuilds the aliases database.
sendmail -bpCorrect. -bp prints the mail queue.
Correct. -bp prints the mail queue.
sendmail -btIncorrect. -bt enters address-test mode.
Incorrect. -bt enters address-test mode.
sendmail -bdIncorrect. -bd runs daemon mode.
Incorrect. -bd runs daemon mode.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s\n' 'mailq == sendmail -bp'Expected result
mailq == sendmail -bpKey points
- -bp prints queue
- -bi rebuilds aliases
- Compatibility layer
Notes
- Environment: 互換option対応表の表示のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.