Re: [Dovecot] handling filename of compressed messages

2010-01-14 Thread Leonardo Rodrigues

Pascal Volk escreveu:


No, you don't wont to have such file names.

http://wiki.dovecot.org/Plugins/Zlib: … Dovecot can now read the file,
but to avoid compressing it again … include e.g. a Z flag in the file
name … (e.g. 1223212411.M907959P17184.host,S=3271:2,SZ)

The article links also to: http://cr.yp.to/proto/maildir.html:
…
What can I put in info?
When you move a file from new to cur, you have to change its name from
uniq to uniq:info … info starting with 2,: Each character after the
comma is an independent flag. …

In short: You want to rename
1263436052.V6814I43300b4M146002.correio.domain.com.br,S=238207
to 1263436052.V6814I43300b4M146002.correio.domain.com.br,S=238207:2,Z
  


   got it  so, basically, i shouldnt be using .gz at all, is that ok ?

   i understood that, when moving from new to cur, filename should be 
appended of ':2,'. But filenames on new, as i understood, should never 
be changed. As soon as they are read there (on new), they should be 
moved to cur.


   what would be the correct way of compressing messages on the new 
directory and adding the Z flag ? Would be any problem if, when 
compressing on new, add the ':2,' suffix ? Indeed it would be ':2,Z' 
suffix one


   i tried it ...

gzipped the file 
new/1263462832.V6814I43300c8M993425.correio.domain.com.br,S=10137

and got the gzipped file to be named
new/1263462832.V6814I43300c8M993425.correio.domain.com.br,S=10137:2,Z
and excluded the original file

when checked mail, file was correctly moved to cur
when replied to that mail, file was correctly renamed to
cur/1263462832.V6814I43300c8M993425.correio.domain.com.br,S=10137:2,RSZ


   is that OK to have filenames on new with the ':2,Z' suffix ?

--


Atenciosamente / Sincerily,
Leonardo Rodrigues
Solutti Tecnologia
http://www.solutti.com.br

Minha armadilha de SPAM, NÃO mandem email
gertru...@solutti.com.br
My SPAMTRAP, do not email it






Re: [Dovecot] uw-imap compatability hack?

2010-01-14 Thread Simon Annetts
Thanks Timo, I couldn't get this to work properly with 1.0.7, but I've 
upgraded to 1.2.9 now and it works fine with a config of:


mail_location = maildir:~/Maildir
namespace private {
 separator = /
 prefix =
 inbox = yes
}
namespace private {
 separator = /
 prefix = mail/
 inbox = no
 hidden = yes
 list = no
 subscriptions = no
}

Thanks again
Simon



Timo Sirainen wrote:

On 8.1.2010, at 23.47, Simon Annetts wrote:

  

if I remove the mail/ setting from 'IMAP server directory' in the client, then 
everything works as expected and all the folders are visible.
With this setting in however, only the inbox is visible and attempts to click 
on another folder, say Trash result in the client error:
Mailbox doesn't exist .mail.Trash
I've tried various namespace configurations I found in the namespaces wiki 
example but none seem to work.



You need to preserve the separator:

namespace private {
  prefix = 
  separator = /

}
namespace private {
  prefix = mail/
  separator = /
}

  


--

This e-mail and any attachment is confidential. If you have received it in 
error, please delete it from your system, do not use or disclose the 
information in any way, and notify me immediately. The contents of this message 
may contain personal views which are not necessarily the views of Ateb Ltd, 
unless specifically stated.
Mae'r e-bost hwn ac unrhyw atodiad sydd ynghlwm wrtho, yn gyfrinachol.  Os yw 
wedi eich cyrraedd mewn camgymeriad dilëwch ef oddi ar eich system. Peidiwch â 
defnyddio na datgelu'r wybodaeth mewn unrhyw ffordd a rhowch wybod imi ar 
unwaith os gwelwch yn dda. Gall y neges gynnwys barn bersonol nad yw o 
anghenraid yn farn Ateb Cyf, oni ddywedir hynny'n benodol.
***
Ateb Ltd.
Company No. 3769059
VAT No.   736568987
Registered Address:
Marteg House,
St. Harmon,
Rhayader,
Powys LD6 5LG
T: 01597 870329
M: 07932 014055
***




