Re: [Dovecot] dovecot is working, sort of

2013-08-15 Thread Tom Hendrikx
On 08/15/2013 07:13 AM, LuKreme wrote:
 I have dovecot setup and authenticating away for local users, but
 when I try to add MySQL users from postfix admin, not only does that
 fail, but all authentication fails.
 
snip
 and I get the following errors for *ALL* attempts to connect, not
 just sql ones:
snip
 mail dovecot: auth: Fatal: mysql: Missing value in connect string:
 password-dovecot mail dovecot: master: Error: service(auth): command
 startup failed, throttling for 60 secs
snip
 
 The dovecot-sql.conf.ext file is: $ cat
 /etc/dovecot/dovecot-sql.conf.ext driver =  mysql connect =
 host=localhost dbname=postfix user=dovecot password-dovecot

I see a typo there, and the error message is referring to it. Maybe try
password=dovecot?

The reason that all authentications fail (also the non sql ones), is
because the auth process (that handles all authentications) dies because
of the typo.

Tom



signature.asc
Description: OpenPGP digital signature


Re: [Dovecot] dovecot is working, sort of

2013-08-15 Thread LuKreme

On 15 Aug 2013, at 01:14 , Tom Hendrikx t...@whyscream.net wrote:

 I see a typo there, and the error message is referring to it. Maybe try
 password=dovecot?

You'll never believe this, but I *just* saw this less than a minute ago and 
came over to my mail to post my 'doh' message.

Sigh.

I think I'll wait on my next stupid question until morning.

:)

-- 
This is our music from the bachelor's den, the sound of loneliness
turned up to ten. A harsh soundtrack from a stagnant waterbed and it
sounds just like this. This is the sound of someone losing the plot
making out that they're OK when they're not.  You're gonna like it, but
not a lot. And the chorus goes like this...



Re: [Dovecot] dovecot is working, sort of

2013-08-15 Thread LuKreme

On 15 Aug 2013, at 02:05 , LuKreme krem...@kreme.com wrote:

 I think I'll wait on my next stupid question until morning.

Or not.

Error: user lists@*munged*: Couldn't drop privileges: User is missing UID (see 
mail_uid setting)

These are all virtual users with a hid of 89. How do I tell dovecot that?


$ cat /etc/dovecot/dovecot-sql.conf.ext
driver =  mysql
connect = host=localhost dbname=postfix user=dovecot password=dovecot
default_pass_scheme = MD5-CRYPT
password_query = select password from mailbox where username ='%u'
user_query = select concat('/usr/local/virtual/', maildir) from mailbox where 
username = '%u'

$ doveconf -n
# 2.2.5: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 9.1-RELEASE i386  
auth_debug_passwords = yes
auth_mechanisms = plain login
disable_plaintext_auth = no
mail_location = maildir:~/Maildir
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy 
include variables body enotify environment mailbox date ihave
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
auto = subscribe
special_use = \Junk
  }
  mailbox NotJunk {
auto = subscribe
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox Sent Messages {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  prefix = 
}
passdb {
  driver = pam
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
ssl_cert = /etc/ssl/certs/dovecot.pem
ssl_key = /etc/ssl/private/dovecot.pem
userdb {
  driver = passwd
}
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}


-- 
'(...) And the Patrician has been ironical at me,' said Mr. Clete. 'I'm
not having that again.'



Re: [Dovecot] dovecot is working, sort of

2013-08-15 Thread Rob Sterenborg (lists)

On 08/15/2013 10:50 AM, LuKreme wrote:


Error: user lists@*munged*: Couldn't drop privileges: User is missing UID (see 
mail_uid setting)

These are all virtual users with a hid of 89. How do I tell dovecot that?


$ cat /etc/dovecot/dovecot-sql.conf.ext
driver =  mysql
connect = host=localhost dbname=postfix user=dovecot password=dovecot
default_pass_scheme = MD5-CRYPT
password_query = select password from mailbox where username ='%u'
user_query = select concat('/usr/local/virtual/', maildir) from mailbox where 
username = '%u'


In my SQL configuration I have something like this:

user_query = \
SELECT _home AS home, _uid AS uid, _gid AS gid \
FROM virtual_mailboxes \
WHERE _recipient='%u' AND _active=1

Using this I can give certain users a different UID/GID, should I want 
to. But if I'm not mistaken you can also statically configure the uid 
and gid.

On page http://wiki2.dovecot.org/VirtualUsers, the last example says:

userdb {
  driver = static
  args = uid=vmail gid=vmail home=/var/mail/virtual/%d/%n
}

I guess you should be able to adapt this to your SQL config.


--
Rob



Re: [Dovecot] INBOX protected foldername?

2013-08-15 Thread Hajo Locke

Hello,



Since 2.1.17 fixes a lot of bugs of 2.1.7, I would propose you to open a 
bug report on the dovecot package in bugs.debian.org and list some of the 
bugs which have been fixed in the meantime. The  easiest way to do so 
is to use the reportbug tool in Debian.


hmm, upgrading should fix some older errors but in my case i got new ones.

i went to 2.1.17 from http://xi.rename-it.nl/debian/ and did my changes to 
source debs and compiled my packages.
At the moment i update from 2.1.7 to 2.1.17 my userdb-settings in mysql-db 
are not working any more.


passdb and userdb directives are like this:

passdb {
 args = /etc/dovecot/dovecot-sql.conf
 driver = sql
}
userdb {
 driver = prefetch
}

