Ubuntu server - mail server (232 Views)
Occasional Visitor
Posts: 1
Registered: ‎12-08-2013
Message 1 of 3 (232 Views)

Ubuntu server - mail server

[ Edited ]

I got an error becauese  


this directory is not there i executed chmod 755 /var/spool/mqueue

but no result then I created back /var/spool/mqueue directory but still my problem is there

please answer my problem


P.S. This thread has been moevd from HP-UX > Messaging to Linux > sysadmin. - HP Forum Moderator

Honored Contributor
Posts: 6,271
Registered: ‎12-02-2001
Message 2 of 3 (190 Views)

Re: Ubuntu server - mail server

You cannot chmod something that does not exist. If you ran "chmod 755 /var/spool/mqueue" when /var/spool/mqueue was not there, you should have received an error message from the chmod command.


So you should *first* create the missing directory, *then* assign it the correct owner, group and permissions:

  • the chown command can assign either just the owner (chown <owner> <file_or_directory>), or both owner and group (chown <owner>:<group> <file_or_directory>)
  • alternatively, the chgrp command can be used to assign the group
  • and the chmod command is used to assign the permissions (historically called "file mode", hence chMOD).

I don't have an Ubuntu system at hand, so I cannot check the actual correct owner/group settings, but typically /var/spool/mqueue should have owner=root, group=mail.

In other words: either

mkdir /var/spool/mqueue
chown root /var/spool/mqueue
chgrp mail /var/spool/mqueue
chmod 755 /var/spool/mqueue


mkdir /var/spool/mqueue
chown root:mail /var/spool/mqueue
chmod 755 /var/spool/mqueue

 would be the correct sequence of commands.


NOTE: if you get an error message saying that /var/spool/mqueue has _unsafe_ permissions, it means the directory is accessible to _too many_ users/groups. In that case, you should think about taking away some permissions instead of adding more. Some installations of sendmail can require "chmod 700 /var/spool/mqueue".


Also, in POSIX-compliant filesystems (= most native Unix and Linux filesystems) having write access to a directory usually means that it is possible to delete, rename or move anything in that directory.  So if /var/spool (or even /var) is writeable by someone other than root, then /var/spool/mqueue may be "unsafe", no matter what permissions /var/spool/mqueue actually has.

Acclaimed Contributor
Posts: 25,874
Registered: ‎03-06-2006
Message 3 of 3 (182 Views)

Re: Ubuntu server - mail server

> then /var/spool/mqueue may be "unsafe",


Unsafe in that the directory path can be changed to "hide" it.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.