Fix Mail Permission Denied Errors on Linux
When Sendmail fails with a "Permission denied" error on /var/spool/mqueue-client/, the queue directory has incorrect ownership or permissions. This guide shows how to diagnose and fix the issue.
Prerequisites
- Root or sudo access on the Linux server
- Sendmail installed
Steps
Check the current permissions on the mail spool directory:
ls -l /var/spool/
The mqueue-client directory must be owned by root:smmsp. Fix the ownership:
chown -R root:smmsp /var/spool/mqueue-client/
If the permissions are still incorrect, set them to 770:
chmod 770 /var/spool/mqueue-client
Verify
Confirm the corrected ownership and permissions:
ls -l /var/spool/
Expected output for mqueue-client:
drwxrws--- 2 root smmsp 4096 ... mqueue-client
Then test sending mail:
sendmail -v user@example.com < /dev/null
Notes
- The
smmspgroup is the Sendmail message submission program group. It must exist on the system. - If the group does not exist, create it:
groupadd smmsp - The sticky bit (
s) on the group permissions is normal for this directory.