namespace is this:

namespace inbox {
 inbox = yes
}


PasswordQuery with prefetching userdb is this:

password_query = SELECT `inbox` as `user`, `password`, `home` as 
userdb_home, `uid` AS userdb_uid, `gid` AS userdb_gid, `userdb_import` AS 
userdb_userdb_import FROM `mail_users` WHERE `login` = '%u' AND `active`='Y'


I tested also without prefetching - same result.

In mysql in field userdb_import i have my TAB-separated XLIST Settings:
namespace/inbox/mailbox=Sentnamespace/inbox/mailbox/Sent/name=Sent 
namespace/inbox/mailbox/Sent/auto=subscribe 
namespace/inbox/mailbox/Sent/special_use=\Sent 
namespace/inbox/mailbox=Draftsnamespace/inbox/mailbox/Drafts/name=Drafts 
namespace/inbox/mailbox/Drafts/auto=subscribe 
namespace/inbox/mailbox/Drafts/special_use=\Drafts 
namespace/inbox/mailbox=Trashnamespace/inbox/mailbox/Trash/name=Trash 
namespace/inbox/mailbox/Trash/auto=subscribe 
namespace/inbox/mailbox/Trash/special_use=\Trash 
namespace/inbox/mailbox=Spamnamespace/inbox/mailbox/Spam/name=Spam 
namespace/inbox/mailbox/Spam/auto=subscribe 
namespace/inbox/mailbox/Spam/special_use=\Junk



The 2.1.7 correct works:

Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox=Drafts
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox=Sent
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox=Spam
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox=Trash
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Drafts/auto=subscribe
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Drafts/name=Entwürfe
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Drafts/special_use=\Drafts
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Sent/auto=subscribe
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Sent/name=Gesendet
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Sent/special_use=\Sent
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Spam/auto=subscribe
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Spam/name=Spam
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Spam/special_use=\Junk
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Trash/auto=subscribe
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Trash/name=Papierkorb
Aug 15 15:26:25 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Trash/special_use=\Trash


After upgrading to 2.1.17 the debuglog says:

Aug 15 15:24:47 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox=Spam
Aug 15 15:24:47 myhostname dovecot: imap: Debug: Unknown userdb setting: 
plugin/namespace/inbox/mailbox/Drafts/auto=subscribe
Aug 15 15:24:47 myhostname dovecot: imap: Debug: Unknown userdb setting: 
plugin/namespace/inbox/mailbox/Drafts/name=Entwürfe
Aug 15 15:24:47 myhostname dovecot: imap: Debug: Unknown userdb setting: 
plugin/namespace/inbox/mailbox/Drafts/special_use=\Drafts
Aug 15 15:24:47 myhostname dovecot: imap: Debug: Unknown userdb setting: 
plugin/namespace/inbox/mailbox/Sent/auto=subscribe
Aug 15 15:24:47 myhostname dovecot: imap: Debug: Unknown userdb setting: 
plugin/namespace/inbox/mailbox/Sent/name=Gesendet
Aug 15 15:24:47 myhostname dovecot: imap: Debug: Unknown userdb setting: 
plugin/namespace/inbox/mailbox/Sent/special_use=\Sent
Aug 15 15:24:47 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Spam/auto=subscribe
Aug 15 15:24:47 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Spam/name=Spam
Aug 15 15:24:47 myhostname dovecot: imap: Debug: Added userdb setting: 
namespace/inbox/mailbox/Spam/special_use=\Junk
Aug 15 15:24:47 myhostname dovecot: imap: Debug: Unknown userdb 

[Dovecot] Nee assistance with migrating/copying a virtual user's maildir to another virtual user

2013-08-15 Thread David Varela
Hello,

 

I am trying to move/copy a virtual user's maildir to another virtual user
but am running into problems with dsync and doveadm.  I'm trying to move the
maildir of a user who is no longer with the company to a manager's maildir.

 

For doveadm I am using the command:

 

doveadm move -u scavena...@lamontanita.coop
jhenn...@lamontanita.coop/INBOX/scavenaugh INBOX ALL

 

The error is:

 

doveadm(scavena...@lamontanita.coop): Error: user
scavena...@lamontanita.coop: Auth USER lookup failed

 

/var/log/dovecot.log shows:

 

passdb doesn't support lookups, can't verify user's existence

 

dovecot -n

# 2.1.6: /usr/local/etc/dovecot/dovecot.conf

# OS: FreeBSD 8.2-RELEASE i386  ufs

auth_cache_ttl = 14 mins

auth_debug = yes

auth_debug_passwords = yes

auth_mechanisms = plain gssapi login

auth_use_winbind = yes

auth_verbose = yes

auth_winbind_helper_path = /usr/local/bin/ntlm_auth

first_valid_gid = 1001

first_valid_uid = 1001

info_log_path = /var/log/dovecot_info.log

last_valid_gid = 1001

last_valid_uid = 1001

log_path = /var/log/dovecot.log

mail_debug = yes

mail_location = maildir:/usr/data/vmail/%u

mail_max_userip_connections = 30

mail_privileged_group = mail

passdb {

  args = /usr/local/etc/dovecot-ldap.conf

  driver = ldap

}

plugin {

  sieve = /usr/data/sieve-scripts/%u.sieve

}

protocols = imap pop3