Re: [Dovecot] shared namespace bug?

2010-01-14 Thread Patrick Kaiser
On Tue, Jan 12, 2010 at 04:33:19PM +0200, Timo Sirainen wrote:
 On 11.1.2010, at 14.12, Patrick Kaiser wrote:
 
  * LIST (\HasNoChildren) / shared/peter.griffinINBOX
  a02 OK List completed.
 
 dovecot -n output?

Hi

Sorry that I missed that.

Here is dovecot -n

testing:~# dovecot -n
# 1.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.26-2-686 i686 Debian squeeze/sid ext3
log_timestamp: %Y-%m-%d %H:%M:%S 
protocols: imap imaps pop3 pop3s
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
mail_privileged_group: mail
mail_uid: 1001
mail_gid: 1001
mail_location: maildir:/var/vmail/%n
mail_debug: yes
mbox_write_locks: fcntl dotlock
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_plugins(default): acl imap_acl
mail_plugins(imap): acl imap_acl
mail_plugins(pop3): 
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
mail_log_max_lines_per_sec: 0
imap_client_workarounds(default): outlook-idle
imap_client_workarounds(imap): outlook-idle
imap_client_workarounds(pop3): 
namespace:
  type: private
  separator: /
  inbox: yes
  list: yes
  subscriptions: yes
namespace:
  type: shared
  separator: /
  prefix: shared/%%u
  location: maildir:/var/vmail/%%u
  list: children
lda:
  postmaster_address: postmas...@example.com
  hostname: mail.example.com
  mail_plugins: acl
  mail_plugin_dir: /usr/lib/dovecot/modules/lda
  sendmail_path: /usr/lib/sendmail
  auth_socket_path: /var/run/dovecot/auth-master
auth default:
  mechanisms: plain login digest-md5
  passdb:
driver: ldap
args: /etc/dovecot/dovecot-ldap.conf
  userdb:
driver: ldap
args: /etc/dovecot/dovecot-ldap.conf
  socket:
type: listen
master:
  path: /var/run/dovecot/auth-master
  mode: 384
  user: vmail
  group: vmail
plugin:
  acl: vfile
  acl_shared_dict: file:/var/vmail/shared-mailboxes.db



Thanks for your help guys.


Friendly regards,

Patrick 


-- 
Name  : Patrick Kaiser
Email : patrick.kai...@argonius.de
Website   : http://www.argonius.de
GPG Key   : http://www.argonius.de/key.pub


Re: [Dovecot] shared namespace bug?

2010-01-14 Thread Timo Sirainen
On 14.1.2010, at 14.55, Patrick Kaiser wrote:

 * LIST (\HasNoChildren) / shared/peter.griffinINBOX
 a02 OK List completed.
..
 namespace:
  type: shared
  separator: /
  prefix: shared/%%u

You need to add / after the %%u. I thought I had a check that caused it to fail 
at startup if it wasn't there..



Re: [Dovecot] shared namespace bug?

2010-01-14 Thread Patrick Kaiser
On Thu, Jan 14, 2010 at 02:52:38PM +0200, Timo Sirainen wrote:
 On 14.1.2010, at 14.55, Patrick Kaiser wrote:
 
  * LIST (\HasNoChildren) / shared/peter.griffinINBOX
  a02 OK List completed.
 ..
  namespace:
   type: shared
   separator: /
   prefix: shared/%%u
 
 You need to add / after the %%u. I thought I had a check that caused it to 
 fail at startup if it wasn't there..


Many thanks. That does the trick :)  But there was no problem on
startup. 
Maybe you have to check the check ;)

Thanks again.

Greetz

Patrick

-- 
Name  : Patrick Kaiser
Email : patrick.kai...@argonius.de
Website   : http://www.argonius.de
GPG Key   : http://www.argonius.de/key.pub


Re: [Dovecot] handling filename of compressed messages

2010-01-14 Thread Patrick Domack

Quoting Eduardo M KALINOWSKI edua...@kalinowski.com.br:


