Re: [Dovecot] Calling dovecot-lda from maildrop/shell

2013-11-19 Thread Pascal Volk
On 11/18/2013 05:14 PM Florian Lindner wrote:
   # doveconf -n
 # 2.1.7: /etc/dovecot/dovecot.conf
 # OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.2
 auth_mechanisms = plain login digest-md5 cram-md5 ntlm
 …
 passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
 }
 protocols = imap pop3
 …
 userdb {
driver = prefetch
 }
 userdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
 }
 
 # doveadm user flindner
 userdb lookup: user flindner doesn't exist
 
 flindner is my linux system user. There are virtual user, e.g

In your log excerpt I've seen '/home/flindner/…', so I thought there
could be the user flindner.

 # doveadm user s...@xgm.de
 userdb: s...@xgm.de
home  : /home/flindner/Mail/spam
uid   : 1001
gid   : 1001
 
 /home/flindner/Mail/spam is the home and maildir of virtual user.

That could cause several problems. For example that problem you've
reported. The simplest solution would be setting
mail_location=~maildir:~/Maildir in /etc/dovecot/conf.d/10-mail.conf.

With this configuration Dovecot will use
/home/flindner/Mail/spam/Maildir as mail location for user s...@xgm.de.


 My mail system is built like that:
 
 postfix delivers all mail of a domain to maildrop using a system user 
 which have this domain assigned. maildrop does the final delivery. There 
 is no 1:1 mapping of mail adresses to maildirs.
 
 postfix @xgm.de - maildrop flindner - maildrop - maildir - dovecot 
 IMAP  this should become:
 
 postfix @xgm.de - maildrop flindner - maildrop - dovecot-lda - 
 maildir - dovecot IMAP
 
 so that I can also use sieve for filtering.

When using Sieve it's also strongly recommended to have $home != $mail.
With the settings from above you could use 'default' settings for Sieve,
e.g.:

# 15-lda.conf
protocol lda {
  mail_plugins = $mail_plugins sieve
}
# 20-lmtp.conf
protocol lmtp {
  mail_plugins = $mail_plugins sieve
}
# 90-sieve.conf
plugin {
  recipient_delimiter = +
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}

Then the file /home/flindner/Mail/spam/.dovecot.sieve would contain the
Sieve rules for user s...@xgm.de.

See also: http://wiki2.dovecot.org/VirtualUsers/Home


Regards,
Pascal
-- 
The trapper recommends today: beeffeed.1332...@localdomain.org


[Dovecot] Calling dovecot-lda from maildrop/shell

2013-11-18 Thread Florian Lindner

Hello,

I want to make final delivery for some of my mailboxes using 
dovecot-lda, since I'm interested in using sieve. My usual MDA which is 
called from postfix is and will be maildrop.


First try was to call dovecot-lda from command line:

/usr/lib/dovecot/dovecot-lda -d s...@xgm.de  testmail

which gave return code 75 (EX_TEMPFAIL) and logged:

dovecot: auth-worker(3533): mysql(localhost): Connected to database 
system
dovecot: imap-login: Login: user=s...@xgm.de, method=PLAIN, rip=::1, 
lip=::1, mpid=3535, secured, session=jwXWP3HrwgAB

dovecot: imap(s...@xgm.de): Disconnected: Logged out in=91 out=830
dovecot: lda(s...@xgm.de): Error: user s...@xgm.de: Initialization 
failed: Namespace '': Mail storage autodetection failed with 
home=/home/flindner/Mail/spam
dovecot: lda(s...@xgm.de): Fatal: Invalid user settings. Refer to server 
log for more information.


My userdb/password is like that home == maildir == 
/home/flindner/Mail/spam  (without prefixed maildir:). It works fine 
for dovecot-imap, it detects that spam is a maildir.


I've also tried prefixing home and or maildir with maildir: or 
calling: HOME=maildir:~/Mail/spam /usr/lib/dovecot/dovecot-lda  
testmail which gave:


dovecot: lda: Error: user flindner: Relative home directory paths not 
supported: maildir:/home/flindner/Mail/spam
dovecot: lda: Fatal: Invalid user settings. Refer to server log for more 
information.


What is the problem with the LDA here?

Thanks,
Florian


Re: [Dovecot] Calling dovecot-lda from maildrop/shell

