Re: [Dovecot] doveadm user -f index

2012-04-03 Thread Timo Sirainen
http://hg.dovecot.org/dovecot-2.1/rev/601014feade4

doveadm user -m -f home user@domain

I'm still not sure if I implemented this the user friendliest way.. It's kind 
of annoying to have these existing "doveadm auth" and "doveadm user" commands. 
Perhaps "doveadm user -m" should have been the default, with some added fields, 
and then the current "doveadm user" would have been as an added option. Hm. 
Maybe I should change it to v2.2..

On 23.3.2012, at 18.25, Micah Anderson wrote:

> 
> I've configured my mail_location to have a different location for
> performance reasons so they aren't in the same location as the
> mail_location.
> 
> The 'doveadm user -f home' is useful to find where a user's home
> directory is for various scripting purposes, but I can't seem to find a
> way to determine the location of the user's indexes. 
> 
> I can do something with the output of dovecot -a to find the
> mail_location and then look for a configured INDEX, but then I don't
> have a good way of translating the %d/%1n/%n type string formatters into
> their values for a user.
> 
> thanks for any suggestions!
> micah
> 
> -- 
> 
> 



Re: [Dovecot] Dovecot and scalable database storage

2012-04-03 Thread Timo Sirainen
On 23.3.2012, at 4.36,   wrote:

> I saw some interesting mails from TImo back in 2009 talking about the idea
> of using something like Cassandra db or similar as a storage platform for
> both email and index/logs.  I was wondering if this has been discussed
> since then, and if there are any plans to support something like this in
> the future?  I have been playing with Cassandra and found that their
> RackAwareStrategy gives you the ability to replicate writes to as many
> nodes as you would like, but more importantly what nodes and one of those
> nodes could be defined by what rack it lives in or what data center it
> lives in.  This means multiple sites high available storage clusters,
> seemingly a system that dovecot could benefit from in terms of performance
> and redundancy and simplicity.  Any takers?

There are still plans, but not in near future. I'm still planning on 
implementing it by first making Dovecot's code simpler and more asynchronous, 
and then the key-value database support could be implemented in just a few 
hours.



Re: [Dovecot] Dovecot 2.1 with custom OpenSSL fails to build

2012-04-03 Thread Timo Sirainen

On 03/15/2012 11:43 PM, Andreas M. Kirchwitz wrote:

Compilation works. Great! The binaries find all their libraries.

But two libraries are not quite okay. They don't find their SSL libs:

libdovecot-lda.so
libdovecot-storage.so

Since libdovecot-lda.so doesn't contain the words libssl or libcrypto,
I guess that ldd just complains because it uses libdovecot-storage.so.
Thus, libdovecot-storage.so is the (only) one left with an incomplete
library search path.

Luckily, all binaries use some additional libraries which come with
a proper library path. So the whole things works, but it's more like
some kind of magic. It would be great if libdovecot-storage.so could
be fixed as well to make things finally perfect.


Maybe this fixes it?

http://hg.dovecot.org/dovecot-2.1/rev/8b91367bc3e1


Re: [Dovecot] ldap userdb warning in v2.1.1

2012-04-03 Thread Timo Sirainen
On 21.3.2012, at 14.06, Timo Sirainen wrote:

> On 21.3.2012, at 11.00, Nikolaos Milas wrote:
> 
>> Mar 21 10:07:23 imapserver dovecot: master: Dovecot v2.1.1 starting up (core 
>> dumps disabled)
>> Mar 21 10:08:17 imapserverdovecot: auth: Warning: ldap: Ignoring changed 
>> user_attrs in /etc/dovecot/dovecot-passdb-ldap.conf, because userdb ldap not 
>> used. (If this is intentional, set userdb_warning_disable=yes)
>> 
>> I didn't see such warnings in 2.0.13.
>> 
>> I guess I should/could remove the "user_attrs" line from 
>> dovecot-passdb-ldap.conf because it's not needed?
> 
> Hmm. Yes, if dovecot-usrdb-ldap.conf is a separate file from 
> dovecot-passdb-ldap.conf you can just remove it. But this reminds me that in 
> several places I've suggested to make one of them a symlink to the other, and 
> you can't really do it then. Perhaps I'll need to remove this warning, or 
> maybe make it recognize the symlink case.

Removed, at least for now: http://hg.dovecot.org/dovecot-2.1/rev/324df4134049



Re: [Dovecot] Courier to Dovecot migration script issue

2012-04-03 Thread Timo Sirainen
On 3.4.2012, at 15.33, xnasx wrote:

> I trying to migrate to Dovecot 2.0.18 from Courier 4.10. 
> I using a script 'courier-dovecot-migrate.pl' from oficial wiki - it works 
> without errors and creating dovecot-uidlist, etc. .
> 
> I running Dovecot on a different port: 11149.
> When I connecting to port 11149 from Thunderbird, all my message headers are 
> reloading.
> 
> Please help me to solve this issue.

telnet localhost 143
a login user pass
b select inbox
c status inbox (uidvalidity)
d fetch 1:* uid

telnet localhost 11149
a login user pass
b select inbox
c status inbox (uidvalidity)
d fetch 1:* uid