On Qui, 14 Jan 2010, Leonardo Rodrigues wrote:

  got it  so, basically, i shouldnt be using .gz at all, is that ok ?


Yes.

  i understood that, when moving from new to cur, filename should  
be appended of ':2,'. But filenames on new, as i understood, should  
never be changed. As soon as they are read there (on new), they  
should be moved to cur.


  what would be the correct way of compressing messages on the new  
directory and adding the Z flag ? Would be any problem if, when  
compressing on new, add the ':2,' suffix ? Indeed it would be  
':2,Z' suffix one


How about not compressing mails still in new/? They shouldn't remain  
there for very long anyway, you could compress only the ones in cur/.




If people read their emails atleast daily, it would work ok that way.  
But with several people that only read emails monthly or even not at  
all, it helps to compress the new folder also.





Re: [Dovecot] handling filename of compressed messages

2010-01-14 Thread Timo Sirainen
On 14.1.2010, at 11.58, Leonardo Rodrigues wrote:

 In short: You want to rename
 1263436052.V6814I43300b4M146002.correio.domain.com.br,S=238207
 to 1263436052.V6814I43300b4M146002.correio.domain.com.br,S=238207:2,Z
  
 
   got it  so, basically, i shouldnt be using .gz at all, is that ok ?

Right. Don't change the base filename.

   i understood that, when moving from new to cur, filename should be appended 
 of ':2,'. But filenames on new, as i understood, should never be changed. As 
 soon as they are read there (on new), they should be moved to cur.

Maildir spec says files in new/ shouldn't have the :2, part, but Dovecot is 
fine with it.

Re: [Dovecot] handling filename of compressed messages

2010-01-14 Thread Leonardo Rodrigues

Timo Sirainen escreveu:


Maildir spec says files in new/ shouldn't have the :2, part, but Dovecot is 
fine with it.


   i'm trying to get the sample script for compressing maildirs from 
http://wiki.dovecot.org/Plugins/Zlib (right on the end of the page) but 
link seems to be not accessible.


https://abma.de/node/449

   is this script available somewhere else ?

--


Atenciosamente / Sincerily,
Leonardo Rodrigues
Solutti Tecnologia
http://www.solutti.com.br

Minha armadilha de SPAM, NÃO mandem email
gertru...@solutti.com.br
My SPAMTRAP, do not email it






[Dovecot] antispam plugin

2010-01-14 Thread Dan Swartzendruber
First off, I have to say I really like the antispam plugin.  I am 
running a (relatively) new freebsd 8.0 server with 
postfix/dovecot/dspam/squirrelmail and it works great.  Create a SPAM 
folder and tell the dovecot antispam plugin to use INBOX.SPAM as the 
spam folder and drag messages from INBOX to the spam folder and they are 
trained  as spam.  Here is the problem though: after training dspam for 
a couple of weeks, I had a couple hundred messages in the SPAM folder, 
so I selected them and hit the DELETE button and they were gone.  Except 
they weren't.  I had forgotten that by default squirrelmail moves 
deleted messages to a Trash folder under INBOX.  So the messages were 
moved out of the SPAM folder, resulting in them being retrained as ham.  
Oops :(  I then hit the purge link in squirrelmail and the messages were 
forever gone, so I couldn't rectify my gaffe.  I have temporarily 
reconfigured squirrelmail to delete messages outright rather than save 
them in the Trash folder, but I don't like that as a long-term 
solution.  What occurred to me is this: the current algorithm is: if 
message moves from * = SPAM, it is trained as spam, if it moves from 
SPAM = *, it is trained as ham.  It would be nice if you could 
elaborate on that such that the ham rule was if message moves from SPAM 
to X, it is ham (and in my case, I would defined X as INBOX.  Thoughts?


Re: [Dovecot] antispam plugin

2010-01-14 Thread Tom Hendrikx
Dan Swartzendruber wrote:
 First off, I have to say I really like the antispam plugin.  I am
 running a (relatively) new freebsd 8.0 server with
 postfix/dovecot/dspam/squirrelmail and it works great.  Create a SPAM
 folder and tell the dovecot antispam plugin to use INBOX.SPAM as the
 spam folder and drag messages from INBOX to the spam folder and they are
 trained  as spam.  Here is the problem though: after training dspam for
 a couple of weeks, I had a couple hundred messages in the SPAM folder,
 so I selected them and hit the DELETE button and they were gone.  Except
 they weren't.  I had forgotten that by default squirrelmail moves
 deleted messages to a Trash folder under INBOX.  So the messages were
 moved out of the SPAM folder, resulting in them being retrained as ham. 
 Oops :(  I then hit the purge link in squirrelmail and the messages were
 forever gone, so I couldn't rectify my gaffe.  I have temporarily
 reconfigured squirrelmail to delete messages outright rather than save
 them in the Trash folder, but I don't like that as a long-term
 solution.  What occurred to me is this: the current algorithm is: if
 message moves from * = SPAM, it is trained as spam, if it moves from
 SPAM = *, it is trained as ham.  It would be nice if you could
 elaborate on that such that the ham rule was if message moves from SPAM
 to X, it is ham (and in my case, I would defined X as INBOX.  Thoughts?

There is also a plugin setting that defines your Trash folder, which is
meant to fix the issue you're seeing (excluding junk-trash moving from
retraining).

# semicolon-separated list of Trash folders (default unset i.e. none)
# antispam_trash =
# antispam_trash = trash;Trash;Deleted Items; Deleted Messages

--
Regards,
Tom


[Dovecot] shared namespaces with common prefix prefix

2010-01-14 Thread Frank Cusack

Can shared/public namespaces' prefixes have a common prefix? :)

namespace public {
 separator = /
 prefix = zz/shared/
 location = maildir:/var/maildir/shared:INDEX=/var/maildir/%n/shared
 subscriptions = no
}
# to share other employees mailboxes (term'd or admin access)
namespace shared {
 separator = /
 prefix = zz/shared/%%u/
 location = maildir:/var/maildir/%%n:INDEX=/var/maildir/users/%%u
 subscriptions = no
 list = children
}

Since I added the shared namespace, I can no longer access the public
namespace.  The folders show up but then trying to access one gets the
error that the mailbox doesn't exist.

If they can't have a common part of the prefix, is that an IMAP limitation
or could dovecot conceivably handle it?

-frank


Re: [Dovecot] shared namespaces with common prefix prefix

2010-01-14 Thread Frank Cusack
On January 14, 2010 2:22:08 PM -0500 Frank Cusack fcus...@fcusack.com 
wrote:

# to share other employees mailboxes (term'd or admin access)
namespace shared {
  separator = /
  prefix = zz/shared/%%u/
  location = maildir:/var/maildir/%%n:INDEX=/var/maildir/users/%%u
  subscriptions = no
  list = children
}


In the INDEX, did I really mean to use /var/maildir/%n/users/%%u?
I mean, I think I left out the %n in my configuration.  Using a
global directory seems to defeat the point of the separate INDEX.

-frank


Re: [Dovecot] handling filename of compressed messages

2010-01-14 Thread Curtis Maloney

On 01/14/10 20:58, Leonardo Rodrigues wrote:

what would be the correct way of compressing messages on the new
directory and adding the Z flag ? Would be any problem if, when
compressing on new, add the ':2,' suffix ? Indeed it would be ':2,Z'
suffix one


OK... since I've been wanting compressed mail for sometime.. I'm going 
to throw my hat into the ring here...


Timo -- any tips on helping dovecot deliver compress mails on delivery?

It would solve a lot of problems here, from what I can see, to have a 
deliver plugin that compresses on delivery and sets the Z flag in the 
filename.


--
Curtis


[Dovecot] LDA and POP3/IMAP user_query

2010-01-14 Thread Michael
How do I get IMAP+POP3 vs. LDA to use different user_query statements?

The problem is that the input fields are different.

IMAP/POP3 is an email address

LDA is a username

I have written a long statement to try and cater for both however it still 
only works 99% of the time, and the remaining 1% fails. The 1% that fails 
sees the mail being delivered to the wrong mbox. In this particular case the 
same client owned both mboxes so it was ok, but if this had not been the case 
things could have gotten real embarrassing.

Think of the following:

abcwidg...@theirdomain.tld  mailuser1
mailus...@adomain.tld   mailuser2

Now when using the Postfix LDA, email for each address is properly delivered 
to the specified mbox, however in this case because their is a matching name 
for the mbox and the email address lefthand content, the compound SQL query 
returns both results and the LDA will use the first one, which in this case 
was the wrong one.

This is the query used:
user_query = \
SELECT mailboxes.username AS user, mailboxes.uid, mailboxes.gid, \
concat('*:storage=',mailquota,'M') AS quota_rule \
FROM mailboxes JOIN accounts ON accounts.username = mailboxes.username \
WHERE ((mailboxes.username = '%n' AND accounts.active='1') || \
(mailboxes.email = '%u' AND mailboxes.active='1' AND accounts.active='1') || \
(mailboxes.email = CONCAT('@','%d') AND mailboxes.active='1' \
AND (SELECT COUNT(email) FROM mailboxes WHERE email='%u') = '0'))

which additionally caters for the few catch alls our users have.

I think this is a massive oversight in the design of Dovecot to use one query 
to for 2 separate and distinct processes, that both use different parameters.

From what I can tell it seems to assume that a mail system will always use 
usern...@domain addresses, and never anything more arbitrary.

Has anyone found a way around this?

Michael


Re: [Dovecot] 1.2.9 imap crash with backtrace

2010-01-14 Thread David Halik


FYI, we backed out of the noac change today. When our 20K accounts 
started coming to work the NetApp NFS server was pushing 70% CPU usage 
and 25K NFS Ops/s, which resulted in all kinds of other havoc as normal 
services started becoming slow. This server usally runs around 25% and 
5K, so such a large increase of load was too much to handle.


During the 12 hour window I didn't see a single uid error as expected, 
but the fix was worse than the problem.


On 01/13/2010 07:41 PM, David Halik wrote:


Same here. I laughed because our help desk started sending us the 
exact same complaints and then today I got a little bit of a red nose 
when a director's mail disappeared in a meeting. ;) Whoops.


It looks like users who end up with the off by 1 uid list rebuild and 
crash experience and empty inbox until the list is rebuilt and 
refreshed. I saw one user who experience the crash and then spewed 
about 15K lines of Duplicate message, uid - uid. Since that takes 
awhile they probably couldn't see anything in the meantime.


Anyway, since we're hearing the complaints I went and remounted our 
IMAP servers with the noac NFS option today. So far it seems to have 
swept the problem under the rug, but our NFS server's Ops went from an 
average of 3-5K to 10K-20K, and the cpu went from 10% to 50% of 
constant load... so this is *definitely* only a temp fix. Hopefully 
Timo will have time to analyze the problem once his move is all finished.


-Dave


I hope your move is going well, and you get settled in and your internet
hooked up soon. It's got to be a rough process!

Just for the record, we continue to see this crash fairly frequently
with a small subset of our users, enough so that they have started to
complain to the helpdesk staff about their mail 'disappearing and then
reappearing.' One user in particular has a mail client left open from
three hosts and has hit it 23 times in the last week, and 10 times
today.

If there's any more information I can collect or anything I can do to
help get this resolved, please let me know!

-Brad





--

David Halik
System Administrator
OIT-CSS Rutgers University
dha...@jla.rutgers.edu




Re: [Dovecot] 1.2.9 imap crash with backtrace

2010-01-14 Thread Brandon Davidson
Hi David,

On 1/14/10 3:13 PM, David Halik dha...@jla.rutgers.edu wrote:
 
 FYI, we backed out of the noac change today. When our 20K accounts
 started coming to work the NetApp NFS server was pushing 70% CPU usage
 and 25K NFS Ops/s, which resulted in all kinds of other havoc as normal
 services started becoming slow. This server usally runs around 25% and
 5K, so such a large increase of load was too much to handle.
 
 During the 12 hour window I didn't see a single uid error as expected,
 but the fix was worse than the problem.

We're pretty loathe to go back to noac as well. We will probably disable
process log throttling (mail_log_max_lines_per_sec = 0) to increase the
reindex speed until Timo comes up with a fix for the crash. This should at
least help the users get their mail back in a more reasonable timeframe.

-Brad



Re: [Dovecot] handling filename of compressed messages

2010-01-14 Thread Leonardo Rodrigues

Curtis Maloney escreveu:


Timo -- any tips on helping dovecot deliver compress mails on delivery?

It would solve a lot of problems here, from what I can see, to have a 
deliver plugin that compresses on delivery and sets the Z flag in the 
filename.


   that would be indeed lovely  when this feature gets implemented 
on dovecot delivery agent, i'll definitely stop using postfix virtual 
delivery agent.



--


Atenciosamente / Sincerily,
Leonardo Rodrigues
Solutti Tecnologia
http://www.solutti.com.br

Minha armadilha de SPAM, NÃO mandem email
gertru...@solutti.com.br
My SPAMTRAP, do not email it






[Dovecot] How can I configure dovecot as gmail imap proxy

2010-01-14 Thread Supratik Goswami
Hi,

I want to configure dovecot as gmail imap proxy. If any system in my network
wants to connect to imap.gmail.com,993 it has to go through the dovecot
proxy.

Is it possible to setup such environment with dovecot? If yes, can you
please
help me to configure my dovecot server.

Warm Regards

Supratik


Re: [Dovecot] LDA and POP3/IMAP user_query

2010-01-14 Thread Kirill Miazine

* Michael [2010-01-15 12:12]:

How do I get IMAP+POP3 vs. LDA to use different user_query statements?

The problem is that the input fields are different.


I don't understand what you mean.


IMAP/POP3 is an email address

LDA is a username


Again, sorry, but I don't understand what you mean.


I have written a long statement to try and cater for both however it still
only works 99% of the time, and the remaining 1% fails. The 1% that fails
sees the mail being delivered to the wrong mbox. In this particular case the
same client owned both mboxes so it was ok, but if this had not been the case
things could have gotten real embarrassing.

Think of the following:

abcwidg...@theirdomain.tld  mailuser1
mailus...@adomain.tld   mailuser2

Now when using the Postfix LDA, email for each address is properly delivered
to the specified mbox, however in this case because their is a matching name
for the mbox and the email address lefthand content, the compound SQL query
returns both results and the LDA will use the first one, which in this case
was the wrong one.

This is the query used:
user_query = \
SELECT mailboxes.username AS user, mailboxes.uid, mailboxes.gid, \
concat('*:storage=',mailquota,'M') AS quota_rule \
FROM mailboxes JOIN accounts ON accounts.username = mailboxes.username \
WHERE ((mailboxes.username = '%n' AND accounts.active='1') || \
(mailboxes.email = '%u' AND mailboxes.active='1' AND accounts.active='1') || \
(mailboxes.email = CONCAT('@','%d') AND mailboxes.active='1' \
AND (SELECT COUNT(email) FROM mailboxes WHERE email='%u') = '0'))


Eeek. This wasn't pretty. I've reformatted the query to make it more
readable.

SELECT
mailboxes.username AS user,
mailboxes.uid,
mailboxes.gid,
concat('*:storage=',mailquota,'M') AS quota_rule 
FROM

mailboxes JOIN accounts
ON accounts.username = mailboxes.username
WHERE
((mailboxes.username = '%n' AND accounts.active='1') ||
(mailboxes.email = '%u' AND mailboxes.active='1' AND accounts.active='1') ||
(mailboxes.email = CONCAT('@','%d') AND mailboxes.active='1' AND
(SELECT COUNT(email) FROM mailboxes WHERE email='%u') = '0'));

A suggestion is that you replace the first line after WHERE with

((mailboxes.username = '%u' AND accounts.active='1') ||

That is, you replace %n with %u.


which additionally caters for the few catch alls our users have.

I think this is a massive oversight in the design of Dovecot to use one query
to for 2 separate and distinct processes, that both use different parameters.


I think this is a massive oversight in the design of your query.

In any case, you can use CASE ... WHEN ... and check whether '%s'
(service) is deliver (for LDA) or not...


From what I can tell it seems to assume that a mail system will always use
usern...@domain addresses, and never anything more arbitrary.


What is the format of mailboxes.username in your setup? Will it be
unique?

--
-- Kirill Miazine k...@krot.org