Repairing postfix - unable to create /root/mailbox.lock

Clash Royale CLAN TAG#URR8PPP
Because of recent policy changes at our office's ISP (no more SSL or TLS 1.0, only TLS 1.1+), I've had to ditch ssmtp as our mail relay on a Debian 9 workstation. I reinstalled postfix, which automatically removed ssmtp. Great. But there were some problems with installation, probably due to apparmor: postfix just would not configure, and no amount of apt-get clean, apt-get install -f, or dpkg -a --configure would solve that. I disabled apparmor, reinstalled ssmtp, purged postfix, fixed dependencies, and then reinstalled postfix. Now postfix automatically went through its post-install configuration no problem. Great.
The problem now is that postfix is unable to create a lock file for messages from root. Here's the error message it produces in mail.warn when I try to send a test message as root:
Feb 25 10:30:56 Mephistopheles postfix/local[9195]: warning: unable to create lock file /root/mailbox.lock: Permission denied
I'm pretty sure on my other Debian workstations the default spool directory was /var/mail. So, first question, is the spool directory the problem, or the mailbox directory? And is it a question of group postfix having permissions on a directory? I don't want to give postfix RW permissions on /root.
I tried setting postconf mail_spool_directory=/var/mail/ and postconf home_mailbox= (null), then running postfix reload. So far no dice.
Here's my /etc/postfix/main.cf:
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:$data_directory/smtpd_scache
smtp_tls_session_cache_database = btree:$data_directory/smtp_scache
#restricting use to TLS 1.1+
smtpd_tls_mandatory_protocols = !SSLv2,!SSLv3,!TLSv11
smtp_tls_mandatory_protocols = !SSLv2,!SSLv3,!TLSv1
smtpd_tls_protocols = !SSLv2,!SSLv3,!TLSv1
smtp_tls_protocols = !SSLv2,!SSLv3,!TLSv1
smtpd_tls_exclude_ciphers = RC4, aNULL, LOW, EXP, MEDIUM, ADH, AECDH, MD5, DSS ECDSA, CAMELLIA128,
3DES, CAMELLIA256, RSA+AES, eNULL
smtpd_tls_security_level = encrypt
smtp_tls_security_level = encrypt
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated
defer_unauth_destination
myhostname = Mephistopheles.[our domain].com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, [our domain].com,
Mephistopheles, localhost.localdomain, localhost
relayhost = [our ISP name]:25 mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
mail_spool_directory = /var/mail/
home_mailbox =
On previous instances of postfix (on other machines) installation has been totally seamless. Not sure what about the ssmtp/postfix swap gummed this up, although apparmor clearly played a role.
debian postfix
add a comment |
Because of recent policy changes at our office's ISP (no more SSL or TLS 1.0, only TLS 1.1+), I've had to ditch ssmtp as our mail relay on a Debian 9 workstation. I reinstalled postfix, which automatically removed ssmtp. Great. But there were some problems with installation, probably due to apparmor: postfix just would not configure, and no amount of apt-get clean, apt-get install -f, or dpkg -a --configure would solve that. I disabled apparmor, reinstalled ssmtp, purged postfix, fixed dependencies, and then reinstalled postfix. Now postfix automatically went through its post-install configuration no problem. Great.
The problem now is that postfix is unable to create a lock file for messages from root. Here's the error message it produces in mail.warn when I try to send a test message as root:
Feb 25 10:30:56 Mephistopheles postfix/local[9195]: warning: unable to create lock file /root/mailbox.lock: Permission denied
I'm pretty sure on my other Debian workstations the default spool directory was /var/mail. So, first question, is the spool directory the problem, or the mailbox directory? And is it a question of group postfix having permissions on a directory? I don't want to give postfix RW permissions on /root.
I tried setting postconf mail_spool_directory=/var/mail/ and postconf home_mailbox= (null), then running postfix reload. So far no dice.
Here's my /etc/postfix/main.cf:
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:$data_directory/smtpd_scache
smtp_tls_session_cache_database = btree:$data_directory/smtp_scache
#restricting use to TLS 1.1+
smtpd_tls_mandatory_protocols = !SSLv2,!SSLv3,!TLSv11
smtp_tls_mandatory_protocols = !SSLv2,!SSLv3,!TLSv1
smtpd_tls_protocols = !SSLv2,!SSLv3,!TLSv1
smtp_tls_protocols = !SSLv2,!SSLv3,!TLSv1
smtpd_tls_exclude_ciphers = RC4, aNULL, LOW, EXP, MEDIUM, ADH, AECDH, MD5, DSS ECDSA, CAMELLIA128,
3DES, CAMELLIA256, RSA+AES, eNULL
smtpd_tls_security_level = encrypt
smtp_tls_security_level = encrypt
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated
defer_unauth_destination
myhostname = Mephistopheles.[our domain].com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, [our domain].com,
Mephistopheles, localhost.localdomain, localhost
relayhost = [our ISP name]:25 mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
mail_spool_directory = /var/mail/
home_mailbox =
On previous instances of postfix (on other machines) installation has been totally seamless. Not sure what about the ssmtp/postfix swap gummed this up, although apparmor clearly played a role.
debian postfix
1
This error looks like it is being generated by messages to root rather than from root. From memory,postfix/localis used for message delivery to it's recipient.
– Philip Couling
Feb 25 at 16:56
It is of course possible that mail from rooot is failing and then the bounce email (back to root) is generating the error you've posted.
– Philip Couling
Feb 25 at 17:02
add a comment |
Because of recent policy changes at our office's ISP (no more SSL or TLS 1.0, only TLS 1.1+), I've had to ditch ssmtp as our mail relay on a Debian 9 workstation. I reinstalled postfix, which automatically removed ssmtp. Great. But there were some problems with installation, probably due to apparmor: postfix just would not configure, and no amount of apt-get clean, apt-get install -f, or dpkg -a --configure would solve that. I disabled apparmor, reinstalled ssmtp, purged postfix, fixed dependencies, and then reinstalled postfix. Now postfix automatically went through its post-install configuration no problem. Great.
The problem now is that postfix is unable to create a lock file for messages from root. Here's the error message it produces in mail.warn when I try to send a test message as root:
Feb 25 10:30:56 Mephistopheles postfix/local[9195]: warning: unable to create lock file /root/mailbox.lock: Permission denied
I'm pretty sure on my other Debian workstations the default spool directory was /var/mail. So, first question, is the spool directory the problem, or the mailbox directory? And is it a question of group postfix having permissions on a directory? I don't want to give postfix RW permissions on /root.
I tried setting postconf mail_spool_directory=/var/mail/ and postconf home_mailbox= (null), then running postfix reload. So far no dice.
Here's my /etc/postfix/main.cf:
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:$data_directory/smtpd_scache
smtp_tls_session_cache_database = btree:$data_directory/smtp_scache
#restricting use to TLS 1.1+
smtpd_tls_mandatory_protocols = !SSLv2,!SSLv3,!TLSv11
smtp_tls_mandatory_protocols = !SSLv2,!SSLv3,!TLSv1
smtpd_tls_protocols = !SSLv2,!SSLv3,!TLSv1
smtp_tls_protocols = !SSLv2,!SSLv3,!TLSv1
smtpd_tls_exclude_ciphers = RC4, aNULL, LOW, EXP, MEDIUM, ADH, AECDH, MD5, DSS ECDSA, CAMELLIA128,
3DES, CAMELLIA256, RSA+AES, eNULL
smtpd_tls_security_level = encrypt
smtp_tls_security_level = encrypt
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated
defer_unauth_destination
myhostname = Mephistopheles.[our domain].com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, [our domain].com,
Mephistopheles, localhost.localdomain, localhost
relayhost = [our ISP name]:25 mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
mail_spool_directory = /var/mail/
home_mailbox =
On previous instances of postfix (on other machines) installation has been totally seamless. Not sure what about the ssmtp/postfix swap gummed this up, although apparmor clearly played a role.
debian postfix
Because of recent policy changes at our office's ISP (no more SSL or TLS 1.0, only TLS 1.1+), I've had to ditch ssmtp as our mail relay on a Debian 9 workstation. I reinstalled postfix, which automatically removed ssmtp. Great. But there were some problems with installation, probably due to apparmor: postfix just would not configure, and no amount of apt-get clean, apt-get install -f, or dpkg -a --configure would solve that. I disabled apparmor, reinstalled ssmtp, purged postfix, fixed dependencies, and then reinstalled postfix. Now postfix automatically went through its post-install configuration no problem. Great.
The problem now is that postfix is unable to create a lock file for messages from root. Here's the error message it produces in mail.warn when I try to send a test message as root:
Feb 25 10:30:56 Mephistopheles postfix/local[9195]: warning: unable to create lock file /root/mailbox.lock: Permission denied
I'm pretty sure on my other Debian workstations the default spool directory was /var/mail. So, first question, is the spool directory the problem, or the mailbox directory? And is it a question of group postfix having permissions on a directory? I don't want to give postfix RW permissions on /root.
I tried setting postconf mail_spool_directory=/var/mail/ and postconf home_mailbox= (null), then running postfix reload. So far no dice.
Here's my /etc/postfix/main.cf:
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:$data_directory/smtpd_scache
smtp_tls_session_cache_database = btree:$data_directory/smtp_scache
#restricting use to TLS 1.1+
smtpd_tls_mandatory_protocols = !SSLv2,!SSLv3,!TLSv11
smtp_tls_mandatory_protocols = !SSLv2,!SSLv3,!TLSv1
smtpd_tls_protocols = !SSLv2,!SSLv3,!TLSv1
smtp_tls_protocols = !SSLv2,!SSLv3,!TLSv1
smtpd_tls_exclude_ciphers = RC4, aNULL, LOW, EXP, MEDIUM, ADH, AECDH, MD5, DSS ECDSA, CAMELLIA128,
3DES, CAMELLIA256, RSA+AES, eNULL
smtpd_tls_security_level = encrypt
smtp_tls_security_level = encrypt
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated
defer_unauth_destination
myhostname = Mephistopheles.[our domain].com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, [our domain].com,
Mephistopheles, localhost.localdomain, localhost
relayhost = [our ISP name]:25 mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
mail_spool_directory = /var/mail/
home_mailbox =
On previous instances of postfix (on other machines) installation has been totally seamless. Not sure what about the ssmtp/postfix swap gummed this up, although apparmor clearly played a role.
debian postfix
debian postfix
edited Feb 25 at 21:50
Mephisto
asked Feb 25 at 16:32
MephistoMephisto
32
32
1
This error looks like it is being generated by messages to root rather than from root. From memory,postfix/localis used for message delivery to it's recipient.
– Philip Couling
Feb 25 at 16:56
It is of course possible that mail from rooot is failing and then the bounce email (back to root) is generating the error you've posted.
– Philip Couling
Feb 25 at 17:02
add a comment |
1
This error looks like it is being generated by messages to root rather than from root. From memory,postfix/localis used for message delivery to it's recipient.
– Philip Couling
Feb 25 at 16:56
It is of course possible that mail from rooot is failing and then the bounce email (back to root) is generating the error you've posted.
– Philip Couling
Feb 25 at 17:02
1
1
This error looks like it is being generated by messages to root rather than from root. From memory,
postfix/local is used for message delivery to it's recipient.– Philip Couling
Feb 25 at 16:56
This error looks like it is being generated by messages to root rather than from root. From memory,
postfix/local is used for message delivery to it's recipient.– Philip Couling
Feb 25 at 16:56
It is of course possible that mail from rooot is failing and then the bounce email (back to root) is generating the error you've posted.
– Philip Couling
Feb 25 at 17:02
It is of course possible that mail from rooot is failing and then the bounce email (back to root) is generating the error you've posted.
– Philip Couling
Feb 25 at 17:02
add a comment |
1 Answer
1
active
oldest
votes
Have you redirected email addressed to root to your non privileged OS account?
http://www.postfix.org/BASIC_CONFIGURATION_README.html#notify
/etc/aliases:
postmaster: you
root: you
Yes, my /etc/aliases includes "postmaster: [my email address]" and "root: [my email address]"
– Mephisto
Feb 25 at 21:06
Seems like you were right. My email address was specified in /etc/aliases, but it also included "/root/mailbox" for root mail. (Not sure how that got there, since this is a pretty fresh system, and I wouldn't have put it there.) Anyway, I removed the /root/mailbox, reloaded/restarted postfix....and got a different error. So mailbox lock is resolved.
– Mephisto
Feb 25 at 21:59
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502936%2frepairing-postfix-unable-to-create-root-mailbox-lock%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Have you redirected email addressed to root to your non privileged OS account?
http://www.postfix.org/BASIC_CONFIGURATION_README.html#notify
/etc/aliases:
postmaster: you
root: you
Yes, my /etc/aliases includes "postmaster: [my email address]" and "root: [my email address]"
– Mephisto
Feb 25 at 21:06
Seems like you were right. My email address was specified in /etc/aliases, but it also included "/root/mailbox" for root mail. (Not sure how that got there, since this is a pretty fresh system, and I wouldn't have put it there.) Anyway, I removed the /root/mailbox, reloaded/restarted postfix....and got a different error. So mailbox lock is resolved.
– Mephisto
Feb 25 at 21:59
add a comment |
Have you redirected email addressed to root to your non privileged OS account?
http://www.postfix.org/BASIC_CONFIGURATION_README.html#notify
/etc/aliases:
postmaster: you
root: you
Yes, my /etc/aliases includes "postmaster: [my email address]" and "root: [my email address]"
– Mephisto
Feb 25 at 21:06
Seems like you were right. My email address was specified in /etc/aliases, but it also included "/root/mailbox" for root mail. (Not sure how that got there, since this is a pretty fresh system, and I wouldn't have put it there.) Anyway, I removed the /root/mailbox, reloaded/restarted postfix....and got a different error. So mailbox lock is resolved.
– Mephisto
Feb 25 at 21:59
add a comment |
Have you redirected email addressed to root to your non privileged OS account?
http://www.postfix.org/BASIC_CONFIGURATION_README.html#notify
/etc/aliases:
postmaster: you
root: you
Have you redirected email addressed to root to your non privileged OS account?
http://www.postfix.org/BASIC_CONFIGURATION_README.html#notify
/etc/aliases:
postmaster: you
root: you
answered Feb 25 at 20:35
AnFiAnFi
1,119510
1,119510
Yes, my /etc/aliases includes "postmaster: [my email address]" and "root: [my email address]"
– Mephisto
Feb 25 at 21:06
Seems like you were right. My email address was specified in /etc/aliases, but it also included "/root/mailbox" for root mail. (Not sure how that got there, since this is a pretty fresh system, and I wouldn't have put it there.) Anyway, I removed the /root/mailbox, reloaded/restarted postfix....and got a different error. So mailbox lock is resolved.
– Mephisto
Feb 25 at 21:59
add a comment |
Yes, my /etc/aliases includes "postmaster: [my email address]" and "root: [my email address]"
– Mephisto
Feb 25 at 21:06
Seems like you were right. My email address was specified in /etc/aliases, but it also included "/root/mailbox" for root mail. (Not sure how that got there, since this is a pretty fresh system, and I wouldn't have put it there.) Anyway, I removed the /root/mailbox, reloaded/restarted postfix....and got a different error. So mailbox lock is resolved.
– Mephisto
Feb 25 at 21:59
Yes, my /etc/aliases includes "postmaster: [my email address]" and "root: [my email address]"
– Mephisto
Feb 25 at 21:06
Yes, my /etc/aliases includes "postmaster: [my email address]" and "root: [my email address]"
– Mephisto
Feb 25 at 21:06
Seems like you were right. My email address was specified in /etc/aliases, but it also included "/root/mailbox" for root mail. (Not sure how that got there, since this is a pretty fresh system, and I wouldn't have put it there.) Anyway, I removed the /root/mailbox, reloaded/restarted postfix....and got a different error. So mailbox lock is resolved.
– Mephisto
Feb 25 at 21:59
Seems like you were right. My email address was specified in /etc/aliases, but it also included "/root/mailbox" for root mail. (Not sure how that got there, since this is a pretty fresh system, and I wouldn't have put it there.) Anyway, I removed the /root/mailbox, reloaded/restarted postfix....and got a different error. So mailbox lock is resolved.
– Mephisto
Feb 25 at 21:59
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502936%2frepairing-postfix-unable-to-create-root-mailbox-lock%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
This error looks like it is being generated by messages to root rather than from root. From memory,
postfix/localis used for message delivery to it's recipient.– Philip Couling
Feb 25 at 16:56
It is of course possible that mail from rooot is failing and then the bounce email (back to root) is generating the error you've posted.
– Philip Couling
Feb 25 at 17:02