service auth {

  unix_listener /var/spool/postfix/private/auth {

group = postfix

mode = 0660

user = postfix

  }

  unix_listener auth-master {

mode = 0600

  }

  user = root

}

ssl_cert = /etc/ssl/dovecot/04JAN12cert.pem

ssl_key = /etc/ssl//dovecot/04JAN12key.pem

userdb {

  args = uid=vmail gid=vmail home=/usr/data/vmail/%u

  driver = static

}

valid_chroot_dirs = /usr/data/vmail

verbose_proctitle = yes

protocol imap {

  imap_client_workarounds = delay-newmail tb-extra-mailbox-sep

}

protocol pop3 {

  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh

  pop3_uidl_format = %08Xu%08Xv

}

protocol lda {

  mail_plugins = sieve

  sendmail_path = /usr/sbin/sendmail

}

 

Your assistance is greatly appreciated.

 

David Varela



[Dovecot] Quota to use limits from LDAP and usage from FS

2013-08-15 Thread Frank Steinberg
Hi,

I'm new to Dovecot (switching from Cyrus). I'm using Dovecot 2.1.7 from Ubuntu 
13.04. Maildir data is stored on a Linux ext4 filesystem with quotas.

I would like to use mail quota in a way, so that the usage values are taken 
from the filesystem's quota system by the fs backend, while the per-user 
limits get read from LDAP. Due to debugging messages, it's my impression that 
reading the limits from LDAP works quite well when the user process starts, but 
when IMAP access actually takes place, the fs backend uses the filesystem's 
soft limits.

Can anybody confirm this behavior or is there a way to achieve what I intend?

 -frank



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [Dovecot] dovecot is working, sort of

2013-08-15 Thread LuKreme

On 15 Aug 2013, at 04:32 , Rob Sterenborg (lists) li...@sterenborg.info wrote:

 userdb {
  driver = static
  args = uid=vmail gid=vmail home=/var/mail/virtual/%d/%n
 }
 
 I guess you should be able to adapt this to your SQL config.

Him. I did put

userdb {
  driver = static
  args = uid=vpopmail gid=postfix
}

into dovecot.conf, but that's made no difference

-- 
MY MOM IS NOT DATING JERRY SIENFELD Bart chalkboard Ep. AABF06 



[Dovecot] IMAP Proxying and SSL Certificates on OpenBSD

2013-08-15 Thread dago

Hi list,
 
I am currently trying to configure dovecot to act as a imap proxy in front of a 
Groupwise server. Because of a policy no services of the gw server may be 
directly served to the web. So currently this is only a security measure. 
Dovecot was previously used for providing sasl-auth capabilities to postfix. 
IMAP proxy features should be added now. Authentication backend is LDAP. OS is 
OpenBSD 5.2. Dovecot version is 2.1.8. 
 
Currently I am fighting with the following error in the logs:
 

dovecot: master: Dovecot v2.1.8 starting up
dovecot: auth: Warning: userdb passwd: Move templates args to override_fields 
setting
dovecot: auth: Error: passwd(username,78.104.X.X,e9YE/gDkOQBOaKfg): 
getpwnam() failed: Operation not permitted
dovecot: imap-login: Login: user=username, method=PLAIN, rip=78.104.X.X, 
lip=5.9.X.X, mpid=1765, session=e9YE/gDkOQBOaKfg
dovecot: imap(username): Error: user username: Initialization failed: 
Initializing mail storage from mail_location setting failed: imapc: missing 
imapc_password
dovecot: imap(username): Error: Invalid user settings. Refer to server log for 
more information.
 
I hope to also see therein the cause for not providing STARTTLS:
 

# openssl s_client -connect mail.example.com:143 -starttls imap
CONNECTED(0003)
didn't found STARTTLS in server response, try anyway...
15096:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown 
protocol:/SourceCache/OpenSSL098/OpenSSL098-47/src/ssl/s23_clnt.c:607:
 
As postfix is already using the certificates, they should be okay ….
 

# dovecot -n
# 2.1.8: /etc/dovecot/dovecot.conf
# OS: OpenBSD 5.2 i386  
disable_plaintext_auth = no
imapc_host = 10.0.0.2
mail_gid = vmail
mail_home = /home/vmail/%u
mail_location = imapc:~/imapc
mail_uid = vmail
passdb {
  args = scheme=plain-md5 username_format=%n /etc/dovecot/passwd
  driver = passwd-file
}
passdb {
  args = /etc/dovecot/dovecot-ldap.conf
  default_fields = userdb_imapc_user=%u userdb_imapc_password=%w
  driver = ldap
}
protocols = imap
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = _postfix
    mode = 0660
    user = _postfix
  }
  user = root
}
service imap-login {
  chroot = login
}
service pop3-login {
  chroot = login
}
ssl = no
ssl_ca = /etc/ssl/ca.crt
ssl_cert = /etc/ssl/pf/mail.example.com.crt
ssl_key = /etc/ssl/pf/mail.example.comkey
userdb {
  args = username_format=%n /etc/dovecot/passwd
  driver = passwd
}
userdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
 
# dovecot-ldap.conf
hosts = 10.0.0.2:389
dn = cn=ldapaccess,o=servercontext
dnpass = secretpass
auth_bind = yes
ldap_version = 3
base = o=usercontext
user_attrs = homeDirectory=home,uidNumber=uid,gidNumber=gid
user_filter = 
(((objectClass=Person)(cn=%u))(groupMembership=cn=SMTPsender,o=permissiongroups))
pass_attrs = cn=user,userPassword=password
pass_filter = 
(((objectClass=Person)(cn=%u))(groupMembership=cn=SMTPsender,o=permissiongroups))
 
 
Thanks in advance!
 
Best regards


[Dovecot] Couldn't drop privileges

2013-08-15 Thread LuKreme
attempts to login result in:

dovecot: imap-login: Login: user=lists@*munged*, method=PLAIN, 
rip=ip.xx.yy.zz, lip=75.148.117.91, mpid=75104, TLS, session=cBjCqf/jdwAXGJaN
dovecot: imap(lists@*munged*): Error: user lists@*munged*: Couldn't drop 
privileges: User is missing UID (see mail_uid setting)
dovecot: imap(lists@*munged*): Error: Internal error occurred. Refer to server 
log for more information.

Local (shell) user authentication works fine. It looks to me like the 
authentication is working based on the first line, so I don't think the issue 
is in the dovecot-sql.conf.ext

$ cat dovecot-sql.conf.ext
driver =  mysql
connect = host=localhost dbname=postfix user=dovecot password=dovecot
default_pass_scheme = MD5-CRYPT
password_query = select password from mailbox where username ='%u'
user_query = select maildir from mailbox where username = '%u'

# home is set in userdb static, kept for history
#user_query = select concat('/usr/local/virtual/', maildir) from mailbox where 
username = '%u'
#user_query = select concat('/usr/local/virtual/', maildir), 'vpopmail' as uid, 
'postfix' as gid, from mailbox where username = '%u'

#iterate_query = SELECT username AS user FROM users


# 2.2.5: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 9.1-RELEASE i386  
auth_mechanisms = plain login
disable_plaintext_auth = no
mail_location = maildir:~/Maildir
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy 
include variables body enotify environment mailbox date ihave
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
auto = subscribe
special_use = \Junk
  }
  mailbox NotJunk {
auto = subscribe
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox Sent Messages {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  prefix = 
}
passdb {
  driver = pam
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
ssl_cert = /etc/ssl/certs/dovecot.pem
ssl_key = /etc/ssl/private/dovecot.pem
userdb {
  driver = passwd
}
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
userdb {
  args = uid=vpopmail gid=postfix home=/usr/local/virtual/%u
  driver = static
}

I have also tried:

userdb {
  args = uid=vpopmail gid=postfix
  driver = static
}

sql users all have their mail in

/usr/local/virtual/lists@*munged*

$ ls -lsd /usr/local/virtual/lists\@*munged* 
8 drwxr-xr-x  12 vpopmail  postfix  512 Aug 14 21:40 
/usr/local/virtual/lists\@*munged*

[New thread because the old one's original issue is solved]

-- 
BUGS: There is no conversion specification for the phase of the moon.
strftime(3) man page



Re: [Dovecot] Sieve-storage: couldn't find storage root directory

2013-08-15 Thread Asai
For some reason, this error has disappeared.  Maybe I forgot to restart 
Dovecot or something after I changed the config.


--Asai

On 8/12/13 11:56 AM, Timo Sirainen wrote:

On 12.8.2013, at 18.16, Asai a...@globalchangemusic.org wrote:


Using Dovecot 2.2.4.  In my DSync logs, I'm getting the error message:

Error: sieve-storage: couldn't find storage root directory; sieve_dir was left 
unconfigured and autodetection failed

What/how/where are you dsyncing?


However, I have the following configuration set:

plugin {
  sieve = /vmail/%d/%n/sievescript
  sieve_dir = /vmail/%d/%n/
}

Maybe the other side of dsync doesn't have it?





Re: [Dovecot] Couldn't drop privileges

2013-08-15 Thread LuKreme

On 15 Aug 2013, at 11:29 , LuKreme krem...@kreme.com wrote:

 attempts to login result in:
 
 dovecot: imap-login: Login: user=lists@*munged*, method=PLAIN, 
 rip=ip.xx.yy.zz, lip=75.148.117.91, mpid=75104, TLS, 
 session=cBjCqf/jdwAXGJaN
 dovecot: imap(lists@*munged*): Error: user lists@*munged*: Couldn't drop 
 privileges: User is missing UID (see mail_uid setting)
 dovecot: imap(lists@*munged*): Error: Internal error occurred. Refer to 
 server log for more information.

Turned on the debug and this is what I see:

Aug 15 13:16:45 auth-worker(77340): Debug: sql(lists@*munged*,ip.xx.yy.zz): 
query: select password from mailbox where username ='lists@*munged*'
Aug 15 13:16:45 auth: Debug: client passdb out: OK  1   
user=lists@*munged*
Aug 15 13:16:45 auth: Debug: master in: REQUEST 2891186177  77374   1   
a2bde9e07ec4034dff654566596e062fsession_pid=77375
Aug 15 13:16:45 auth-worker(77340): Debug: passwd(lists@*munged*,ip.xx.yy.zz): 
lookup
Aug 15 13:16:45 auth-worker(77340): Info: passwd(lists@*munged*,ip.xx.yy.zz): 
unknown user
Aug 15 13:16:45 auth-worker(77340): Debug: sql(lists@*munged*,ip.xx.yy.zz): 
select maildir from mailbox where username = 'lists@*munged*'
Aug 15 13:16:45 auth: Debug: master userdb out: USER2891186177  
lists@*munged*  maildir=lists@*munged*/ 
auth_token=8016448b78ce6682d24f056ad695b2158bac7ee2
Aug 15 13:16:45 imap-login: Info: Login: user=lists@*munged*, method=PLAIN, 
rip=ip.xx.yy.zz, lip=75.148.117.91, mpid=77375, TLS, session=1hadUAHk7AAXGJaN
Aug 15 13:16:45 imap(lists@*munged*): Error: user lists@*munged*: Couldn't drop 
privileges: User is missing UID (see mail_uid setting)
Aug 15 13:16:45 imap(lists@*munged*): Error: Internal error occurred. Refer to 
server log for more information.

a successful userdb for a local user looks like this:

Aug 15 13:16:44 auth: Debug: client passdb out: OK  1   user=kremels
Aug 15 13:16:44 auth: Debug: master in: REQUEST 3532521473  77365   1   
4ebb0de2b83c3e2603bc3e3ffca59d73session_pid=77370
Aug 15 13:16:44 auth-worker(77340): Debug: passwd(kremels,ip.xx.yy.zz): lookup
Aug 15 13:16:44 auth: Debug: master userdb out: USER3532521473  kremels 
system_groups_user=kremels  uid=1004gid=1004
home=/home/kremels  auth_token=60c1bb537e93229108f3aeceff78bfad811f5b62
Aug 15 13:16:44 imap-login: Info: Login: user=kremels, method=PLAIN, 
rip=ip.xx.yy.zz, lip=75.148.117.91, mpid=77370, TLS, session=Pp6LUAHk6QAXGJaN
Aug 15 13:16:44 auth: Debug: client in: AUTH1   PLAIN   service=imap
secured session=VLKQUAHk6gAXGJaNlip=75.148.117.91   rip=ip.xx.yy.zz 
lport=993   rport=55018 resp=hidden

What is not shown is the full path to the maildir, just the maildir value 
returned from the sql query. It really really looks like this should be working 
and like the 

userdb {
  driver = static
  args = uid=vpopmail gid=postfix home=/usr/local/virtual/%u
}

block is just not having the desired effect.

I've been at this for the better part of two days now, and have read hundreds 
(if not thousands) of web pages. I don't know what I am missing.

-- 
Belief is one of the most powerful organic forces in the multiverse. It
may not be able to move mountains, exactly. But it can create someone
who can.



Re: [Dovecot] Couldn't drop privileges

2013-08-15 Thread LuKreme

On 15 Aug 2013, at 13:26 , LuKreme krem...@kreme.com wrote:

 What is not shown is the full path to the maildir, just the maildir value 
 returned from the sql query. It really really looks like this should be 
 working and like the 
 
 userdb {
  driver = static
  args = uid=vpopmail gid=postfix home=/usr/local/virtual/%u
 }
 
 block is just not having the desired effect.

Progress (I know you are all reading this with bated breath in eager 
anticipation of my next missive).

I changed the user_query to 

select 89 as uid, 125 as gid, concat('/usr/local/virtual/', maildir) from 
mailbox where username = '%u'

and got a new error, which I think reveals the source of the problem:

Error: user lists@*munged*: Mail access for users with UID 89 not permitted 
(see first_valid_uid in config file, uid from userdb lookup).

So, I set first_valid_uid = 89 and I get a NEW error.

Aug 15 13:34:05 auth: Debug: master userdb out: USER4078043137  
lists@*munged*  uid=89  gid=125 concat('/usr/local/virtual/', 
maildir)=/usr/local/virtual/lists@*munged*/   
auth_token=2cb95ca06efdab697854015a93d7c3b0001b417b
Aug 15 13:34:05 imap-login: Info: Login: user=lists@*munged*, method=PLAIN, 
rip=ip.xx.yy.zz, lip=75.148.117.91, mpid=77996, TLS, session=mhyXjgHkdAAXGJaN
Aug 15 13:34:05 imap(lists@*munged*): Error: user lists@*munged*: 
Initialization failed: Namespace '': Home directory not set for user. Can't 
expand ~/ for mail root dir in: ~/Maildir
Aug 15 13:34:05 imap(lists@*munged*): Error: Invalid user settings. Refer to 
server log for more information.

So, the uid and gid are now correct, the maildir path is correct, and it is 
STILL not happy.

-- 
Stupid men are often capable of things the clever would not dare to
contemplate... --Feet of Clay



Re: [Dovecot] Error: dict client sent broken reply

2013-08-15 Thread Gedalya

On 08/05/2013 01:54 PM, Timo Sirainen wrote:

There are a few fixes in lib-dict since v2.1.12. Also v2.2 has one more fix, 
which I just added to v2.1 hg. Would be helpful to know if one of those fixes 
the problem before I spend a lot of time testing this..
Timo, can you provide any hints on how to reproduce this? I just got 
this error for yesterday's cron job, but not for today. So I'd like to 
try upgrading to the latest 2.1 hg, but I'm looking for a test procedure.

The only line in my log is:
dovecot: dict: Error: dict client: COMMIT: Can't commit while iterating



Re: [Dovecot] Error: dict client sent broken reply

2013-08-15 Thread Timo Sirainen
On 15.8.2013, at 22.58, Gedalya geda...@gedalya.net wrote:

 On 08/05/2013 01:54 PM, Timo Sirainen wrote:
 There are a few fixes in lib-dict since v2.1.12. Also v2.2 has one more fix, 
 which I just added to v2.1 hg. Would be helpful to know if one of those 
 fixes the problem before I spend a lot of time testing this..
 Timo, can you provide any hints on how to reproduce this? I just got this 
 error for yesterday's cron job, but not for today. So I'd like to try 
 upgrading to the latest 2.1 hg, but I'm looking for a test procedure.
 The only line in my log is:
 dovecot: dict: Error: dict client: COMMIT: Can't commit while iterating

That's what I was hoping someone would tell me :)



Re: [Dovecot] Couldn't drop privileges

2013-08-15 Thread Timo Sirainen
On 15.8.2013, at 22.38, LuKreme krem...@kreme.com wrote:

 select 89 as uid, 125 as gid, concat('/usr/local/virtual/', maildir) from 
 mailbox where username = '%u'

concat('/usr/local/virtual/', maildir) as home from ..

 Aug 15 13:34:05 imap(lists@*munged*): Error: user lists@*munged*: 
 Initialization failed: Namespace '': Home directory not set for user. Can't 
 expand ~/ for mail root dir in: ~/Maildir



[Dovecot] lda and home directory

2013-08-15 Thread Bob Miller
Hello,

I am using qmail and lda configured such that lda should not have to do
a lookup for delivery.  I set my defaultdelivery like so:

|HOME=/home/mail/$USER /var/qmail/bin/preline
-f /usr/local/libexec/dovecot/dovecot-lda

Given that the email address being delivered to is
bob.mil...@computerisms.com, I expect $USER to be equal to bob.miller
and $HOME to expand to /home/mail/bob.miller/.  

The problem is lda reports:

Debug:_Home_dir_not_found:_/home/mail/bob.mil...@computerisms.com/

The whole system up to here uses only the bob.miller part, and I can't
find where it keeps adding the domain part from.

I have tried changing all sorts of variables and config values to try
and make it quit adding the domain part, but no matter what I change lda
still tries to deliver the email address as username.  The only measure
of success I can report is that in some configurations mail delivers
to /home/mail//.

Where exactly is dovecot getting this value?

Side question: I note in places throughout the wiki and internet
variables such as $EXT, $USER, $DEST_USERNAME, and $FROM_ENVELOPE are
used.  I can find no documentation, beyond my own common sense anyway,
to explain how/when these variables are expanded, and what I do find
doesn't seem consistent to me.  For example, on the CheckPassword page,
$USER is implied to expand to Username, which could contain the domain
or not.  However on the lda/qmail page, the variable shown is $EXT@
$USER, which implies $USER will expand as only the domain part after the
@ symbol and $EXT as everything before, yet changing the variable from
$USER to $EXT in my defaultdelivery file has $HOME expand
to /home/mail//.  Where do I find the story on how these variables (as
opposed to the % variables) work?  (or more specifically, is there a
$VAR I can use instead of $USER that will expand to just the part before
the @?)

-- 
Computerisms
Bob Miller  
867-334-7117 / 867-633-3760
http://computerisms.ca





Re: [Dovecot] IMAP Proxying and SSL Certificates on OpenBSD

2013-08-15 Thread Timo Sirainen
On 15.8.2013, at 20.23, d...@quantentunnel.de wrote:

 dovecot: imap(username): Error: user username: Initialization failed: 
 Initializing mail storage from mail_location setting failed: imapc: missing 
 imapc_password
..
 passdb {
   args = /etc/dovecot/dovecot-ldap.conf
   default_fields = userdb_imapc_user=%u userdb_imapc_password=%w
   driver = ldap
 }

Here you are setting the userdb_* fields, which work only with userdb prefetch.

 userdb {
   args = username_format=%n /etc/dovecot/passwd
   driver = passwd
 }
 userdb {
   args = /etc/dovecot/dovecot-ldap.conf
   driver = ldap
 }

But you're not using userdb prefetch.



Re: [Dovecot] Error: dict client sent broken reply

2013-08-15 Thread Gedalya

On 08/15/2013 04:00 PM, Timo Sirainen wrote:

On 15.8.2013, at 22.58, Gedalya geda...@gedalya.net wrote:


On 08/05/2013 01:54 PM, Timo Sirainen wrote:

There are a few fixes in lib-dict since v2.1.12. Also v2.2 has one more fix, 
which I just added to v2.1 hg. Would be helpful to know if one of those fixes 
the problem before I spend a lot of time testing this..

Timo, can you provide any hints on how to reproduce this? I just got this error 
for yesterday's cron job, but not for today. So I'd like to try upgrading to 
the latest 2.1 hg, but I'm looking for a test procedure.
The only line in my log is:
dovecot: dict: Error: dict client: COMMIT: Can't commit while iterating

That's what I was hoping someone would tell me :)



OK so I'll just go through the commits and try to figure it out. Let's 
assume the error will come back sporadically so if it just goes away 
after upgrading, no other action taken, then we'll kind of have an answer.




Re: [Dovecot] lda and home directory

2013-08-15 Thread Rick Romero

 Quoting Bob Miller b...@computerisms.ca:


Hello,

I am using qmail and lda configured such that lda should not have to do
a lookup for delivery.  I set my defaultdelivery like so:

|HOME=/home/mail/$USER /var/qmail/bin/preline
-f /usr/local/libexec/dovecot/dovecot-lda

Given that the email address being delivered to is
bob.mil...@computerisms.com, I expect $USER to be equal to bob.miller
and $HOME to expand to /home/mail/bob.miller/.

The problem is lda reports:

Debug:_Home_dir_not_found:_/home/mail/bob.mil...@computerisms.com/

The whole system up to here uses only the bob.miller part, and I can't
find where it keeps adding the domain part from.

I have tried changing all sorts of variables and config values to try
and make it quit adding the domain part, but no matter what I change lda
still tries to deliver the email address as username.  The only measure
of success I can report is that in some configurations mail delivers
to /home/mail//.

Where exactly is dovecot getting this value?

Side question: I note in places throughout the wiki and internet
variables such as $EXT, $USER, $DEST_USERNAME, and $FROM_ENVELOPE are
used.  I can find no documentation, beyond my own common sense anyway,
to explain how/when these variables are expanded, and what I do find
doesn't seem consistent to me.  For example, on the CheckPassword page,
$USER is implied to expand to Username, which could contain the domain
or not.  However on the lda/qmail page, the variable shown is $EXT@
$USER, which implies $USER will expand as only the domain part after the
@ symbol and $EXT as everything before, yet changing the variable from
$USER to $EXT in my defaultdelivery file has $HOME expand
to /home/mail//.  Where do I find the story on how these variables (as
opposed to the % variables) work?  (or more specifically, is there a
$VAR I can use instead of $USER that will expand to just the part before
the @?)

--
Computerisms
Bob Miller
867-334-7117 / 867-633-3760http://computerisms.ca


Hi Bob,

I had/have the same issue.   In Dovecot 1.x I was able to use LDA with
vpopmail and only environment variables to deliver to a home directory.  I
was never able to get it to work with Dovecot 2.x - don't know if using
environment variables is depricated, but I ended up having to setup an auth
server to use lda with qmail/vpopmail.  :(

For your environment variable questions, those come from Qmail.  See:
http://www.lifewithqmail.org/lwq.html#environment-variables

Rick


Re: [Dovecot] Couldn't drop privileges

2013-08-15 Thread LuKreme

On 15 Aug 2013, at 13:38 , LuKreme krem...@kreme.com wrote:

 select 89 as uid, 125 as gid, concat('/usr/local/virtual/', maildir) from 
 mailbox where username = '%u'

user_query = select 89 as uid, 125 as gid, '/usr/local/virtual/' as home, 
concat('/usr/local/virtual/', maildir) from mailbox where username = '%u'

and it has stopped complaining.

However, when I login to any virtual account, there is no mail shown.

Any other debug flags I can turn on?

do I have to build home to match maildir? And if so, how?

-- 
If you must choose between two evils, pick the one you've never tried
before.



Re: [Dovecot] Couldn't drop privileges

2013-08-15 Thread LuKreme

On 15 Aug 2013, at 14:18 , LuKreme krem...@kreme.com wrote:

 user_query = select 89 as uid, 125 as gid, '/usr/local/virtual/' as home, 
 concat('/usr/local/virtual/', maildir) from mailbox where username = '%u'

user_query = select 89 as uid, 125 as gid, concat('/usr/local/virtual/', 
maildir) as home from mailbox where username = '%u'

doesn't complain either (thanks Timo, that makes more sense) but still having 
issues with blank mailboxes on the virtual users.

-- 
I don't have a solution but I admire the problem.



Re: [Dovecot] Couldn't drop privileges

2013-08-15 Thread LuKreme

On 15 Aug 2013, at 14:28 , LuKreme krem...@kreme.com wrote:

 but still having issues with blank mailboxes on the virtual users.

OK, I am having blank mailboxes because dovecot is adding Maildir to the home 
for the virtual users:

Debug: maildir++: root=/usr/local/virtual/lists@*munged*//Maildir,

The correct directory should be without the Maildir

(and yes, the double slash is there in the log)

/home/user/Maildir, otoh, is correct.

Should I simply mkdir a Maildir for every user and move everything into it?

-- 
They all have husbands and wives and children and houses and dogs, and
you know, they've all made themselves a part of something and they can
talk about what they do. What am I gonna say? I killed the president of
Paraguay with a fork. How've you been?



Re: [Dovecot] IMAP Proxying and SSL Certificates on OpenBSD

2013-08-15 Thread dago
Thank you..
 
Sorry, seem to have missed that ... It's working now. Still any ideas on the 
SSL thing? 
 
STARTLS is not available and dovecot is not listening on 993. There is no info 
in the logs, even with verbose_ssl ... Certificates are working in postfix ...
 
Thanks in advance!
 
Best regards
 

Gesendet: Donnerstag, 15. August 2013 um 22:05 Uhr
Von: Timo Sirainen t...@iki.fi
An: Dovecot Mailing List dovecot@dovecot.org
Betreff: Re: [Dovecot] IMAP Proxying and SSL Certificates on OpenBSD
On 15.8.2013, at 20.23, d...@quantentunnel.de wrote:

 dovecot: imap(username): Error: user username: Initialization failed: 
 Initializing mail storage from mail_location setting failed: imapc: missing 
 imapc_password
..
 passdb {
 args = /etc/dovecot/dovecot-ldap.conf
 default_fields = userdb_imapc_user=%u userdb_imapc_password=%w
 driver = ldap
 }

Here you are setting the userdb_* fields, which work only with userdb prefetch.

 userdb {
 args = username_format=%n /etc/dovecot/passwd
 driver = passwd
 }
 userdb {
 args = /etc/dovecot/dovecot-ldap.conf
 driver = ldap
 }

But you're not using userdb prefetch.
 
 
 


Re: [Dovecot] IMAP Proxying and SSL Certificates on OpenBSD

2013-08-15 Thread Reindl Harald

Am 15.08.2013 23:43, schrieb d...@quantentunnel.de:

 Sorry, seem to have missed that ... It's working now. Still any ideas on the 
 SSL thing? 
  
 STARTLS is not available and dovecot

have you configured ssl?

 is not listening on 993

has nothiung to do with STARTTLS

 There is no info in the logs, even with verbose_ssl ... 

again: have you configureed it and if why not show how?

[root@testserver:~]$ cat /etc/dovecot/dovecot.conf | grep ssl
# configure ssl
ssl= yes
ssl_cert   = /etc/postfix/certs/localhost.pem
ssl_key= /etc/postfix/certs/localhost.pem
ssl_cipher_list=
EECDH+AES:EDH+AES:-SHA1:EECDH+RC4:EDH+RC4:RC4-SHA:EECDH+AES256:EDH+AES256:AES256-SHA:HIGH:!aNULL:!eNULL:!EXP:!MD5:!LOW:!MEDIUM:!SSLv2
verbose_ssl= no

 Certificates are working in postfix ...

has *nothing* to do with dovecot





signature.asc
Description: OpenPGP digital signature


Re: [Dovecot] Couldn't drop privileges

2013-08-15 Thread LuKreme

On 15 Aug 2013, at 14:37 , LuKreme krem...@kreme.com wrote:

 /home/user/Maildir, otoh, is correct.
 
 Should I simply mkdir a Maildir for every user and move everything into it?

While that works, of course new mail uses the path from the sql database and 
puts mail into

/usr/local/virtual/u...@example.com/new


-- 
Alas, earwax.



[Dovecot] dovecot solr position index

2013-08-15 Thread duonut
Hi
I am currently running dovecot 2.2.5 and solr 4.4.0

I am using the pre supplied schema.xml with dovecot with a single change f
field type from test to text_general to get it running. 

When I do a multi word search in a mailbox, solr complains that a position
index has not been built, throws a 500 error and dovecot reverts back to
searching each mail message.

Does anyone know what change I need to make to the solr schema to build the
position index?



--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/dovecot-solr-position-index-tp43897.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: [Dovecot] lda and home directory

2013-08-15 Thread Bob Miller
Hi Rick,

 I had/have the same issue.   In Dovecot 1.x I was able to use LDA with
 vpopmail and only environment variables to deliver to a home directory.  I
 was never able to get it to work with Dovecot 2.x - don't know if using
 environment variables is depricated, but I ended up having to setup an auth
 server to use lda with qmail/vpopmail.  :(

My hosting server uses vpopmail and lda, and I don't recall having to do
that.  If you want to compare configs, let me know.  

In this case, I authenticate against samba active directory, and a
(seemingly) small config change there led me on an epic quest of
configuration updates through the whole email system until I got stuck
in this lda box that didn't even have a problem in it.  sigh.  I was
doing so well

But you showed me the outside of the box:

 For your environment variable questions, those come from Qmail.  See:
 http://www.lifewithqmail.org/lwq.html#environment-variables

It's stunningly obvious now that you point it out.  S obvious, in
fact, I probably would have been weeks figuring it out.  Thank you so
much...

change my defaultdelivery to:

|HOME=/home/mail/$LOCAL /var/qmail/bin/preline
-f /usr/local/libexec/dovecot/dovecot-lda

and lda looks for the correct directory again.

I guess environment variables are not deprecated, presumably that's good
news?




[Dovecot] Maildirmake equiv?

2013-08-15 Thread LuKreme
Since I am using dovecot I do not have courier installed, but Courier had a 
very handy tool for making maildir folders called `maildirmake` which I used in 
some automated backup scripts. How do I duplicate maildirmake in dovecot?

for example:

#!/bin/bash
# v1.2a Testing for new dovecot install

# Archive mail from folders without [0-9]{4} Maildirs
# after they are 21 days old to a yearly folder

MDIR=$HOME/Maildir
MDM=/usr/local/bin/maildirmake
YEAR=`/usr/local/bin/gdate -d last month '+%Y'`
echo The Year is $YEAR...

OIFS=$IFS
IFS=


for I in `find $MDIR -maxdepth 1 -mindepth 1 -type d| egrep -v 
[0-9][0-9][0-9][0-9]`; do
  MYDIR=${I}
  TBASE=`basename $MYDIR`
  # if [ ! $TBASE == Maildir ]; then
TDIR=`dirname $MYDIR`
TARGET=${TDIR}/.zz${TBASE}.${YEAR}
# echo $MYDIR $TARGET
if [ -d $MYDIR/cur ]; then
  echo -n Processing ${MYDIR} = ${TARGET}...
  if [ ! -d ${TARGET} ]; then
echo 
echo -n WARNING ${TARGET} does not exist. invoking $MDM ${TARGET}...
$MDM ${TARGET}
  fi
  if [ -d ${TARGET} ]; then
# echo $TARGET does exist, moving files
find ${MYDIR}/cur -type f -ctime +21 -exec mv {} ${TARGET}/cur/ \;
echo done.
  else
echo $TARGET does not exist
  fi
fi
  # fi
done

IFS=$OIFS

-- 
Forever was over. All the sands had fallen. The great race between
entropy and energy had been run, and the favourite had been the winner
after all.  Perhaps he ought to sharpen the blade again?  No.  Not much
point, really.