LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-11-2009, 01:33 PM   #1
pastfix
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Rep: Reputation: 0
Postfix - Permission problems with the maildir emailbox


Hi all.

My /etc/postfix/main.cf contains:
mail_spool_directory = /var/spool/mail/
mail_owner = postfix

My /etc/group contains
mail::12:mail,postfix

And if I run ps aux | grep postfix , the output is:
postfix 9677 0.0 0.4 6876 1780 ? S 15:26 0:00 pickup -l -t fifo -u
root 15594 0.0 0.1 1832 496 pts/0 S+ 15:56 0:00 grep postfix
root 22208 0.0 0.4 6812 1772 ? Ss Aug07 0:00 /usr/libexec/postfix/master
postfix 22211 0.0 0.4 6936 1860 ? S Aug07 0:00 qmgr -l -t fifo -u

I try to send an email to andrea@example.com.
example.com is the domain of my mail server, andrea is a local user.

//////////////////////////////
Case 1: the email is delivered successfully

The permissions I set are:

drwxrwxrwx andrea.mail on /var/spool/mail/andrea
drwx------ andrea.andrea on /var/spool/mail/andrea/cur
drwx------ andrea.andrea on /var/spool/mail/andrea/new
drwxrwxrwx andrea.mail on /var/spool/mail/andrea/tmp

///////////////////////////////////////////////////////

Case 2: the email is NOT delivered successfully. The server's reply is:

Diagnostic-Code: X-Postfix; maildir delivery failed: create maildir file
/var/spool/mail/andrea/tmp/1249933864.P8041.server.example.com: Permission
denied


The permissions in this case are:

drw-rw---- andrea.mail on /var/spool/mail/andrea
drwx------ andrea.andrea on /var/spool/mail/andrea/cur
drwx------ andrea.andrea on /var/spool/mail/andrea/new
drwxrwxrwx andrea.mail on /var/spool/mail/andrea/tmp

///////////////////////////////////////////////////////

To recap, the only difference between the two cases is the permission on
/var/spool/mail/andrea (777 in the case 1, 660 in the case 2).
I don't want to use permission 777, I think is not necessary. I can't understand why 660 is not enough.
I mean, postfix run under the user 'postfix'. The user 'postfix' belongs to the group 'mail'.
Then the directory /var/spool/mail/andrea should be writable by postfix.
So why the case 2 doesn't work? I really can't understand that.

Can you please help me?

Thanks for you time,
Daniele
 
Old 08-12-2009, 09:54 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
I think it's the execute permissions that are important here, so 770 or even 700 should be sufficient. Note that mail_owner is irrelevant here, as the local delivery agent delivers using the andrea uid.
 
Old 08-16-2009, 10:03 PM   #3
brenton.williams
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Rep: Reputation: 0
execute permission is required to navigate to a directory, hence you need the permissions set so the local delivery agent has access to the directory as Berhanie has advised above (700) - else the delivery agent can't access the directories within the subtree and you get your error.

That is why 660 is not enough (usual disclaimer: I believe anyway).

For comparative purposes: the permissions on my postfix base maildir directory setup are 700 and this works fine.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix and Maildir h725 Linux - Server 3 07-18-2008 09:50 AM
Maildir problems... imapd cant see the maildir of user vargadanis Linux - Networking 2 04-20-2008 08:57 AM
Postfix and Maildir help dalrq79 Linux - Server 5 12-13-2007 08:22 PM
New to Postfix and Maildir kevlarmcc Linux - Server 5 03-17-2007 09:35 PM
postfix and maildir format forand Linux - Software 4 05-05-2003 12:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration