View previous topic :: View next topic |
Author |
Message |
webbruno n00b
Joined: 01 May 2010 Posts: 24
|
Posted: Mon Oct 08, 2012 1:04 pm Post subject: Permission problem with Postfix and MySQL [SOLVED] |
|
|
Hi all,
I've followed the instructions of Virtual Mailhosting System with Postfix Guide to set up a postfix mail server. I can send e-mails to my local users (and to other users on the internet as well) but the received e-mails are getting a different permission and in order to view the files on Squirrel I must change the permissions from 0644 to 0664, which means the new mails always are written with the 0644 permission. I'm using this script to add a user to my mailserver:
Code: |
#! /bin/bash
USER=$1
useradd -s /sbin/nologin -G vmail,mail -m -b /var/mail/ ${USER}
maildirmake /var/mail/${USER}/.maildir/
chown ${USER}:${USER} -cR /var/mail/${USER}/
mysql --host=localhost --user=myverysecretuser --password=myverysecretpass mailsql << EOF
insert into users (email,clear,name, uid,gid,homedir,maildir) values("${USER}@zemarestaleiro.com.br","password","${USER}",1001,1001, "/var/mail/${USER}/","/var/mail/${USER}/.maildir/" );
EOF
passwd ${USER}
|
What am I missing or what am I doing wrong? Thanks in advance for all the help _________________ Running Gentoo with =sys-kernel/vanilla-sources-2.6.39 from i5 2500k @ 4.0ghz, 8gb ddr3 1866 corsair vengeance, ga-ud3-p67-b3, seagate barracuda 1TB 32mb cache, cooler master 460 and Geforce GTX 580
Last edited by webbruno on Fri Oct 12, 2012 1:38 pm; edited 1 time in total |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6639 Location: The soundosphere
|
|
Back to top |
|
|
cach0rr0 Bodhisattva
Joined: 13 Nov 2008 Posts: 4123 Location: Houston, Republic of Texas
|
Posted: Thu Oct 11, 2012 7:26 am Post subject: Re: Permission problem with Postfix and MySQL |
|
|
I second the aforementioned guide, but them I'm a touch biased (actually, I may need to do an updated ebuild for cyrus-2.4.16, but dont have time at the moment)
specific to this:
webbruno wrote: | in order to view the files on Squirrel I must change the permissions from 0644 to 0664, which means the new mails always are written with the 0644 permission. |
squirrelmail should be asking your IMAP server to read the mail file, and give it the contents
it should not be trying to read files from the filesystem directly, so unless something is amiss, squirrelmail *should* be permissions-agnostic - if the IMAP/POP server can read the emails, then so too, should squirrelmail be able to read them.
so that's the spot to troubleshoot - first see if you can read the emails just via IMAP. Use telnet to test (list) if necessary, but make sure the IMAP piece is taken care of. Again, the variable here, squirrelmail should be asking IMAP, it should not be querying the filesystem directly.
It may even be as simple as changing the user under which the IMAP/POP daemon runs, to be the same user under which Postfix runs.
This is part of why I found the "official" guide to be a bit cumbersome, and why cyrus with its internal account/mailbox structure ends up being easier to manage long-term. _________________ Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash |
|
Back to top |
|
|
webbruno n00b
Joined: 01 May 2010 Posts: 24
|
Posted: Fri Oct 12, 2012 1:37 pm Post subject: Solved |
|
|
As I use to say: 90% of the problems in the computing world comes from somewhere between the chair (in this case, my own chair)[/b] and the keyboard, this one wasn't different. The error was obvious, I configured postfix to accept only connections from a specific uid: the vmail uid. The solution was the simplest:
Instead of creating system users I should create users using the mysql database linked with postfix as described in the tutorial
I really appreciate the help of you guys above! _________________ Running Gentoo with =sys-kernel/vanilla-sources-2.6.39 from i5 2500k @ 4.0ghz, 8gb ddr3 1866 corsair vengeance, ga-ud3-p67-b3, seagate barracuda 1TB 32mb cache, cooler master 460 and Geforce GTX 580 |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|