2013-11-18 Thread Pascal Volk
On 11/18/2013 11:08 AM Florian Lindner wrote:
 …
 First try was to call dovecot-lda from command line:
 
 /usr/lib/dovecot/dovecot-lda -d s...@xgm.de  testmail
 
 which gave return code 75 (EX_TEMPFAIL) and logged:
 
 dovecot: auth-worker(3533): mysql(localhost): Connected to database 
 system
 dovecot: lda(s...@xgm.de): Error: user s...@xgm.de: Initialization 
 failed: Namespace '': Mail storage autodetection failed with 
 home=/home/flindner/Mail/spam
 dovecot: lda(s...@xgm.de): Fatal: Invalid user settings. Refer to server 
 log for more information.
 
 My userdb/password is like that home == maildir == 
 /home/flindner/Mail/spam  (without prefixed maildir:). It works fine 
 for dovecot-imap, it detects that spam is a maildir.
 
 I've also tried prefixing home and or maildir with maildir: or 
 calling: HOME=maildir:~/Mail/spam /usr/lib/dovecot/dovecot-lda  
 testmail which gave:
 
 dovecot: lda: Error: user flindner: Relative home directory paths not 
 supported: maildir:/home/flindner/Mail/spam
 dovecot: lda: Fatal: Invalid user settings. Refer to server log for more 
 information.
 
 What is the problem with the LDA here?

Please provide the output from `doveconf -n` and `doveadm user flindner`.


Regards,
Pascal
-- 
The trapper recommends today: decade.1332...@localdomain.org


Re: [Dovecot] Calling dovecot-lda from maildrop/shell

2013-11-18 Thread Florian Lindner

Am 18.11.2013 13:40, schrieb Pascal Volk:

On 11/18/2013 11:08 AM Florian Lindner wrote:

…
First try was to call dovecot-lda from command line:

/usr/lib/dovecot/dovecot-lda -d s...@xgm.de  testmail

which gave return code 75 (EX_TEMPFAIL) and logged:

dovecot: auth-worker(3533): mysql(localhost): Connected to database
system
dovecot: lda(s...@xgm.de): Error: user s...@xgm.de: Initialization
failed: Namespace '': Mail storage autodetection failed with
home=/home/flindner/Mail/spam
dovecot: lda(s...@xgm.de): Fatal: Invalid user settings. Refer to 
server

log for more information.

My userdb/password is like that home == maildir ==
/home/flindner/Mail/spam  (without prefixed maildir:). It works fine
for dovecot-imap, it detects that spam is a maildir.

I've also tried prefixing home and or maildir with maildir: or
calling: HOME=maildir:~/Mail/spam /usr/lib/dovecot/dovecot-lda 
testmail which gave:

dovecot: lda: Error: user flindner: Relative home directory paths not
supported: maildir:/home/flindner/Mail/spam
dovecot: lda: Fatal: Invalid user settings. Refer to server log for 
more

information.

What is the problem with the LDA here?


Please provide the output from `doveconf -n` and `doveadm user 
flindner`.


 # doveconf -n
# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.2
auth_mechanisms = plain login digest-md5 cram-md5 ntlm
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
auto = create
special_use = \Drafts
  }
  mailbox Junk {
auto = create
special_use = \Junk
  }
  mailbox Sent {
auto = create
special_use = \Sent
  }
  mailbox Sent Messages {
special_use = \Sent
  }
  mailbox Spam {
special_use = \Junk
  }
  mailbox Trash {
auto = create
special_use = \Trash
  }
  prefix =
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocols = imap pop3
service auth {
  unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
  }
}
ssl_cert = /etc/ssl/astarte.centershock.net.cert
ssl_key = /etc/ssl/astarte.centershock.net.key
userdb {
  driver = prefetch
}
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}

# doveadm user flindner
userdb lookup: user flindner doesn't exist

flindner is my linux system user. There are virtual user, e.g

# doveadm user s...@xgm.de
userdb: s...@xgm.de
  home  : /home/flindner/Mail/spam
  uid   : 1001
  gid   : 1001

/home/flindner/Mail/spam is the home and maildir of virtual user.

My mail system is built like that:

postfix delivers all mail of a domain to maildrop using a system user 
which have this domain assigned. maildrop does the final delivery. There 
is no 1:1 mapping of mail adresses to maildirs.


postfix @xgm.de - maildrop flindner - maildrop - maildir - dovecot 
IMAP  this should become:


postfix @xgm.de - maildrop flindner - maildrop - dovecot-lda - 
maildir - dovecot IMAP


so that I can also use sieve for filtering.

Regards,

Florian