Permissions 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 in the user´s directory permissions to root (/maildir/user root:root), 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 in user´s directory permissions to another user, for example mail (/maildir/user mail:mail), I can send mails but can´t login into Roundcube Webmail.
Please excuse me if this is not the correct place for asking for help with this issue.
But I ´ve been looking for a solution for some days but can´t find it.
Any help will be welcome.
Thanks for your attention Sirs.
Best regards,
Javier
Comments
-
I have moved the post to the System Management category to help better index the question.
Have you attempted to review the username being used by reviewing the output of lsof when the the operation is being requested? This can help you to identify the username being used so you can adequately set the permissions.0 -
Thank you very much for your help mfillpot.
I´ll be testing what I can find with lsof and post what I find.
Thanks again.
Best regards0 -
This is what I find with lsof:
lsof -i :143
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
couriertc 2849 root 3u IPv4 7630 TCP mail.server:imap2 (LISTEN)
couriertc 2849 root 5u IPv4 7631 TCP localhost:imap2 (LISTEN)
Seems that root is the username being used.
I´ve changed the courier directory UID and GID to mail:mail but when I do lsof -i :143 still root as the username in used.
Still can´t find a solution to this issue.
Thanks again for you attention.0 -
You are looking at the network traffic rather than the files, you will want to use grep on the output to find the files in the mail directories, once you see the that those are accessed you will be able to locate the application and username used.0
-
Thanks again mfillpot for taking time to answer me.
Could you please give me an example of how would you combine the lsof with the grep command so as to be able to find those files in the mail directory?
Thank you very much Sir.0 -
I will gladly give you that infromation. You can pipe the output of any file through grep to limit the output to only the lines that contain your chosen text.
So in my example I want to see all applications that are using the file /usr/lib/libXrender.so.1.3.0matt:~$lsof|grep "/usr/lib/libXrender.so.1.3.0" dzen2 2519 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0 chrome 2692 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0 chrome 2700 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0 chrome 2901 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0 chrome 2913 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0 GoogleTal 2916 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0 konsole 3207 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0 blender 3666 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0 kdeinit4 3908 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0 klauncher 3910 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0 kded4 3913 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0 knotify4 3924 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0
This is listing the applications in the first column, the username in use in the third column and the file being used in the last column. If you want to learn more about the uses of lsof or grep you can consult their man pages by typing man followed by the application name.
0 -
Again, thank you for your kind attention Sir.
I run these commands but couldn´t obtain the user with permission over this files.
I run:
lsof | grep "/maildir/domain.com/user/.Sent/cur/mail_id"
lsof "/maildir/domain.com/user/.Sent/cur/mail_id" (THIS LINE WITHOUT THE GREP FILTER)
lsof | grep /maildir/domain.com/user/.Sent/cur/mail_id (THIS LINE WIYHOUT QUOTES)
lsof /maildir/domain.com/user/.Sent/cur/mail_id (THIS LINE WITHOUT THE GREP FILTER AND WITHOU QUOTES)
But dont´t tell me anything about the user who is owning this file, although I´m logged as root in the system.
Thanks for your patience and your help Sir.
0
Categories
- All Categories
- 177 LFX Mentorship
- 177 LFX Mentorship: Linux Kernel
- 750 Linux Foundation IT Professional Programs
- 373 Cloud Engineer IT Professional Program
- 169 Advanced Cloud Engineer IT Professional Program
- 74 DevOps IT Professional Program - Discontinued
- 4 DevOps & GitOps IT Professional Program
- 99 Cloud Native Developer IT Professional Program
- 7.6K Training Courses & Learning Paths
- 1 AI & ML Training
- 1 Blockchain & Decentralized Identity Training
- 3 Cloud & Containers Training
- 1 Cybersecurity Training
- 2 DevOps & Site-Reliability Training
- 1 Linux Kernel Development Training
- 1 Networking Training
- 1 Open Source Best Practice Training
- 1 System Administration Training
- 1 System Engineering Training
- 1 Web & Application Development Training
- 792 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 95 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 87 Storage
- 769 Linux Distributions
- 81 Debian
- 68 Fedora
- 22 Linux Mint
- 13 Mageia
- 24 openSUSE
- 150 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 465 Linux System Administration
- 31 Cloud Computing
- 73 Command Line/Scripting
- Github systems admin projects
- 98 Linux Security
- 78 Network Management
- 101 System Management
- 46 Web Management
- 106 Mobile Computing
- 18 Android
- 73 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 392 Off Topic
- 121 Introductions
- 181 Small Talk
- 29 Study Material
- 955 Programming and Development
- 310 Kernel Development
- 627 Software Development
- 983 Software
- 375 Applications
- 182 Command Line
- 5 Compiling/Installing
- 68 Games
- 317 Installation
- Archived
- 2 LFD140 Class Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)