LinuxQuestions.org
Review your favorite Linux distribution.
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 11-05-2011, 03:41 PM   #1
xavinux
LQ Newbie
 
Registered: Nov 2011
Posts: 7

Rep: Reputation: Disabled
Permission Issue


Hi Dear Sirs:
I am having a little problem with permissions of a file, and canīt find a solution,
I have a mail Server with Postfix, Courier and Roundcube as Webmail.
When I give the userīs directory root permissions (chown root:root /maildir/domain.com/user), login is ok in Roundcube but canīt send mails, and logs show: "/maildir/domain.com/user/tmp/mail_id.server_name: Permission denied)"
If I give userīs directory another user permissions, for example user mail (chown mail:mail /maildir/domain.com/user, I can send mails but canīt login into Roundcube Webmail.
I've run this command: lsof /maildir/domain.com/user but couldnīt find the user with permission over this files.
Iīve been looking for a solution for some days but canīt find it.
Any help will be welcome.
Thanks for your kind attention Sirs.

Best regards.

Last edited by xavinux; 11-05-2011 at 03:45 PM.
 
Old 11-05-2011, 04:33 PM   #2
sswuste
LQ Newbie
 
Registered: Nov 2011
Posts: 11

Rep: Reputation: Disabled
I think roundcube does not need root privileges. Because roundcube is a webinterface. Can you please post the permissions (read/write/execute) of the mentioned user directory?

Because Roundcube will run as a low privileged user (daemon/nobody/etcetc) it should have write privileges to that user directory. As it is root, it will not work or you have a very insecure setup.
 
Old 11-05-2011, 06:55 PM   #3
xavinux
LQ Newbie
 
Registered: Nov 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thank you very much for you answer sswuste.
This are the permissions of the /maildir/doamin.com/
drwx------ 8 root root 4096 user
If I change permissions from root to another user, an ERROR CONNECTION WITH IMAP SERVER appears when I try to login to Roundcube Webmail.
Again, thanks for answering and any idea of how to solve this will be welcome.
 
Old 11-06-2011, 12:27 PM   #4
sswuste
LQ Newbie
 
Registered: Nov 2011
Posts: 11

Rep: Reputation: Disabled
I think you need to give the webserver (roundcube) permission to write taht directory (world writable). But you have to check the documentation for that.

There other error is an error relating to the connection between you roundcube software and you mailserver. Check your mailserver adres and username+password combination.
 
Old 11-06-2011, 07:04 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by xavinux View Post
logs show: "/maildir/domain.com/user/tmp/mail_id.server_name: Permission denied)"
As sswuste says Roundcube logs/ and temp/ directories need to be writable for the web server user and group (octal 0775).


Quote:
Originally Posted by sswuste View Post
(world writable).
Please do not ever again suggest something like that. Changing permissions has repercussions but blithely suggesting them to be world writable creates a whole different class of security problems.
 
Old 11-07-2011, 09:04 AM   #6
xavinux
LQ Newbie
 
Registered: Nov 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
Dear Sirs:
Thank you for your answers.

Here are the permissions 0775 that have been given to the roundcubeīs directory in the Web Server:

/webserver_directory/roundcube/

drwxrwxr-x 2 www-data www-data 4096 03:53 logs
drwxrwxr-x 2 www-data www-data 4096 14:21 temp

But still only let me login into Roundcube if I give root permissions to /maildir/domain.com/user directory:

ls -la /maildir/domain.com/

drwx------ 8 root root 4096 16:13 user



ls -la /maildir/domain.com/user/
total 48
drwx------ 8 root root 4096 16:13 .
drwxrwxrwx 13 mail mail 4096 00:01 ..
drwx------ 2 mail mail 4096 13:58 courierimapkeywords
-rw-r--r-- 1 root root 23 10:10 courierimapsubscribed
-rw-r--r-- 1 root root 1531 10:28 courierimapuiddb
-rw-r--r-- 1 root root 214 13:50 courierpop3dsizelist
drwx------ 2 mail mail 4096 10:30 cur
-rw-r--r-- 1 root root 36 11:29 maildirsize
drwx------ 2 mail mail 4096 10:28 new
drwx------ 6 mail mail 4096 10:10 .Sent
drwx------ 2 mail mail 4096 11:32 tmp
drwx------ 6 mail mail 4096 10:07 .Trash


and only let me send mails if I give mail user permissions to the /maildir/domain.com/user directory:

ls -la /maildir/domain.com/

drwx------ 8 mail mail 4096 16:13 user



ls -la /maildir/domain.com/user/
total 48
drwx------ 8 mail mail 4096 16:13 .
drwxrwxrwx 13 mail mail 4096 00:01 ..
drwx------ 2 mail mail 4096 13:58 courierimapkeywords
-rw-r--r-- 1 root root 23 10:10 courierimapsubscribed
-rw-r--r-- 1 root root 1531 10:28 courierimapuiddb
-rw-r--r-- 1 root root 214 13:50 courierpop3dsizelist
drwx------ 2 mail mail 4096 10:30 cur
-rw-r--r-- 1 root root 36 11:29 maildirsize
drwx------ 2 mail mail 4096 11:48 new
drwx------ 6 mail mail 4096 10:10 .Sent
drwx------ 2 mail mail 4096 11:48 tmp
drwx------ 6 mail mail 4096 10:07 .Trash

Help will be appreciated, as Iīve to give a solution to this problem as soon as possible...
Thanks again for your kind attention Sirs.
 
Old 11-07-2011, 09:09 AM   #7
sswuste
LQ Newbie
 
Registered: Nov 2011
Posts: 11

Rep: Reputation: Disabled
Can you please post the exact error message you get on your screen?
 
Old 11-07-2011, 10:07 AM   #8
xavinux
LQ Newbie
 
Registered: Nov 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thanks for your answer Sir.
This is the message I receive when I try to login when I give mail user permissions to the /maildir/domain.com/user directory.
I canīt login but I can send mails.
Thank you very much for your help.
Attached Thumbnails
Click image for larger version

Name:	Webmail.png
Views:	139
Size:	7.5 KB
ID:	8325  
 
Old 11-07-2011, 12:02 PM   #9
xavinux
LQ Newbie
 
Registered: Nov 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
And this is what Roundcubeīs logs said when I try to login giving mail user permissions on the /maildir/doamin.com/user directory:

[13:08:41 -0300]: IMAP Error: Login failed for user@domain.com from server_ip LOGIN: Fatal error: Account's mailbox directory
is not owned by the correct uid or gid: in /webserver_directory/roundcube/program/include/rcube_imap.php on line 192

Thank you again for your attention.

Last edited by xavinux; 11-07-2011 at 12:05 PM.
 
Old 11-07-2011, 11:12 PM   #10
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
I have not actually used Roundcube client but the error seems to be familiar

If I suppose it is same as Squirrelmail then you can try installing dovecot
Code:
#yum -y install dovecot
edit the config file

Code:
#vi /etc/dovecot.conf
(make following changes)
protocols = imap pop3

   protocol imap {
     listen = *:143
#     ssl_listen = *:10943
#     ..
   }
   protocol pop3 {
     listen = *:110
#     ..
   }
 
Old 11-08-2011, 06:17 AM   #11
xavinux
LQ Newbie
 
Registered: Nov 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
Dear Sirs Iīve finally solved this problem.
If it is useful for someone, here is what I do.
I leave permissions over the /maildir/doamin.com/user directory to the user mail, so as to be able to send mails.
But as I said, I canīt login into Roundcube Webmail, so I run:

telnet localhost imap
a login user@domain.com password
[ALERT] Fatal error: Account's mailbox directory is not owned by the correct uid or gid (This is what I receive when I try to login).

So I find in a post that Courier checks for the SANITY of the setup, so turning this option to "0" solved the problem.
I added this line in /etc/courier/imapd => IMAP_MAILBOX_SANITY_CHECK=0

So if I telnet localhost now I can login ok:

telnet localhost imap
a login user@domain.com password
a OK LOGIN Ok.

Now when trying to login into Roundcube Webmail, everything works ok, and can send mails ok too.
Thanks to everyone for your help.

Best regards.

Last edited by xavinux; 11-08-2011 at 06:19 AM.
 
  


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
permission's issue bibiki Linux - Desktop 1 05-06-2011 11:10 AM
Permission issue linson_85 Linux - General 3 10-24-2010 09:30 AM
Issue with permission? your_shadow03 Linux - Server 1 11-22-2009 06:57 AM
Permission issue??? ThunderStrick Linux - Newbie 4 07-06-2009 11:41 PM
issue with permission santasballz Linux - Newbie 7 02-28-2004 11:25 AM

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

All times are GMT -5. The time now is 08:34 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