Check if the "c" and "d" outputs are the same for both servers. If they are, 
then the migration was successful and the problem is something else, such as 
maybe the client always redownloading messages because you changed the port (or 
something else).

Re: [Dovecot] dovecot 2.0.19 Panic: file mail-index-sync-ext.c: line 209 (sync_ext_reorder): assertion failed: (offset < (uint16_t)-1)

2012-04-03 Thread Timo Sirainen
On 21.3.2012, at 20.19, Jim Lawson wrote:

> On 3/21/12 10:02 AM, Timo Sirainen wrote:
>> On 21.3.2012, at 15.53, Jim Lawson wrote:
>> 
>>> Had a user who couldn't access his INBOX:
>>> 
 Mar 21 09:21:17 penguina dovecot: imap([USER]): Panic: file
 mail-index-sync-ext.c: line 209 (sync_ext_reorder): assertion fai
 led: (offset < (uint16_t)-1)
>> I kind of remember that this was fixed by 
>> http://hg.dovecot.org/dovecot-2.1/rev/b4d8e950eb9d but I'm not entirely 
>> sure. I guess I should have included in the commit the error message it 
>> fixed.
> 
> 
> This applies cleanly against 2.0.19; should I try it on that version, or
> not recommended?

http://hg.dovecot.org/dovecot-2.1/rev/47526bf86c57 should fix this.



Re: [Dovecot] dovecot-auth restaring and caching

2012-04-03 Thread Timo Sirainen
On 23.3.2012, at 14.15, Angel L. Mateo wrote:

> El 22/03/12 19:57, Timo Sirainen escribió:
>> On 22.3.2012, at 11.55, Angel L. Mateo wrote:
>> 
>>> The problem I'm having is that if I have no activity in the server, 
>>> dovecot stops its auth process and when another message is received, it 
>>> restarted it, but with an empty cache.
>> 
>> service auth {
>>   idle_kill = 0
>> }
>> 
> 
>   In a test server I have, this have solved the problem. In my 
> productions servers it is still being restarted. Could it be another 
> parameter involve in this?

Oops, I remembered wrong. idle_kill=0 uses default_idle_kill limit. You could 
set for example:

idle_kill = 4294967295s



Re: [Dovecot] lmtp sometimes fails to deliver a message to all recipients

2012-04-03 Thread Timo Sirainen
On 2.4.2012, at 18.45, Artur Zaprzała wrote:

> Running strace on lmtp reveals that when lmtp delivers a message to multiple 
> recipients it saves the message to a file in the first mailbox and hard links 
> that file to other mailboxes. But when in the meantime of delivery that file 
> is deleted, lmtp fails to deliver the message to remaining mailboxes. For 
> example a message for 46 recipients is delivered by lmtp to the first 12 only 
> (fortunately postfix retries delivery for remaining recipients) and for the 
> rest lmtp logs the following error messages:
> 
> lmtp(3344, foo@domain): Error: RU1WMnueeU9QDQABxjIODQ: sieve: 
> msgid=unspecified: failed to store into mailbox 'INBOX': Message was expunged 
> (guid)
> lmtp(3344, foo@domain): Error: RU1WMnueeU9QDQABxjIODQ: sieve: script 
> /vmail/domain/foo/.dovecot.sieve failed with unsuccessful implicit keep (user 
> logfile /vmail/domain/foo/.dovecot.sieve.log may reveal additional details)

Fixed in hg.



Re: [Dovecot] imapsync, namespaces and Dovecot 2.x

2012-04-03 Thread Timo Sirainen
On 2.4.2012, at 19.11, Aleix Dorca wrote:

> I recently tried to migrate from Exchange using imapsync. It didn't work 
> because it complained that dovecot had no namespace capablity. After looking 
> through Dovecot's config files I found that namespaces could be defined, but 
> if you did not a 'private' default one was created.

The problem is that Dovecot doesn't advertise NAMESPACE capability before 
client has logged in. The better solution would be to change imapsync to figure 
this out automatically. The other solution would be to set in Dovecot:

imap_capability = +NAMESPACE



Re: [Dovecot] namespace hierarchy

2012-04-03 Thread Timo Sirainen
On 1.4.2012, at 10.28, Tom Fernandes wrote:

> I'm  migrating from Courier to Dovecot and would like to keep the original 
> namespace and add two new ones on the new server.
> 
> There's only one namespace in Courier which is "INBOX." . The seperator is "."
> 
> In the new server I would like to have 3 namespaces (private, public, shared) 
> and use "/" as separator. Is it possible to keep "INBOX." for private, so 
> that 
> the users mailboxes appear below the Inbox, but have public and shared on the 
> same hierarchy-level like the Inbox?
> 
> When I set prefix to "INBOX/" for private I get the users mailboxes below the 
> Inbox, like I have it Courier now. But then at least the public, probably 
> also 
> the shared namespace doesn't work any more. I get "unknown subscription 
> namespace" when trying to subscribe to some of the folders.

If you have any subscriptions=no namespaces, you need a parent namespace that 
has subscriptions=yes. You could have e.g.:

namespace {
  prefix = INBOX/
  list = no
  inbox = yes
}
namespace {
  prefix =
  list = no
  hidden = yes
  alias_for = INBOX/
}

So now the prefix="" is used for the subscriptions but nothing else really.

Anyway, INBOX/ isn't the same as INBOX. so if any client configs are using 
INBOX. as namespace prefix then they don't work with INBOX/.

Re: [Dovecot] Dovecot allows creation of folders outside of a user's directory

2012-04-03 Thread Timo Sirainen
On 30.3.2012, at 14.37, Christoph Bußenius wrote:

> in our dovecot 2.0 setup with shared folders, users can make dovecot create 
> directories outside their mail directory.  Which is a bit scary imho.
> 
> The following command:
> 
> . create inbox.shared.abc123
> 
> or even
> 
> . create "inbox.shared.strange &ANY- characters"
> 
> -- even though it will fail with a "permission denied" error -- will create a 
> directory like "/mail/users/strange &ANY- characters".  That directory will 
> only contain a subdirectory "Maildir" and therein dovecot-acl-list.

Fixed: http://hg.dovecot.org/dovecot-2.0/rev/b15889b82258



Re: [Dovecot] File/folder permission issues in 2.1.3

2012-04-03 Thread Timo Sirainen
On 29.3.2012, at 13.24, Christian Rößner wrote:

> I figured out that Dovecot does not honer secondary groups with 
> auth/auth-worker (??), if doing LDAP/TLS stuff. I had to use file system acls 
> to add the user "vmail" to /etc/ssl/private and to the corresponding key file:

service auth {
  extra_groups = any groups you want auth process to have
}

Don't give secondary groups to any Dovecot related users.



Re: [Dovecot] Dovecot upgrade from 1.2.x to 2.0.x: roundcube/squirrelmail sent folder doesn't work any more

2012-04-03 Thread Timo Sirainen
On 29.3.2012, at 8.25, Gerhard Wiesinger wrote:

>>> 2.0.x: with Prefix ~/Mail
>>> A0003 LIST "" ~/Mail/sent
>>> A0003 OK List completed.:
>> 
> 
> mail_full_filesystem_access = yes
> mail_location = mbox:~:INBOX=/var/mail/%u

Yes, the problem happens only with mail_full_filesystem_access=yes. It already 
works in v2.1, so I don't think I'll bother looking into why it's not working 
in v2.0.



Re: [Dovecot] Many messages clustered around the same date.saved value

2012-04-03 Thread Timo Sirainen
On 29.3.2012, at 5.41, Joseph Tam wrote:

>> Ah, with mbox there isn't any usable fallback for date.saved.  If it's
>> not in dovecot.index.cache, the current time is used.
> 
> I'm a little confused as to why it needed a fallback.  In other words,
> why wasn't date.saved put into the index as soon as the IMAP operation
> copied it into "Trash"?
> 
> If this data isn't set at that time, when does it get instantiated?
> When I actually ask for it?


Well..:

 - date.saved is stored only in dovecot.index.cache file
 - if it doesn't exist and is requested, the current time is returned and it's 
added to the cache
 - when date.saved has already fetched once (so it already exists in 
dovecot.index.cache file), and mail is saved via LDA/IMAP then it gets added 
there immediately when saving
 - dovecot.index.cache has caching decisions, and some old/unused fields may 
get dropped from it once in a while
 - maybe due to some bugs or whatever, the fields or the entire cache may get 
dropped for some other reason

So it probably should have worked, but for some reason didn't.

It would be possible to store date.saved in dovecot.index file, like mdbox 
does, so cache decisions wouldn't matter. But probably too much trouble to be 
worth it, very few mbox installations care about it.

Re: [Dovecot] Is it possible to migrating mail to dovecot using imapc?

2012-04-03 Thread Timo Sirainen
On 30.3.2012, at 23.42, Dr Josef Karthauser wrote:

> % dsync -Dv -u j...@local.com -o imapc_host=mail.remoteimap.com -o 
> imapc_port=143 -o imapc_username=joe@ remoteimap.com -o 
> imapc_password='somepass' mirror imapc: > & /tmp/output
> 
> produced the following output.

> dsync(j...@email.com): Error: Mailbox INBOX changed its GUID 
> (f38c263a4919764f1b560100c516a7a4 -> c92f64f79f0d1ed01e6d5b314f04886c)

dsync + imapc requires indexes. So you need to use e.g. imapc:/tmp/dsync-imapc



Re: [Dovecot] dovecot 2.1 breaks FTS + pre-auth?

2012-04-03 Thread Timo Sirainen
On 31.3.2012, at 18.38, dm-list-email-dove...@scs.stanford.edu wrote:

> Hi.  I use dovecot in the simplest possible way, as an IMAP server in
> pre-auth mode over ssh or just locally over a unix-domain socket
> (e.g., with offlineimap, which runs much faster using dovecot for the
> local message store).  Ideally I would like to avoid running any extra
> daemons or setting up anything as root.  Until recently, this has
> worked fine by just setting the CONFIG_FILE environment variable to
> something in my home directory.

You can run Dovecot without root: http://wiki2.dovecot.org/HowTo/Rootless

> Full text search used to work just fine with this configuration, and
> still does on a machine I have running dovecot 2.0.13.  However, on
> the machine with 2.1, I get errors about /var/run/dovecot/index not
> existing.
> 
> $ printf "a select INBOX\nb search text xyzzy\nc logout\n" \
>| /usr/lib/dovecot/imap
> * PREAUTH [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE 
> IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT 
> CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC 
> ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE] Logged 
> in as dm
> imap(dm): Error: net_connect_unix(/var/run/dovecot/indexer) failed: No such 
> file or directory

I looked at the code and looks like there is no easy way to make it work the 
old way. The new way is the only way to make fts-lucene work reliably, and it's 
also better for fts-solr. And fts-squat is really on its way out to die.

Re: [Dovecot] 2.1.3: doveadm mailbox delete lost the -s option

2012-04-03 Thread Timo Sirainen
On 3.4.2012, at 1.34, Micah Anderson wrote:

> Looks like the recently added -s (for unsubscribing) option to doveadm
> mailbox delete went missing:
> 
> root@vireo# /usr/bin/doveadm mailbox delete -u micahtest -s restored
> delete: invalid option -- 's'
> doveadm mailbox delete [-u |-A] [-S ] [-s]  [...]
> 
> although the option still is shown as valid :)

Fixed: http://hg.dovecot.org/dovecot-2.1/rev/411344f9daf3



Re: [Dovecot] Backtrace on mdbox index

2012-04-03 Thread Timo Sirainen
On 2.4.2012, at 17.14, Francisco Wagner C. Freire wrote:

> I current using dovecot with mdbox and on one account i get this error:
> 
> doveadm(user@domain): Panic: file mail-index-sync-ext.c: line 209
> (sync_ext_reorder): assertion failed: (offset < (uint16_t)-1)

Fixed: http://hg.dovecot.org/dovecot-2.1/rev/47526bf86c57




Re: [Dovecot] dovecot and unison

2012-04-03 Thread dm-list-email-dovecot
At Mon, 02 Apr 2012 19:02:17 -0400,
FZiegler wrote:
> 
> I am successfully using dovecot purely as a personal local mail store on 
> my desktop. (There is only one account, and it's only ever accessed by 
> local mail clients on the machine. The point is to have a common store I 
> can use with any client; plus, I prefer dovecot's Mailbox storage to 
> Thunderbird's mboxes.)
> 
> Now I'd like if possible, to replicate this setup on my laptop and keep 
> both in sync with unison (http://www.cis.upenn.edu/~bcpierce/unison/), 
> which I am already using to sync much of my home dir about once a day.
> 
> I found at least one positive message regarding this topic 
> (http://dovecot.org/list/dovecot/2010-April/048092.html), but I feel I 
> could use some more advice.

I have a similar setup, but I use offlineimap instead of unison:

http://offlineimap.org/

It seems to work pretty well.  That's not to say that unison wouldn't
work as well also.  However, offlineimap has the advantage that it
doesn't restrict you to a star topology.  You can, for instance, since
to your laptop at work and from your laptop at home.

Note that offlineimap is slow if you don't use imap at both ends.
Therefore, I use it on the local end.  A simplified excerpt of my
.offlineimaprc looks like this:



[general]
accounts = DefaultAccount

[Account DefaultAccount]
localrepository = MyLocal
remoterepository = MyRemote

[Repository MyRemote]
type = IMAP
preauthtunnel = ssh -qax -oBatchMode=yes -oServerAliveInterval=60 
MY-MAIL-SERVER 'exec env CONFIG_FILE=/PATH/TO/PRIVATE/dovecot.conf 
/usr/lib/dovecot/imap'

[Repository MyLocal]
type = IMAP
preauthtunnel = CONFIG_FILE=$HOME/etc/dovecot.conf /usr/lib/dovecot/imap



Unfortunately, in dovecot 2.1, the full text search no longer seems to
work in pre-auth mode, but I don't think that has anything to do with
offlineimap.  I think maybe dovecot is deprecating pre-auth mode or
requires a more complicated setup.


Re: [Dovecot] Dovecot stones

2012-04-03 Thread David J. Weller-Fahy
* Mark Moseley  [2012-04-02 12:41 -0400]:
> On Sat, Mar 31, 2012 at 2:28 PM, Timo Sirainen  wrote:
> > For the last few days I've been thinking about my company and what
> >
> >...
> 
> I'm slightly concerned that there's been no mention of what license
> these stones are going to be released under. GPL2? GPL3? Apache? I'm
> just hoping these aren't some sort of "open core" stones that will
> only work for basic features but that I'll end up needing to buy
> "Enterprise-grade stones" to cover large clusters.

From the description and images, I'd say they are probably binary blobs
to be included in the firmware via hardware dongle. ;)

-- 
dave [ please don't CC me ]


pgpcVMgSr8F8b.pgp
Description: PGP signature


Re: [Dovecot] dovecot and unison

2012-04-03 Thread Michael Grimm
Hi --

[Sorry for my private response, instead of public one]

On 03.04.2012, at 01:02, FZiegler wrote:

> Now I'd like if possible, to replicate this setup on my laptop and keep
> both in sync with unison (http://www.cis.upenn.edu/~bcpierce/unison/),
> which I am already using to sync much of my home dir about once a day.
> 
> I found at least one positive message regarding this topic
> (http://dovecot.org/list/dovecot/2010-April/048092.html), but I feel I
> could use some more advice.

I used to sync my two server's maildirs for some years, but I moved to
dsync mirroring some months ago, and now I'm into using replicator/dsync
(see archive of March 2012).

Unsion mirroring is working in general, but sometimes you might realize
some duplicates being produced. Not bad, but it happens. I did realize
the same with using dsync mirror instead. It's much better with the new
replicator/dsync mirroring scheme, but it's not perfect, yet. (Again, see
ML archives of the last weeks). 

> Namely, which of the ancillary files should I be syncing (or perhaps
> deleting before sync)? In addition to the mails themselves I'm seeing:
> 
> -rw---   1 fz  501 13 Apr  1 17:10 dovecot-keywords
> -rw---   1 fz  501   2483 Apr  1 17:10 dovecot-uidlist
> -rw---   1 fz  501   1040 Mar 29 14:50 dovecot.index
> -rw---   1 fz  501  44032 Apr  1 17:10 dovecot.index.cache
> -rw---   1 fz  501   9772 Apr  1 17:10 dovecot.index.log
> 
> and at the top level (in .local/var/Maildir/):
> 
> -rw---   1 fz  501  8 Apr  1 17:10 dovecot-uidvalidity
> -r--r--r--   1 fz  501  0 Apr  1 17:10 dovecot-uidvalidity.4efb323d
> -rw---   1 fz  501   3288 Apr  1 17:10 dovecot.mailbox.log
> -rw---   1 fz  501   4104 Mar 28 10:53 dovecot.mailbox.log.2

I used ...

ignore = Name dovecot*
ignore = Regex .*/tmp$
ignore = Regex .*/\.Drafts$

… to ignore all of them. When runnig mirroring for the very first time, I
started with one empty maildir at one server, IIRC. You better check that
with a test maildir beforehand.

> -rw---   1 fz  501   5114 Apr  1 17:10 subscriptions

That became mirrored.

Regards,
Michael



Re: [Dovecot] Mail migration troubles

2012-04-03 Thread Nikolaos Milas

On 3/4/2012 6:06 μμ, Spyros Tsiolis wrote:


What do you mean by namespace ?


See: http://wiki2.dovecot.org/Namespaces

Best regards,
Nick


Re: [Dovecot] Mail migration troubles

2012-04-03 Thread Spyros Tsiolis
Also,

What do you mean by namespace ?

I am sorry I didn't get that one :

>> dovecot -n output would have helped. Mainly: do you have a namespace
>> prefix or not? That's about the only thing I can think of related to
>> that error message (e.g. dovecot has non-empty namespace prefix, while
>> TB has empty namespace prefix).


I missed the "namespace" thing.

s.

 

"I merely function as a channel that filters 
music through the chaos of noise"
- Vangelis


Re: [Dovecot] Mail migration troubles

2012-04-03 Thread Spyros Tsiolis
Hi Timo, 
>
> From: Timo Sirainen 
>To: Spyros Tsiolis  
>Cc: Dovecot  
>Sent: Tuesday, 3 April 2012, 8:32
>Subject: Re: [Dovecot] Mail migration troubles
> 
>On Sun, 2012-04-01 at 22:54 +0100, Spyros Tsiolis wrote:
>> However, I have this nagging problem with most of the thunderbird
>> MTAs. When I try to delete some "test" messages I sent to make sure
>> that everything works, it comes back with the following message on
>> the bottom of the Thunderbird window :
>> 
>> "The current operation on InBox did not succeed. 
>> The mail server for account "acco...@bloomingdomain.gr" 
>> responded [TRYCREATE] mailbox doesn't exist : Trash"
>
>That error probably happens when deleting a message.


Yes, it does Timo. Thank you.


>> Dovecot v1.2.15 AFAIK
Actually it's v1.2.16


>dovecot -n output would have helped. Mainly: do you have a namespace
>prefix or not? That's about the only thing I can think of related to
>that error message (e.g. dovecot has non-empty namespace prefix, while
>TB has empty namespace prefix).

Why do I keep forgetting this ? Damn the gods :-)
!@#$

:-)

Here's the output of "dovecot -n" :

[root@mailgate ~]# dovecot -n
# 1.2.16: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.18-194.17.4.el5 i686 CentOS release 5.5 (Final) ext3
base_dir: /var/run/dovecot/
log_path: /var/log/dovecot/dovecot.log
info_log_path: /var/log/dovecot/dovecot-info.log
ssl_parameters_regenerate: 48
verbose_ssl: yes
login_dir: /var/run/dovecot//login
login_executable: /usr/local/dovecot/libexec/dovecot/imap-login
login_greeting: * Dovecot ready *
login_max_processes_count: 64
mail_location: maildir:/var/MailRoot/domains/%d/%n/Maildir
mail_plugins: zlib
auth default:
  verbose: yes
  debug: yes
  debug_passwords: yes
  passdb:
    driver: passwd-file
    args: /etc/dovecot/passwd
  passdb:
    driver: pam
  userdb:
    driver: static
    args: uid=vmail gid=vmail home=/home/vmail/%u
  userdb:
    driver: passwd
[root@mailgate ~]# 



I suspect it's some freak thunderbird bug.
It's the only explanation. I've migrated about
20 mailboxes and it's the only one acting up.

Thanks again Timo,

s.









"I merely function as a channel that filters 
music through the chaos of noise"
- Vangelis


Re: [Dovecot] imapdir still a configuration option?

2012-04-03 Thread Kurt Mosiejczuk

Timo Sirainen wrote:


mail_location = maildir:~/Maildir:LAYOUT=imapdir


Excellent.  That works *perfectly*.

--Kurt


Re: [Dovecot] Connection queue full on dovecot 2.0.13

2012-04-03 Thread Timo Sirainen
On Mon, 2012-04-02 at 16:39 +0200, Giovanni Mancuso wrote:
> Apr 02 14:34:36 imap-login: Info: Disconnected: *Connection queue full
> *(auth failed, 1 attempts): user= I see this wiki page: http://wiki2.dovecot.org/LoginProcess but i read:
> 
> It works by using a number of long running login processes, each
> handling a number of connections. This loses much of the security
> benefits of the login process design, because in case of a security hole
> (in Dovecot or SSL library) the attacker is now able to see other users
> logging in and steal their passwords, read their mails, etc.
> 
> Is there another way?

Just increase the number of processes:

service imap-login {
  process_limit = 1
}




Re: [Dovecot] imapdir still a configuration option?

2012-04-03 Thread Timo Sirainen
On Mon, 2012-04-02 at 17:23 -0400, Kurt Mosiejczuk wrote:
> I've been looking at moving an old IMAPdir-based solution to dovecot.  I 
> came across references that dovecot (to my pleasant surprise) added 
> imapdir support in 1.1.  However, in trying 2.0.13 (from an OpenBSD 
> package) things start okay, but I see in the logs:
> 
> "Initialization failed: Initializing mail storage from mail_location 
> setting failed: Unknown mail storage driver imapdir"
> 
> Poking around in the sources, I still see lots of references to imapdir, 
> but see very little in the documentation.
> 
> Is IMAPdir still supported in 2.0.x (or even 2.1.x)?  I'd prefer not to 
> have to migrate users via renaming, especially since they like the 
> IMAPdir layout for their own searching.

mail_location = maildir:~/Maildir:LAYOUT=imapdir




Re: [Dovecot] Backtrace on mdbox index

2012-04-03 Thread Timo Sirainen
Could you privately send me your all of your dovecot.index,
dovecot.index.log, dovecot.map.index and dovecot.map.index.log files
under mdbox? None of those contain any sensitive data.

On Tue, 2012-04-03 at 11:17 -0300, Jean Michel wrote:
> I tried with dovecot 2.1.3 and got the same error, any ideia ?
> 
> 2012/4/3 Timo Sirainen 
> 
> > On Mon, 2012-04-02 at 11:14 -0300, Francisco Wagner C. Freire wrote:
> >
> > > I current using dovecot with mdbox and on one account i get this error:
> > >
> > > doveadm(user@domain): Panic: file mail-index-sync-ext.c: line 209
> > > (sync_ext_reorder): assertion failed: (offset < (uint16_t)-1)
> >
> > Dovecot version? I think I've fixed this in recent v2.1.x.
> >
> >
> >
> 
> 




Re: [Dovecot] Backtrace on mdbox index

2012-04-03 Thread Jean Michel
I tried with dovecot 2.1.3 and got the same error, any ideia ?

2012/4/3 Timo Sirainen 

> On Mon, 2012-04-02 at 11:14 -0300, Francisco Wagner C. Freire wrote:
>
> > I current using dovecot with mdbox and on one account i get this error:
> >
> > doveadm(user@domain): Panic: file mail-index-sync-ext.c: line 209
> > (sync_ext_reorder): assertion failed: (offset < (uint16_t)-1)
>
> Dovecot version? I think I've fixed this in recent v2.1.x.
>
>
>


-- 
--
Jean Michel Feltrin


[Dovecot] Per-user flags/indexes for shared mailboxes

2012-04-03 Thread Timo Sirainen
The attached patch adds support for doing e.g.:

namespace {
  type = public
  prefix = Public/
  location = mdbox:/var/lib/public/mdbox:INDEXPVT=~/mdbox/public
  list = yes
}

So the private flags are stored in indexes under ~/mdbox/public/, while
the shared flags are stored under /var/lib/public/mdbox/. The patch
currently hardcodes the shared flags as only MAIL_SEEN. I'm not really
sure what would be the best place to configure which flags are private.
Perhaps a per-namespace default, but how to configure it per-mailbox?

Also per-user keywords aren't currently supported. And it's a little bit
annoying that each private flag update must increase the shared modseq
for the message, but that can't really be helped. (Alternative would be
for each user to have their own private modseqs, which could get
difficult.)

I'll probably commit this to v2.1 after some more testing.
diff -r 16f95654ddac src/doveadm/doveadm-dump-log.c
--- a/src/doveadm/doveadm-dump-log.c	Tue Apr 03 14:45:10 2012 +0300
+++ b/src/doveadm/doveadm-dump-log.c	Tue Apr 03 15:52:59 2012 +0300
@@ -282,8 +282,8 @@
 		const struct mail_transaction_flag_update *u = data;
 
 		for (; size > 0; size -= sizeof(*u), u++) {
-			printf(" - uids=%u-%u (flags +%x-%x)\n",
-			   u->uid1, u->uid2, u->add_flags, u->remove_flags);
+			printf(" - uids=%u-%u (flags +%x-%x, modseq_inc_flag=%d)\n",
+			   u->uid1, u->uid2, u->add_flags, u->remove_flags, u->modseq_inc_flag);
 		}
 		break;
 	}
diff -r 16f95654ddac src/lib-index/mail-index-private.h
--- a/src/lib-index/mail-index-private.h	Tue Apr 03 14:45:10 2012 +0300
+++ b/src/lib-index/mail-index-private.h	Tue Apr 03 15:52:59 2012 +0300
@@ -39,8 +39,8 @@
 	 PTR_OFFSET((map)->rec_map->records, (idx) * (map)->hdr.record_size))
 
 #define MAIL_TRANSACTION_FLAG_UPDATE_IS_INTERNAL(u) \
-	u)->add_flags | (u)->remove_flags) & \
-	  MAIL_INDEX_FLAGS_MASK) == 0)
+	u)->add_flags | (u)->remove_flags) & MAIL_INDEX_FLAGS_MASK) == 0 && \
+	 (u)->modseq_inc_flag == 0)
 
 #define MAIL_INDEX_EXT_KEYWORDS "keywords"
 
diff -r 16f95654ddac src/lib-index/mail-index-transaction-export.c
--- a/src/lib-index/mail-index-transaction-export.c	Tue Apr 03 14:45:10 2012 +0300
+++ b/src/lib-index/mail-index-transaction-export.c	Tue Apr 03 15:52:59 2012 +0300
@@ -20,6 +20,34 @@
 	buf->data, buf->used);
 }
 
+static void log_append_flag_updates(struct mail_index_export_context *ctx,
+struct mail_index_transaction *t)
+{
+	ARRAY_DEFINE(log_updates, struct mail_transaction_flag_update);
+	const struct mail_index_flag_update *updates;
+	struct mail_transaction_flag_update *log_update;
+	unsigned int i, count;
+
+	updates = array_get(&t->updates, &count);
+	if (count == 0)
+		return;
+
+	i_array_init(&log_updates, count);
+
+	for (i = 0; i < count; i++) {
+		log_update = array_append_space(&log_updates);
+		log_update->uid1 = updates[i].uid1;
+		log_update->uid2 = updates[i].uid2;
+		log_update->add_flags = updates[i].add_flags & 0xff;
+		log_update->remove_flags = updates[i].remove_flags & 0xff;
+		if ((updates[i].add_flags & MAIL_INDEX_MAIL_FLAG_UPDATE_MODSEQ) != 0)
+			log_update->modseq_inc_flag = 1;
+	}
+	log_append_buffer(ctx, log_updates.arr.buffer,
+			  MAIL_TRANSACTION_FLAG_UPDATE);
+	array_free(&log_updates);
+}
+
 static const buffer_t *
 log_get_hdr_update_buffer(struct mail_index_transaction *t, bool prepend)
 {
@@ -373,8 +401,7 @@
 
 	if (array_is_created(&t->updates)) {
 		change_mask |= MAIL_INDEX_SYNC_TYPE_FLAGS;
-		log_append_buffer(&ctx, t->updates.arr.buffer, 
-  MAIL_TRANSACTION_FLAG_UPDATE);
+		log_append_flag_updates(&ctx, t);
 	}
 
 	if (array_is_created(&t->ext_rec_updates)) {
diff -r 16f95654ddac src/lib-index/mail-index-transaction-finish.c
--- a/src/lib-index/mail-index-transaction-finish.c	Tue Apr 03 14:45:10 2012 +0300
+++ b/src/lib-index/mail-index-transaction-finish.c	Tue Apr 03 15:52:59 2012 +0300
@@ -80,7 +80,7 @@
 
 static unsigned int
 mail_transaction_drop_range(struct mail_index_transaction *t,
-			struct mail_transaction_flag_update update,
+			struct mail_index_flag_update update,
 			unsigned int update_idx,
 			ARRAY_TYPE(seq_range) *keeps)
 {
@@ -109,7 +109,7 @@
 static void
 mail_index_transaction_finish_flag_updates(struct mail_index_transaction *t)
 {
-	const struct mail_transaction_flag_update *updates, *u;
+	const struct mail_index_flag_update *updates, *u;
 	const struct mail_index_record *rec;
 	unsigned int i, count;
 	ARRAY_TYPE(seq_range) keeps;
diff -r 16f95654ddac src/lib-index/mail-index-transaction-private.h
--- a/src/lib-index/mail-index-transaction-private.h	Tue Apr 03 14:45:10 2012 +0300
+++ b/src/lib-index/mail-index-transaction-private.h	Tue Apr 03 15:52:59 2012 +0300
@@ -29,6 +29,12 @@
 	struct mail_index_module_register *reg;
 };
 
+struct mail_index_flag_update {
+	uint32_t uid1, uid2;
+	uint16_t add_flags;
+	uint16_t remove_flags;
+};
+
 struct mail_index_transaction {
 	int refcount;
 
@@ -46,7 +52,7 @@
 
 	ARRAY_DEFINE(modseq_updat

[Dovecot] Courier to Dovecot migration script issue

2012-04-03 Thread xnasx
Hi!
Forgive my bad English.

I trying to migrate to Dovecot 2.0.18 from Courier 4.10. 
I using a script 'courier-dovecot-migrate.pl' from oficial wiki - it works 
without errors and creating dovecot-uidlist, etc. .

I running Dovecot on a different port: 11149.
When I connecting to port 11149 from Thunderbird, all my message headers are 
reloading.

Please help me to solve this issue.

Best regards,

Victor


Re: [Dovecot] dsync redesign

2012-04-03 Thread Charles Marcus

On 2012-04-02 7:15 PM, Micah Anderson  wrote:

Charles Marcus  writes:

On 2012-03-27 11:47 AM, Micah Anderson  wrote:

One would be the ability to perform *intelligent* incremental /
rotated backups. I can do this now by running a dsync backup
operation and then doing manual hardlinking or moving of the
backup directories (daily.1, daily.2, weekly.1, monthly.1, etc.),
but it would be more intelligent if this were baked into the
backup process.



There are already numerous tools that do this flawlessly - I've
beenusing rsnapshot (which uses rsync) for this for years.



Are you snapshotting your filesystem (using LVM, or SAN, or similar)
before doing rsnapshot? Because if you aren't then rsync will not
assuredly get everything in a consistent state.


No, and you are correct... but I run it in the middle of the night, and 
the system is only barely utilized at the time, so the very minor 
inconsistencies are not a problem overall.


I will, however, be changing this to using FS snapshots once I get my 
mailserver virtualized (already being planned for when our new office 
location comes online), so that will allow me to perform snapshots 
multiple times during the day (I'm thinking 4 times per day will be enough).



I don't know if Timo should be spending his time reinventing the
wheel.



dsync backup is already here, and it is quite useful.


I'm not saying it isn't, I'm just saying that there are already *plenty* 
of different backup tools, and I don't see the sense in Timo spending 
lots of time on creating a new one just for dovecot. His time would be 
better spent just making it easier for any other backup tool to work better.



Although, one interesting piece that I am hopeful I'll be able to
implement soon (with Timo's professional help) is the ability to
easily and automatically map my rsnapshot snapshots directory to a
read-only 'Backups' namespace that automatically shows the
snapshots by date and time as they are produced. This way users
could 'go back in time' anytime they wanted without having to call
me... :)



Interesting idea, would be a great one to share with the community
if you decide to do so.


Absolutely - that is already on my list for when I pay Timo's company to 
do this - document it on the wiki. Hopefully if any code changes are 
needed to make it work right, they will be minor.


--

Best regards,

Charles


Re: [Dovecot] Dovecot 1.2.9. next_uid was lowered

2012-04-03 Thread Lee Standen
I'll just say what I'm sure someone else will shortly :)

The problem is NFS: http://wiki2.dovecot.org/NFS
The solution is 2.x Director: http://wiki2.dovecot.org/Director

Although it looks like you're currently on 1.x so it'd be a fairly
significant upgrade for you.


On Tue, Apr 3, 2012 at 3:24 PM, Müller Lukas wrote:

> Shortly after the mail gets delivered on server2, I get the following
> errors on server1:
> mail01 dovecot: IMAP(akzid...@triner.ch): fdatasync(/data/vmail/
> example.com/user/dovecot-uidlist) failed: Input/output error
> mail01 dovecot: IMAP(akzid...@triner.ch): /data/vmail/
> example.com/user/dovecot-uidlist: next_uid was lowered (2143 -> 2142,
> hdr=2142)
>
>


[Dovecot] Dovecot 1.2.9. next_uid was lowered

2012-04-03 Thread Müller Lukas
Hi There

A while ago I posted here about a crash of dovecot, that had to do with nfs and 
was quite certainly due to bad luck.

But still one problem persists:
We have a Mailbox, that is accessed from multiple users using IMAP.
Occasionally all the Emails in the mailbox seem to be missing, when accessing 
the Mailbox through IMAP, although they're still there on the server.

This seems to happen, if the users are accessing the Mailbox on Server1 and at 
the same time an email gets delivered to the mailbox on server2.
Since it happens quite seldom, there must be other conditions or circumstances 
that have to be met for the problem to occur. Unfortunately I don't know which.

Shortly after the mail gets delivered on server2, I get the following errors on 
server1:
mail01 dovecot: IMAP(akzid...@triner.ch): 
fdatasync(/data/vmail/example.com/user/dovecot-uidlist) failed: Input/output 
error
mail01 dovecot: IMAP(akzid...@triner.ch): 
/data/vmail/example.com/user/dovecot-uidlist: next_uid was lowered (2143 -> 
2142, hdr=2142)

The new mail is than missing in the uidlist and as long as no new mail arrives 
all folders of the mailbox appear to be empty.
If a new mail arrives, it will get the uid that should have been given to the 
pervious mail (the one that caused the error).
The previous mail still won't be listed in the uidlist, but everything works as 
expected.
Best regards
Lukas Müller
Systems Engineer
___
NEWMEDIA
Südostschweiz Newmedia AG

http://www.newmedia.ch
___

TYPO3 & Drupal - Wir wissen wie.
Ihre professionelle Web Agentur
in Chur, Ilanz, Glarus und Zürich.