Results 1 to 6 of 6

Thread: dovecot, squirrelmail and permissions, opensuse 11.1

  1. #1

    Default dovecot, squirrelmail and permissions, opensuse 11.1

    Hi there!

    I am trying to get squirrelmail configured with dovecot so that my small organization can use this mail service.

    I am going with a basic install just to get things working, and then secure from there, and i THINK i am almost there.

    So, i try to login to the squirrelmail interface with the one and only user setup on the server, and i get this error:
    Code:
    Error opening ../data/default_pref
    Could not create initial preference file!
    /srv/www/MAIL/squirrelmail/data/ should be writable by user httpd
    Please contact your system administrator and report this error.
    I was going through the docs on squirrelmails website for this error, and the solution there was to make sure that apaches user owns the directory and has proper privileges.

    so, i made here and here is the ouput of ls -l:

    Code:
    drwxr-xr-x  3 kris   users 4096 Nov 15 19:01 contrib
    drwxrwxr-x  2 wwwrun www   4096 Nov 26 17:45 data
    drwxr-xr-x  3 kris   users 4096 Nov 15 19:01 doc
    and the same goes for the files within the directory. It seems that apaches default user and group is www/wwwrun which is fine, but the rest of the entire site that i am serving out is running on my local user (who doesnt have root privileges).

    I dont claim to be an expert on these things, but wouldnt it make sense if my whole site were owned by the apache user? It worked since the start with my default user so i left it the way it was (dont fix it if its not broken?). Anyways... so my next thought is maybe the apache user should own all the files in the websites directory, but i am scared to just do that incase the site goes down (client wouldnt be happy). This is just speculation as to why that isnt working, and if that isnt the problem, then ive got no clue what is.

    Incase it is relevant, i am using postfix and dovecot.

    Thanks for any advice!

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: dovecot, squirrelmail and permissions, opensuse 11.1

    No, the safest course is to have only those files and directories that have to be writable by apache owned by apache. It's best for the rest of the files and directories to be owned by another account. Reason is if there is website defacement bug, this reduces the number of files at risk.

    BTW, I don't know how you installed squirrelmail, but if youhad installed from source, then you may not be aware that if you had searched at software.opensuse.org you would have found a contrib RPM package where the permissions and stuff will be set up correctly after installation.

  3. #3

    Default Re: dovecot, squirrelmail and permissions, opensuse 11.1

    Hey thanks for the reply!

    Re-installing it as you suggested got it working - thanks.

    Anyways, ive got a couple more questions if you dont mind:

    Currently im using Postfix to sendmail - this is working fine. I have installed Dovecot to do the mail mapping to user account, and this is where im having some issues.

    firstly, i dont even know if this is a good setup, do i even need to run both of these programs? From what ive read, i need a program like postfix to send, and another imap program to handle recieving mail - which lead me to dovecot.

    I am having problems recieving mail. Like i said, i can send mail fine (which makes me think my mx record is correct) but if i reply to that email, the email sends without errors but the mail account doesnt recieve it. As a result ive combed over the files in /var/log/mail* to see if i can see any mails getting bounced or rejected, but i cant find anything like that. I THINK the server is recieving the mail, but it doesnt know where to send it (or how to handle it?). So, after reading the dovecot wiki about relaying mail, the two main ways are mbox and maildir. Ive tried with both, but it doesnt seem to work. Currently how i have it setup is:

    Code:
    mail_location = maildir:~/Maildir
    which my understanding of reading the wiki means that the mail should get mapped to ~/Maildir. And actually a Maildir directory in the users home directory is there, but i cant tell if the email is actually getting this far.

    Any suggestions?

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: dovecot, squirrelmail and permissions, opensuse 11.1

    You need postfix to send mail, and also to receive mail into the user's mbox or maildir.

    You need dovecot to serve this mbox or maildir to the mail reading program over POP or IMAP.

    Postfix, by default, delivers to a mbox in /var/spool/mail/<user>. To change this to Maildir type delivery, the controlling directive is home_mailbox, as in:

    home_mailbox = Maildir/

    See Postfix manual - local(8)

    (Note that the trailing slash is needed.) Then you have to tell dovecot to look there with the mail_location directive, if it isn't autodetected.

    You can check that the mail is going to /var/spool/mail/<user> or /home/<user>/Maildir by looking for new or updated files there. In the case of mbox, it is appended to /var/spool/mail/<user>. In the case of Maildir, the message (one per file) is delivered to Maildir/new and after reading, is moved to Maildir/cur.

  5. #5

    Default Re: dovecot, squirrelmail and permissions, opensuse 11.1

    Yea, that is how i had it setup (made sure suseconfig didnt overwrite home_mailbox at the bottom of main.cf).

    After reading the dovecot documentation, i setup mail_location as follows:

    Code:
    mail_location = maildir:~/Maildir:INBOX=~/Maildir/.INBOX
    which i think is right for this setup. Infact in the 2 users i have setup, there are maildir directories in their home directorys that i didnt create (SOMETHING must be working right!!).

    Since there are no error messages, does it have something to do with my users? I looked into this, and i found a lot of things referencing /etc/aliases. I could find no record of any of my users there, so i tried a couple different things there (not at the same time):

    kris: kris@domain.com
    kris@domain.com: kris

    and a lot of other variations. After each one added, i ran the newaliases command (some gave warnings, so i assumed they wouldnt work).

    So, how exactly does postfix know where to send incoming mail to, as in, which home directorys maildir to drop the mail off at (i am assuming aliases)?

    Is there a way i can tell if the mail is even making it to my server?

    I am pretty new at this, and im trying my best to get through the documentation. Thanks for any tips and advice...

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: dovecot, squirrelmail and permissions, opensuse 11.1

    Postfix will look at the user in the address, user@domain and if it is accepting mail for domain, and user is a valid user on the system, will deliver to the user's mbox or Maildir, depending. (We won't go into complications with virtual domains and virtual users, sometimes known as ISP type mail setups, here.)

    If mail has arrived for the user, there will be log lines in /var/log/mail, which among other things will tell you the disposition of the mail. If there is no record there, then postfix hasn't received the mail. Postfix needs to listen on port 25 on the public interface to receive mail from the Internet. If you have a firewall in between (e.g. a NATing router), you need a port forward also.

    Remember that the mail server host must be advertised as the MX for domain, or else forwarded the mail for the domain (used in large sites where mail fans out to multiple servers).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •