[Dovecot] deliver looking into root directory for sieve configuration ?
Hi,
I'm using dovecot (+sieve), dspam, clamav and postfix with wirtual users and domains. When the server receive an email, I get this error : Jan 2 14:48:52 mail postfix/qmgr[13573]: 89DE1276C42B: from=postmaster@shadowprojects.org, size=926, nrcpt=1 (queue active) Jan 2 14:48:52 mail deliver(postmaster@adomain.fr): chdir(/root) failed: Permission denied Jan 2 14:48:52 mail deliver(postmaster@adomain.fr): stat(/root/.dovecot.sieve) failed: Permission denied Jan 2 14:48:52 mail deliver(postmaster@adomain.fr): msgid=495E1B33.5020009@shadowprojects.org: saved mail to INBOX Jan 2 14:48:52 mail postfix/lmtp[13584]: 89DE1276C42B: to=postmaster@adomain.fr, relay=mail.mydomain.com[/var/run/dspam/dspam.sock], delay=0.07, delays=0.05/0/0/0.01, dsn=2.6.0, status=sent (250 2.6.0 postmaster@adomain Message accepted for delivery)
Why does it look inside the /root folder for sieve configuration ? All virtual mailboxes are in /home/vmail/DOMAIN/USER/.maildir (owned by postfix:postfix; dspam has been put in the postfix group)
I uploaded the following config files in http://hiltg.pastebin.com/ :
- main.cf
- master.cf
- dovecot.conf
- dspam.conf
(mails are supposed to be delivered to the mailbox by dovecot, which is called by dspam)
Any idea please ?
Thanks and happy new year to you all,
-- Guillaume Hilt
On 1/2/2009, Guillaume Hilt (postmaster@shadowprojects.org) wrote:
I uploaded the following config files in http://hiltg.pastebin.com/ :
- main.cf
- master.cf
- dovecot.conf
- dspam.conf
Posting to a service like this is really a bother - just paste into the email body...
Also, you should only post output of 'postconf -n' and 'dovecot -n'... this shows the actual working config, which, believe it or not, sometimes can be different from what you think it is - it also skips the comments, which really makes reading a config file a lot harder.
Please try again...
--
Best regards,
Charles
# postconf -n
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = lmtp:unix:/var/run/dspam/dspam.sock
daemon_directory = /usr/lib64/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
home_mailbox = .maildir/
html_directory = /usr/share/doc/postfix-2.5.5/html
mail_owner = postfix
mailbox_command = /usr/bin/dspam --deliver=innocent -- -d %u
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost,
mail.$mydomain, www.$mydomain, ftp.$mydomain
mydomain = apteo.com
myhostname = mail.apteo.com
mynetworks = 127.0.0.0/8, hash:/etc/postfix/pop-before-smtp
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.5.5/readme
recipient_canonical_maps = hash:/etc/postfix/recipient_canonical
recipient_delimiter = +
sample_directory = /etc/postfix
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_sender_dependent_authentication = yes
smtp_tls_note_starttls_offer = yes
smtpd_client_restrictions = permit_mynetworks
smtpd_recipient_restrictions = reject_unauth_pipelining,
reject_non_fqdn_recipient, reject_unknown_recipient_domain,
permit_mynetworks, permit_sasl_authenticated,
reject_unauth_destination, warn_if_reject, reject_non_fqdn_hostname,
reject_non_fqdn_sender, reject_invalid_hostname, reject_rbl_client
list.dsbl.org, reject_rbl_client sbl-xbl.spamhaus.org
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/ssl/StartSSL.crt
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/Apteo.crt
smtpd_tls_key_file = /etc/ssl/private/Apteo.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:207
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 207
virtual_transport = virtual
virtual_uid_maps = static:207
# dovecot -n # 1.1.7: /etc/dovecot/dovecot.conf # OS: Linux 2.6.24.5-grsec-xxxx-grs-ipv4-64 x86_64 Gentoo Base System release 1.12.11.1 ext3 protocols: imap imaps pop3 pop3s listen(default): *:143 listen(imap): *:143 listen(pop3): *:110 ssl_listen(default): *:993 ssl_listen(imap): *:993 ssl_listen(pop3): *:995 ssl_ca_file: /etc/ssl/StartSSL.crt ssl_cert_file: /etc/ssl/Apteo.crt ssl_key_file: /etc/ssl/private/Apteo.key ssl_key_password: Y0ullN3v3rF1ndTh1sPassphras3 ssl_cipher_list: ALL:!LOW:!SSLv2 disable_plaintext_auth: no verbose_ssl: yes login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login login_greeting_capability(default): yes login_greeting_capability(imap): yes login_greeting_capability(pop3): no first_valid_uid: 207 mail_location: maildir:/home/vmail/%d/%n/.maildir fsync_disable: yes maildir_copy_preserve_filename: yes mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugins(default): antispam mail_plugins(imap): antispam mail_plugins(pop3): mail_plugin_dir(default): /usr/lib/dovecot/imap mail_plugin_dir(imap): /usr/lib/dovecot/imap mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3 imap_client_workarounds(default): delay-newmail imap_client_workarounds(imap): delay-newmail imap_client_workarounds(pop3): pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh auth default: passdb: driver: sql args: /etc/dovecot/dovecot-sql.conf userdb: driver: sql args: /etc/dovecot/dovecot-sql.conf socket: type: listen client: path: /var/spool/postfix/private/auth mode: 432 user: postfix group: postfix master: path: /var/run/dovecot/auth-master mode: 438 plugin: antispam_signature: X-DSPAM-Signature antispam_signature_missing: error antispam_trash: Trash antispam_spam: Spam antispam_dspam_binary: /usr/bin/dspam
Guillaume Hilt
Charles Marcus a écrit :
On 1/2/2009, Guillaume Hilt (postmaster@shadowprojects.org) wrote:
I uploaded the following config files in http://hiltg.pastebin.com/ :
- main.cf
- master.cf
- dovecot.conf
- dspam.conf
Posting to a service like this is really a bother - just paste into the email body...
Also, you should only post output of 'postconf -n' and 'dovecot -n'... this shows the actual working config, which, believe it or not, sometimes can be different from what you think it is - it also skips the comments, which really makes reading a config file a lot harder.
Please try again...
On 1/2/2009 10:10 AM, Guillaume Hilt wrote:
# OS: Linux 2.6.24.5-grsec-xxxx-grs-ipv4-64
Hmmm... maybe it is a grsec problem? I can't help you there...
ssl_key_password: Y0ullN3v3rF1ndTh1sPassphras3
If thats really your passphrase, you'd best change it asap...
smtpd_client_restrictions = permit_mynetworks
Redundant... remove this...
smtpd_recipient_restrictions = reject_unauth_pipelining,
useless here... either put this in smtpd_data_restrictions, or remove it
reject_non_fqdn_recipient, reject_unknown_recipient_domain, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, warn_if_reject, reject_non_fqdn_hostname,
Is that comma a cut-n-paste typo? if you want to warn only on reject_non_fqdn_hostname, then remove this comma, otherwise remove 'warn_if_reject' completely...
master.cf contents (ie, is it running chrooted?)?
The devil is in the details - the more you provide when asking for help, the more likely you'll get a helpful response...
Also - when re-sending like this, it would be most helpful if you restate your problem too - prevents people from having to switch back and forth between different messages...
Sorry if it seems like I'm picking nits...
--
Best regards,
Charles
It's okay, you're trying to help me, so I won't complain :)
So, postfix isn't running in a chroot. I've done the modifications you suggested.
My problem is that sieve is looking into the root folder for a sieve configuration file when the server receive a new email (mail for a virtual user). I'll change the ssl key later, the server is not in production and i haven't finished the ssl part yet.
Guillaume Hilt
Charles Marcus a écrit :
On 1/2/2009 10:10 AM, Guillaume Hilt wrote:
# OS: Linux 2.6.24.5-grsec-xxxx-grs-ipv4-64
Hmmm... maybe it is a grsec problem? I can't help you there...
ssl_key_password: Y0ullN3v3rF1ndTh1sPassphras3
If thats really your passphrase, you'd best change it asap...
smtpd_client_restrictions = permit_mynetworks
Redundant... remove this...
smtpd_recipient_restrictions = reject_unauth_pipelining,
useless here... either put this in smtpd_data_restrictions, or remove it
reject_non_fqdn_recipient, reject_unknown_recipient_domain, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, warn_if_reject, reject_non_fqdn_hostname,
Is that comma a cut-n-paste typo? if you want to warn only on reject_non_fqdn_hostname, then remove this comma, otherwise remove 'warn_if_reject' completely...
master.cf contents (ie, is it running chrooted?)?
The devil is in the details - the more you provide when asking for help, the more likely you'll get a helpful response...
Also - when re-sending like this, it would be most helpful if you restate your problem too - prevents people from having to switch back and forth between different messages...
Sorry if it seems like I'm picking nits...
On 1/2/2009 11:54 AM, Guillaume Hilt wrote:
It's okay, you're trying to help me, so I won't complain :)
So, postfix isn't running in a chroot.
Are you sure? master .cf?
My problem is that sieve is looking into the root folder for a sieve configuration file when the server receive a new email (mail for a virtual user).
I didn't see anything in your dovecot config about sieve...
Did you read and install/configure according to this page?
http://wiki.dovecot.org/LDA/Sieve
I'll change the ssl key later, the server is not in production and i haven't finished the ssl part yet.
no worries then... ;)
--
Best regards,
Charles
Charles Marcus a écrit :
On 1/2/2009 11:54 AM, Guillaume Hilt wrote:
It's okay, you're trying to help me, so I won't complain :)
So, postfix isn't running in a chroot.
Are you sure? master .cf?
smtp inet n - n - - smtpd pickup fifo n - n 60 1 pickup cleanup unix n - n - 0 cleanup qmgr fifo n - n 300 1 qmgr tlsmgr unix - - n 1000? 1 tlsmgr rewrite unix - - n - - trivial-rewrite bounce unix - - n - 0 bounce defer unix - - n - 0 bounce trace unix - - n - 0 bounce verify unix - - n - 1 verify flush unix n - n 1000? 0 flush proxymap unix - - n - - proxymap proxywrite unix - - n - 1 proxymap smtp unix - - n - - smtp relay unix - - n - - smtp -o smtp_fallback_relay= showq unix n - n - - showq error unix - - n - - error retry unix - - n - - error discard unix - - n - - discard local unix - n n - - local virtual unix - n n - - virtual lmtp unix - - n - - lmtp anvil unix - - n - 1 anvil scache unix - - n - 1 scache
My problem is that sieve is looking into the root folder for a sieve configuration file when the server receive a new email (mail for a virtual user).
I didn't see anything in your dovecot config about sieve...
Did you read and install/configure according to this page?
sieve is declared and called in the lda section :) (i followed the tutorial yeah)
I'll change the ssl key later, the server is not in production and i haven't finished the ssl part yet.
no worries then... ;)
On 1/2/2009 12:18 PM, Guillaume Hilt wrote:
Did you read and install/configure according to this page?
sieve is declared and called in the lda section :) (i followed the tutorial yeah)
Well... I don't use dspam, but the sieve tutorial explicitly says you need to be using the dovecot LDA, and you are using dspam in your postfix config...
First thing I'd try is removing dspam from the mix, get postfix+dovecot working right, then introduce dspam into the mix, and if you have problems ask again (on the dspam list first, then maybe here)...
--
Best regards,
Charles
Hello,
Try setting the sieve dir under the LDA procotol:
sieve_global_dir = /path/with/the/globel/sieve/scripts
if you dont have any global sieve scripts, i guess any directory readable to all will do, if you have user sieve scripts you should use sieve under the plugin section.
//sami
On Fri, 2 Jan 2009, Guillaume Hilt wrote:
Charles Marcus a écrit :
On 1/2/2009 11:54 AM, Guillaume Hilt wrote:
It's okay, you're trying to help me, so I won't complain :)
So, postfix isn't running in a chroot.
Are you sure? master .cf?
smtp inet n - n - - smtpd pickup fifo n - n 60 1 pickup cleanup unix n - n - 0 cleanup qmgr fifo n - n 300 1 qmgr tlsmgr unix - - n 1000? 1 tlsmgr rewrite unix - - n - - trivial-rewrite bounce unix - - n - 0 bounce defer unix - - n - 0 bounce trace unix - - n - 0 bounce verify unix - - n - 1 verify flush unix n - n 1000? 0 flush proxymap unix - - n - - proxymap proxywrite unix - - n - 1 proxymap smtp unix - - n - - smtp relay unix - - n - - smtp -o smtp_fallback_relay= showq unix n - n - - showq error unix - - n - - error retry unix - - n - - error discard unix - - n - - discard local unix - n n - - local virtual unix - n n - - virtual lmtp unix - - n - - lmtp anvil unix - - n - 1 anvil scache unix - - n - 1 scache
My problem is that sieve is looking into the root folder for a sieve configuration file when the server receive a new email (mail for a virtual user).
I didn't see anything in your dovecot config about sieve...
Did you read and install/configure according to this page?
sieve is declared and called in the lda section :) (i followed the tutorial yeah)
I'll change the ssl key later, the server is not in production and i haven't finished the ssl part yet.
no worries then... ;)
On Jan 2, 2009, at 9:38 AM, Guillaume Hilt wrote:
Jan 2 14:48:52 mail deliver(postmaster@adomain.fr): chdir(/root)
failed: Permission denied .. Why does it look inside the /root folder for sieve configuration ?
Your userdb returns /root as home directory. Show your dovecot- sql.conf and enable auth_debug=yes and show the logs again.
Timo Sirainen a écrit :
On Jan 2, 2009, at 9:38 AM, Guillaume Hilt wrote:
Jan 2 14:48:52 mail deliver(postmaster@adomain.fr): chdir(/root) failed: Permission denied .. Why does it look inside the /root folder for sieve configuration ?
Your userdb returns /root as home directory. Show your dovecot-sql.conf and enable auth_debug=yes and show the logs again.
Oh.
Here's the relevant part of my dovecot-sql.conf file : (it uses the database created for postfixadmin)
connect = host=localhost dbname=XXXXX user=XXXX password=XXXX client_flags=0 default_pass_scheme = MD5-CRYPT password_query = SELECT password FROM mailbox WHERE username = '%u' user_query = SELECT maildir, 207 AS uid, 207 AS gid FROM mailbox WHERE username = '%u' (that's postfix uid and gid since I don't use a vmail user but postfix)
Ok I saw the problem. Postfixadmin inly store a portion of the maildir path. Instead of storing /home/vmail/domain/user it stores domain/user.
Thanks :)
On Jan 3, 2009, at 10:21 AM, Guillaume Hilt wrote:
Timo Sirainen a écrit :
On Jan 2, 2009, at 9:38 AM, Guillaume Hilt wrote:
Jan 2 14:48:52 mail deliver(postmaster@adomain.fr): chdir(/root)
failed: Permission denied .. Why does it look inside the /root folder for sieve configuration ?Your userdb returns /root as home directory. Show your dovecot- sql.conf and enable auth_debug=yes and show the logs again.
Oh.
Postfixadmin inly store a portion of the maildir path. Instead of storing /home/vmail/domain/user it stores domain/user.
OK. Looks like I was a bit wrong. Your userdb doesn't return any home
directory (it's preferred to return one, http://wiki.dovecot.org/VirtualUsers#homedirs)
and deliver preserves HOME environment which is set to /root in your
case. That causes the chdir() error. I think I'll have to do something
about this in v1.2. The HOME environment shouldn't be preserved when
using -d parameter.
Anyway, I correct the sql request by adding a concat with .home/vmail/ and now I have the good home directory but the error still occurs. Setting sieve_global_dir didn't change anything.
Guillaume Hilt
Timo Sirainen a écrit :
On Jan 3, 2009, at 10:21 AM, Guillaume Hilt wrote:
Timo Sirainen a écrit :
On Jan 2, 2009, at 9:38 AM, Guillaume Hilt wrote:
Jan 2 14:48:52 mail deliver(postmaster@adomain.fr): chdir(/root) failed: Permission denied .. Why does it look inside the /root folder for sieve configuration ?
Your userdb returns /root as home directory. Show your dovecot-sql.conf and enable auth_debug=yes and show the logs again.
Oh.
Postfixadmin inly store a portion of the maildir path. Instead of storing /home/vmail/domain/user it stores domain/user.
OK. Looks like I was a bit wrong. Your userdb doesn't return any home directory (it's preferred to return one, http://wiki.dovecot.org/VirtualUsers#homedirs) and deliver preserves HOME environment which is set to /root in your case. That causes the chdir() error. I think I'll have to do something about this in v1.2. The HOME environment shouldn't be preserved when using -d parameter.
Where did you add that? You'll need to return a "home" field from
user_query poiting to the sieve script directory.
On Jan 3, 2009, at 10:35 AM, Guillaume Hilt wrote:
Anyway, I correct the sql request by adding a concat with .home/ vmail/ and now I have the good home directory but the error still
occurs. Setting sieve_global_dir didn't change anything.Guillaume Hilt
Timo Sirainen a écrit :
On Jan 3, 2009, at 10:21 AM, Guillaume Hilt wrote:
Timo Sirainen a écrit :
On Jan 2, 2009, at 9:38 AM, Guillaume Hilt wrote:
Jan 2 14:48:52 mail deliver(postmaster@adomain.fr): chdir(/ root) failed: Permission denied .. Why does it look inside the /root folder for sieve configuration ?
Your userdb returns /root as home directory. Show your dovecot- sql.conf and enable auth_debug=yes and show the logs again.
Oh.
Postfixadmin inly store a portion of the maildir path. Instead of storing /home/vmail/domain/user it stores domain/user.
OK. Looks like I was a bit wrong. Your userdb doesn't return any
home directory (it's preferred to return one, http://wiki.dovecot.org/VirtualUsers#homedirs) and deliver preserves HOME environment which is set to /root in
your case. That causes the chdir() error. I think I'll have to do
something about this in v1.2. The HOME environment shouldn't be
preserved when using -d parameter.
In dovecot-sql.conf
user_query = SELECT CONCAT('/home/vmail/',maildir) AS maildir, 207 AS uid, 207 AS gid FROM mailbox WHERE username = '%u' So I'll have a complete path like /home/vmail/mydomain/myuser/.
Guillaume Hilt
Timo Sirainen a écrit :
Where did you add that? You'll need to return a "home" field from user_query poiting to the sieve script directory.
On Jan 3, 2009, at 10:35 AM, Guillaume Hilt wrote:
Anyway, I correct the sql request by adding a concat with .home/vmail/ and now I have the good home directory but the error still occurs. Setting sieve_global_dir didn't change anything.
Guillaume Hilt
Timo Sirainen a écrit :
On Jan 3, 2009, at 10:21 AM, Guillaume Hilt wrote:
Timo Sirainen a écrit :
On Jan 2, 2009, at 9:38 AM, Guillaume Hilt wrote:
Jan 2 14:48:52 mail deliver(postmaster@adomain.fr): chdir(/root) failed: Permission denied .. Why does it look inside the /root folder for sieve configuration ?
Your userdb returns /root as home directory. Show your dovecot-sql.conf and enable auth_debug=yes and show the logs again.
Oh.
Postfixadmin inly store a portion of the maildir path. Instead of storing /home/vmail/domain/user it stores domain/user.
OK. Looks like I was a bit wrong. Your userdb doesn't return any home directory (it's preferred to return one, http://wiki.dovecot.org/VirtualUsers#homedirs) and deliver preserves HOME environment which is set to /root in your case. That causes the chdir() error. I think I'll have to do something about this in v1.2. The HOME environment shouldn't be preserved when using -d parameter.
"maildir" field isn't used for anything. Perhaps there is some
completely undocumented and unreliable code that makes use of it for
pop3/imap, but it is used in no way by Sieve. Try something like:
user_query = SELECT CONCAT('/home/vmail', maildir) AS home, 207 AS
uid, 207 AS gid FROM mailbox WHERE username = '%u'
And in dovecot.conf:
mail_location = maildir:~/
(or actually preferrably mail_location = maildir:~/Maildir if can
afford to change it).
On Jan 3, 2009, at 10:43 AM, Guillaume Hilt wrote:
In dovecot-sql.conf
user_query = SELECT CONCAT('/home/vmail/',maildir) AS maildir, 207
AS uid, 207 AS gid FROM mailbox WHERE username = '%u' So I'll have a complete path like /home/vmail/mydomain/myuser/.Guillaume Hilt
Timo Sirainen a écrit :
Where did you add that? You'll need to return a "home" field from
user_query poiting to the sieve script directory.On Jan 3, 2009, at 10:35 AM, Guillaume Hilt wrote:
Anyway, I correct the sql request by adding a concat with .home/ vmail/ and now I have the good home directory but the error still
occurs. Setting sieve_global_dir didn't change anything.Guillaume Hilt
Timo Sirainen a écrit :
On Jan 3, 2009, at 10:21 AM, Guillaume Hilt wrote:
Timo Sirainen a écrit :
On Jan 2, 2009, at 9:38 AM, Guillaume Hilt wrote:
> Jan 2 14:48:52 mail deliver(postmaster@adomain.fr): chdir(/ > root) failed: Permission denied .. > Why does it look inside the /root folder for sieve
> configuration ?Your userdb returns /root as home directory. Show your dovecot- sql.conf and enable auth_debug=yes and show the logs again.
Oh.
Postfixadmin inly store a portion of the maildir path. Instead of storing /home/vmail/domain/user it stores domain/user.
OK. Looks like I was a bit wrong. Your userdb doesn't return any
home directory (it's preferred to return one, http://wiki.dovecot.org/VirtualUsers#homedirs) and deliver preserves HOME environment which is set to /root in
your case. That causes the chdir() error. I think I'll have to do
something about this in v1.2. The HOME environment shouldn't be
preserved when using -d parameter.
I'll try that. For the mail location, it's already the case : ~/.maildir
Guillaume Hilt
Timo Sirainen a écrit :
"maildir" field isn't used for anything. Perhaps there is some completely undocumented and unreliable code that makes use of it for pop3/imap, but it is used in no way by Sieve. Try something like:
user_query = SELECT CONCAT('/home/vmail', maildir) AS home, 207 AS uid, 207 AS gid FROM mailbox WHERE username = '%u'
And in dovecot.conf:
mail_location = maildir:~/
(or actually preferrably mail_location = maildir:~/Maildir if can afford to change it).
On Jan 3, 2009, at 10:43 AM, Guillaume Hilt wrote:
In dovecot-sql.conf
user_query = SELECT CONCAT('/home/vmail/',maildir) AS maildir, 207 AS uid, 207 AS gid FROM mailbox WHERE username = '%u' So I'll have a complete path like /home/vmail/mydomain/myuser/.
Guillaume Hilt
Timo Sirainen a écrit :
Where did you add that? You'll need to return a "home" field from user_query poiting to the sieve script directory.
On Jan 3, 2009, at 10:35 AM, Guillaume Hilt wrote:
Anyway, I correct the sql request by adding a concat with .home/vmail/ and now I have the good home directory but the error still occurs. Setting sieve_global_dir didn't change anything.
Guillaume Hilt
Timo Sirainen a écrit :
On Jan 3, 2009, at 10:21 AM, Guillaume Hilt wrote:
Timo Sirainen a écrit : > On Jan 2, 2009, at 9:38 AM, Guillaume Hilt wrote: > >> Jan 2 14:48:52 mail deliver(postmaster@adomain.fr): >> chdir(/root) failed: Permission denied > .. >> Why does it look inside the /root folder for sieve configuration ? > > Your userdb returns /root as home directory. Show your > dovecot-sql.conf and enable auth_debug=yes and show the logs again. > > Oh.
Postfixadmin inly store a portion of the maildir path. Instead of storing /home/vmail/domain/user it stores domain/user.
OK. Looks like I was a bit wrong. Your userdb doesn't return any home directory (it's preferred to return one, http://wiki.dovecot.org/VirtualUsers#homedirs) and deliver preserves HOME environment which is set to /root in your case. That causes the chdir() error. I think I'll have to do something about this in v1.2. The HOME environment shouldn't be preserved when using -d parameter.
Looks like using "As home" in the sql request corrected the problem :) Thanks Timo ;)
Guillaume Hilt
Guillaume Hilt a écrit :
I'll try that. For the mail location, it's already the case : ~/.maildir
Guillaume Hilt
Timo Sirainen a écrit :
"maildir" field isn't used for anything. Perhaps there is some completely undocumented and unreliable code that makes use of it for pop3/imap, but it is used in no way by Sieve. Try something like:
user_query = SELECT CONCAT('/home/vmail', maildir) AS home, 207 AS uid, 207 AS gid FROM mailbox WHERE username = '%u'
And in dovecot.conf:
mail_location = maildir:~/
(or actually preferrably mail_location = maildir:~/Maildir if can afford to change it).
On Jan 3, 2009, at 10:43 AM, Guillaume Hilt wrote:
In dovecot-sql.conf
user_query = SELECT CONCAT('/home/vmail/',maildir) AS maildir, 207 AS uid, 207 AS gid FROM mailbox WHERE username = '%u' So I'll have a complete path like /home/vmail/mydomain/myuser/.
Guillaume Hilt
Timo Sirainen a écrit :
Where did you add that? You'll need to return a "home" field from user_query poiting to the sieve script directory.
On Jan 3, 2009, at 10:35 AM, Guillaume Hilt wrote:
Anyway, I correct the sql request by adding a concat with .home/vmail/ and now I have the good home directory but the error still occurs. Setting sieve_global_dir didn't change anything.
Guillaume Hilt
Timo Sirainen a écrit :
On Jan 3, 2009, at 10:21 AM, Guillaume Hilt wrote:
> Timo Sirainen a écrit : >> On Jan 2, 2009, at 9:38 AM, Guillaume Hilt wrote: >> >>> Jan 2 14:48:52 mail deliver(postmaster@adomain.fr): >>> chdir(/root) failed: Permission denied >> .. >>> Why does it look inside the /root folder for sieve >>> configuration ? >> >> Your userdb returns /root as home directory. Show your >> dovecot-sql.conf and enable auth_debug=yes and show the logs >> again. >> >> > Oh. > > Postfixadmin inly store a portion of the maildir path. > Instead of storing /home/vmail/domain/user it stores domain/user.
OK. Looks like I was a bit wrong. Your userdb doesn't return any home directory (it's preferred to return one, http://wiki.dovecot.org/VirtualUsers#homedirs) and deliver preserves HOME environment which is set to /root in your case. That causes the chdir() error. I think I'll have to do something about this in v1.2. The HOME environment shouldn't be preserved when using -d parameter.
participants (4)
-
Charles Marcus
-
Guillaume Hilt
-
sami@medusa.tutka.fi
-
Timo Sirainen