Re: [Dovecot] How do I use sieve to move bounces?

2007-09-06 Thread Jef Driesen

Jef Driesen wrote:
How can I use sieve to move bounces and non delivery reports (i.e. 
anything with an empty envelope from) to a special mailbox? I placed 
this snippet at the start of my sieve script


require [envelope, fileinto];
if envelope :is from  {
 fileinto INBOX.Reports;
 stop;
}

But mails are not moved to the reports mailbox, and they are still 
processed by the rest of the script.


To answer my own question, this script seems to work for me:

if header :is Return-Path  {
   fileinto INBOX.Reports;
   stop;
}



[Dovecot] alert function, V2

2007-09-06 Thread Stewart Dean
I guess the alert function is not part of the spec, because it appears 
to be unimplemented in Dovecot, even though most clients implement it.


Timo, I would hope this would be easy to implement, and it's 
functionality that will be valuable to every installation.  Here's why.


America recently had the tragedy of a shooting rampage on a large 
university campus (yes, America should do something about the violence 
and free access to guns in our culture/society).  What was worse was 
that, due to the lack of an emergency notification process, some 20+ 
people died needlessly.  Now all college and university administration 
are scrambling to set up emergency notification processes.


Our first take on this is a massive all-hands mailing list, but
a) best case, it would take 15 minutes (and as much as an hour) to get 
to everybody's mailbox.

b) users would have to read through their mail and stumble on the message

What's needed is an in-your-face unavoidable alert, and the UWIMAP 
alert functionality provides this.  As I recall, you touch just about 
anything in your IMAP client and there's a popup message in the middle 
of the client IMAP window...and it happens repeatedly.  We tried it back 
3-4 years ago and found it too annoying to use.  For this purpose, it's 
perfect.  The wy UWIMAP did it, the presence of the file 
/etc/imapd.alert triggers it, and the text in that file is transmitted 
to the client.  The message has to be short, a one-liner for a small 
popup window, but this could be a pointer to a shared system message folder.


Of course, DC could sense the activation of the alert in some other 
fashion that the presence of a file.  Ideally, whatever activates the 
alert function should be able to be turned on remotely; I had in mind to 
do it using a mail aliases that is a pipe to a executable...


What say you?
--

Stewart Dean, Unix System Admin, Henderson Computer Resources
Center of Bard College, Annandale-on-Hudson, New York  12504
[EMAIL PROTECTED]  voice: 845-758-7475, fax: 845-758-7035


Re: [Dovecot] securing dovecot proxy connections

2007-09-06 Thread Ken A

WJCarpenter wrote:

ka per another current thread (o/s tuning for imap), I've installed
ka imapproxy, and it supports starttls to the backend imap server. It
ka doesn't use encryption on the incoming connections though, since
ka they are presumably from localhost (squirrelmail).  Ken

That's an interesting thought.  Have you actually gotten its STARTTLS
to work?  I tried it a couple days ago with no luck, but maybe I just
didn't try hard enough.


I had a bit of trouble with it as well. I set it to connect to the 
dovecot on 993 and listen on 143 locally. That had an odd effect. It 
connected to dovecot, but failed to LISTEN locally, and nothing was 
logged about this failure! After trying various other things, I changed 
the settings to 143 for both and it worked. Then I set force tls = 
yes, pointed the config options at the bottom of the config file to 
valid cert,ca,key, etc.. and yes, it works great. tcpdump verifies that 
it's using TLS now.


Ken


--
Ken Anderson
Pacific.Net


Re: [Dovecot] Dovecot + Sieve

2007-09-06 Thread pod
 DM == Daniel L Miller [EMAIL PROTECTED] writes:

DM I did make a discovery - hardcoding the sieve path, without
DM variables, e.g. sieve = /var/mail/amfes.com/dmiller/sieve -
DM worked!

DM Is there a problem using the domain / user variables in the
DM configuration file?

get_sieve_path() from cmusieve-plugin.c doesn't do % expansions.  The
result of get_sieve_path() names a file that gets processed.

Here's what it does:

  - look at sieve var
- if it is set but empty no sieve processing will occur at all
  (i.e. sieve_global_path, see below, will _not_ be considered)
- if it doesn't begin with a '/' prepend $HOME/
- if it is not set then use ~/.dovecot.sieve (which is equivalent to
  $HOME/.dovecot.sieve in this case)

If the file found above doesn't exist (strictly speaking if stat(2)
returns a negative result) use sieve_global_path.  If that is not set, for
backwards compatibilty, use global_script_path.  Note that whatever gets
returned by get_sieve_path() is expected to name a _file_ containing
sieve statements.


Re: [Dovecot] alert function, V2

2007-09-06 Thread Charles Marcus

On 9/6/2007, Stewart Dean ([EMAIL PROTECTED]) wrote:
America recently had the tragedy of a shooting rampage on a large 
university campus (yes, America should do something about the 
violence and free access to guns in our culture/society).  What was 
worse was that, due to the lack of an emergency notification process, 
some 20+ people died needlessly.


Actually, if faculty and students were allowed to legally carry, the 
bastard probably wouldn't have gotten off more than a few shots...


An armed society is a polite society...

Tyrants love a disarmed populace...

But what this has to do with dovecot is beyond me - please keep 
political opinions off the list to avoid the kind of flame-fest that 
this could easily turn into...


--

Best regards,

Charles


Re: [Dovecot] alert function, V2

2007-09-06 Thread Stewart Dean

If you want to discuss politics, please contact me directly and off-list.

--

Stewart Dean, Unix System Admin, Henderson Computer Resources 
Center of Bard College, Annandale-on-Hudson, New York  12504  
[EMAIL PROTECTED]  voice: 845-758-7475, fax: 845-758-7035




[Dovecot] Error: corrupted index file

2007-09-06 Thread Jordi Espasa Clofent

Hi all,

I see the next error at dovecot.log:

dovecot: Sep 06 17:57:27 Error: IMAP([EMAIL PROTECTED]): 
Corrupted index file /var/vmail/opengea.org/jordi.espasa/.Dov

ecot/dovecot.index: Duplicate header extension keywords

¿Why this error is producted?

--
Thanks,
Jordi Espasa Clofent


Re: [Dovecot] passdb/userdb args

2007-09-06 Thread Daniel L. Miller

Thank you - I was thinking perhaps a wrapper script would be necessary.

How do the multiple userdb/passdb sections work?  Once a match is found, 
does processing stop?  Or are multiple matches combined?  Does the 
userdb static set defaults which could be used for the userdb ldap?


François Wautier wrote:

Hi,

I was face with a similar problem a couple of month ago. If I recall 
correctly, the system needed the home variable but it was empty because it 
could not be retrieved in the Actuve Directory tree.


Here is what I did (adapted to your setup. I think)

In my ldap setup I set
pass_attrs = mail=userdb_home



In the main conf file I did

mail_executable = /usr/libexec/dovecot/special.sh

And in special.sh I put

#!/bin/sh
myuser=`echo $HOME|sed s/@.*$//`
domain=`echo $HOME|sed s/^.*@//`
export USER=$HOME
export HOME=/var/mail/${domain}/${myuser}
export MAIL=maildir:${HOME}
exec /usr/libexec/dovecot/imap


Voila!

Make sure that special.sh is where mail_executable says it is And don't 
forget to chmod a+x it.


Hope this helps
François


On Thursday 06 September 2007 06:20, Daniel L. Miller wrote:
  

I'm a bit unclear on these - give me a moment to ramble on.  I should
mention I'm using version 1.0.3, my primary backend is LDAP, and I do
NOT want to store user mail folders in my LDAP directory.

I currently have the following:

default_mail_env = maildir:/var/mail/%d/%n
passdb ldap {
args = /etc/dovecot/dovecot-ldap.conf
}
# Instructions for deliver state a userdb is still required if using
prefetch
userdb ldap {
args = /etc/dovecot/dovecot-ldap.conf
}
userdb prefetch {
}

My dovecot-ldap.conf is pretty simple - the trimmed version is:
hosts = localhost
auth_bind = no
user_attrs = %d/%n=mail
user_filter = (mail=%u)
pass_attrs = ((userPassword=password)(mail=%u))
user_global_uid = 5000
user_global_gid = 8

I recognize that the pass_attrs is incorrect for a prefetch config - but
I couldn't get it to work.  My mail folder structure is
/var/mail/domain/username.

If, under 1.0.3, I can't use the %d/%n variables to build the
user/home/mail parameters in the LDAP config, can I do it in the
configuration stanza?  Something like:

passdb ldap{
args = home=%dn/%n mail=%d/%n /etc/dovecot/dovecot.conf
}




--
Daniel
A spam trap for your crawler pleasure: [EMAIL PROTECTED]


Re: [Dovecot] Quota bug in deliver?

2007-09-06 Thread Doug Council

On Thu, 6 Sep 2007, Marcin Michal Jessa wrote:

I do use prefetch, I have an separate query, too. Without that the
quota fails completely.

Having both statements and prefetch, the quota works fine with IMAP
and deliver when I have no quota line in the plugin section, when I
add the line (see !!MARK!! below), the deliver takes the quota from
that line instead of the database information. IMAP uses the
information from the database all the time, no matter if I have a
quota line in the config.
[...]

plugin {
  # !!MARK!!
  # deliver seems to use the userdb quota only when I don't have the
following line
  quota = maildir:storage=102400:messages=1000
  acl = vfile:/etc/dovecot/acls
  trash = /etc/dovecot/dovecot-trash.conf
}

I discovered something similar. User's quota from the DB was not used
when the user's quota was over the limit of the plugin part.
According to the docs the db quota values should always come first
before the plugin part but it does not.


I think you might be experiencing a bug that Timo recently fixed:

http://www.dovecot.org/list/dovecot/2007-August/025016.html

Right now, it is only available in HG, but should be included in 1.0.4.

-Doug


Re: [Dovecot] imap process consuming 100% CPU (Dovecot 1.0.3)

2007-09-06 Thread Jackie Hunt
 
 Hi,
 
  I have yet another problem with Dovecot: sometimes (rarely, maybe
  once every few days) one of the imap processes will 'hang',
  consuming all available CPU time. It does not seem to 'finish' in any
  reasonable amount of time (in one instance I waited a few days). 

 
  Robert Tomanek mailto:[EMAIL PROTECTED]

We have also seen this behavior, running Dovecot 1.0 on AIX.  
Thanks for your debug work on it Robert.

Jackie
---
Jackie Hunt   
ACNSVoice:  (970) 663-3789 
Colorado State University   FAX:(970) 491-1958
Fort Collins, CO  80523 Email:  [EMAIL PROTECTED]


Re: [Dovecot] o/s tuning for imap

2007-09-06 Thread Kyle Wheeler

On Tuesday, September  4 at 08:26 PM, quoth Russell E. Meek:
OS related tweaks, probably not.  However you could utilize a imap 
proxy such as up-imapproxy which if using FreeBSD is in ports.


Visit: http://www.imapproxy.org/ to learn more.

This should relieve the load on Dovecot.


We found that on our server, *not* using imapproxy improved our 
performance. We used to use imapproxy to great effect when we were 
using BincIMAP, but Dovecot is so darn fast (and caches its own 
authentication) that all imapproxy added was additional inter-process 
communication (translation: slower than just using Dovecot alone).


~Kyle
--
Only a mediocre person is always at his best.
   -- Somerset Maugham


pgp4jX7cgtYNt.pgp
Description: PGP signature


Re: [Dovecot] o/s tuning for imap

2007-09-06 Thread Kyle Wheeler

On Tuesday, September  4 at 12:16 PM, quoth Ken A:
I'm switching from a pop3 only dovecot install to a pop3/imap install and 
I'm wondering how many connections every 100 'normal' imap users might 
have/keep open?


Mmmm, I usually estimate that most of the time users keep one 
connection open. Occasionally some clients (like Mail.app with the 
IDLE plugin) keep two or three open at all times. Then of course, 
there's occasional bursts where a client may open ten or more 
connections, though because IMAP is asynchronous that's technically 
unnecessary unless you're doing it to reduce latency (unlikely), but 
some clients do it anyway.


So I'd leave a max of around 300-500 connections at minimum.

I'm wondering if I need to tweak any o/s related things, like 
time_wait, etc. Any pointers would be greatly appreciated.


The thing to keep in mind about IMAP versus POP is that more folks 
will be keeping things on your server. That means you're going to need 
more disk space and (particularly if you use a Maildir backend) more 
inodes, and you're going to want to reexamine your filesystem and 
mount options. For example, if you haven't already, turn off atime 
updating. It's entirely useless with Dovecot, and will just slow you 
down.


~Kyle
--
The community which does not protect its humblest and most hated 
member in the free utterance of his opinions, no matter how false or 
hateful, is only a gang of slaves. If there is anything in the 
universe that can't stand discussion, let it crack.

 -- Wendell Phillips, 1863


pgpHYF2GIrw8t.pgp
Description: PGP signature


Re: [Dovecot] o/s tuning for imap

2007-09-06 Thread Ken A

Kyle Wheeler wrote:

On Tuesday, September  4 at 08:26 PM, quoth Russell E. Meek:
OS related tweaks, probably not.  However you could utilize a imap 
proxy such as up-imapproxy which if using FreeBSD is in ports.


Visit: http://www.imapproxy.org/ to learn more.

This should relieve the load on Dovecot.


We found that on our server, *not* using imapproxy improved our 
performance. We used to use imapproxy to great effect when we were using 
BincIMAP, but Dovecot is so darn fast (and caches its own 
authentication) that all imapproxy added was additional inter-process 
communication (translation: slower than just using Dovecot alone).


~Kyle


My understanding is that webmail clients like squirrelmail open, then 
close connections on each http transaction that requires a connection to 
the imap server, so imapproxy's caching of connections saves you having 
to re-open connections to the backend server. That's essentially why my 
original question included what about time_wait, since I was concerned 
that squirrelmail could leave a LOT of connections in a TIME_WAIT state.


Thanks for your other suggestions,
Ken


--
Ken Anderson
Pacific.Net


Re: [Dovecot] dovecot dspam plugin using libdspam

2007-09-06 Thread Andreas Schneider
 We want to use signatures if it is present, if not, then we can use the
 raw message. I would suggest the code do an if on the present of the
 signature. I haven't yet looked a the code. Maybe tomorrow. (I am a bit
 behind on my schedule.)

Ok, I've added now support to set the spam folder and
the trash folder in the dovecot configuration file.

git clone git://git.cynapses.org/dovecot-dspam-plugin.git \
dovecot-dpsam-plugin

 
 Trever
 


-- andreas

-- 
http://www.cynapses.org/ - cybernetic synapses




signature.asc
Description: OpenPGP digital signature


Re: [Dovecot] Dovecot + Sieve - and passdb/userdb

2007-09-06 Thread Daniel L. Miller
Thanks to everybody who chipped in.  I came up with a workaround that 
seems fairly simple - I'm actually worried that it's working too well!


I'm using a pure virtual user setup, storing a minimal amount in LDAP.  
The whole mail tree is stored under /var/mail, and it's all owned by 
vmail.mail.  For purely selfish reasons, I'm doing everything possible 
to avoid storing the mail folder in LDAP.  So I came up with the following:


Postfix is capable of generating the mail folder path via LDAP 
manipulation, and I was working on some wrapper scripts for delivery 
agents - but since I've now totally converted to Dovecot's deliver agent 
that's immaterial.


 passdb ldap, just looking up the password.
 userdb static {
   args = uid=5000 gid=8 home=/var/mail/%d/%n mail=/var/mail/%d/%n 
allow_all_users=yes

 }
 plugin {
   sieve = sieve
 }

Deliver + sieve is working great.  By setting the sieve variable to 
sieve, a non-hidden file, it doesn't appear in the folder list.  I 
made a similar change to pysieved to use a non-hidden folder - in 
combination with avelsieve and squirrelmail I now have a 
user-maintainable server-side filter solution.  Awesome!


Is there a hidden gotcha I'm missing here?  It's doing exactly what I 
want!


P.S.  what's the nice parameter that can be listed in args?


--
Daniel
A spam trap for your crawler pleasure: [EMAIL PROTECTED]


Re: [Dovecot] passdb/userdb args

2007-09-06 Thread François Wautier

Hi,

On Friday 07 September 2007 01:42, Daniel L. Miller wrote:
 Thank you - I was thinking perhaps a wrapper script would be necessary.


You are welcome.

 How do the multiple userdb/passdb sections work?  Once a match is found,
 does processing stop?  Or are multiple matches combined?  Does the
 userdb static set defaults which could be used for the userdb ldap?


Not sure here. I only use Active Directory (i.e. LDAP) for authentication. 

I remember trying, in vain, to use the static userdb, so I guess (and 
expected) the processing to stop on the first match. I am not sure how you 
would combine things with the deny=yes setting for example.

Cheers,
François



 François Wautier wrote:
  Hi,
 
  I was face with a similar problem a couple of month ago. If I recall
  correctly, the system needed the home variable but it was empty because
  it could not be retrieved in the Actuve Directory tree.
 
  Here is what I did (adapted to your setup. I think)
 
  In my ldap setup I set
  pass_attrs = mail=userdb_home
 
 
 
  In the main conf file I did
 
  mail_executable = /usr/libexec/dovecot/special.sh
 
  And in special.sh I put
 
  #!/bin/sh
  myuser=`echo $HOME|sed s/@.*$//`
  domain=`echo $HOME|sed s/^.*@//`
  export USER=$HOME
  export HOME=/var/mail/${domain}/${myuser}
  export MAIL=maildir:${HOME}
  exec /usr/libexec/dovecot/imap
 
 
  Voila!
 
  Make sure that special.sh is where mail_executable says it is And
  don't forget to chmod a+x it.
 
  Hope this helps
  François
 
  On Thursday 06 September 2007 06:20, Daniel L. Miller wrote:
  I'm a bit unclear on these - give me a moment to ramble on.  I should
  mention I'm using version 1.0.3, my primary backend is LDAP, and I do
  NOT want to store user mail folders in my LDAP directory.
 
  I currently have the following:
 
  default_mail_env = maildir:/var/mail/%d/%n
  passdb ldap {
  args = /etc/dovecot/dovecot-ldap.conf
  }
  # Instructions for deliver state a userdb is still required if using
  prefetch
  userdb ldap {
  args = /etc/dovecot/dovecot-ldap.conf
  }
  userdb prefetch {
  }
 
  My dovecot-ldap.conf is pretty simple - the trimmed version is:
  hosts = localhost
  auth_bind = no
  user_attrs = %d/%n=mail
  user_filter = (mail=%u)
  pass_attrs = ((userPassword=password)(mail=%u))
  user_global_uid = 5000
  user_global_gid = 8
 
  I recognize that the pass_attrs is incorrect for a prefetch config - but
  I couldn't get it to work.  My mail folder structure is
  /var/mail/domain/username.
 
  If, under 1.0.3, I can't use the %d/%n variables to build the
  user/home/mail parameters in the LDAP config, can I do it in the
  configuration stanza?  Something like:
 
  passdb ldap{
  args = home=%dn/%n mail=%d/%n /etc/dovecot/dovecot.conf
  }


Re: [Dovecot] dovecot dspam plugin using libdspam

2007-09-06 Thread Andraž 'ruskie' Levstik
On 00:34:23 2007-09-07 Andreas Schneider [EMAIL PROTECTED] wrote:
  We want to use signatures if it is present, if not, then we can use
  the raw message. I would suggest the code do an if on the present of
  the signature. I haven't yet looked a the code. Maybe tomorrow. (I am
  a bit behind on my schedule.)
 
 Ok, I've added now support to set the spam folder and
 the trash folder in the dovecot configuration file.
 
 git clone git://git.cynapses.org/dovecot-dspam-plugin.git \
 dovecot-dpsam-plugin
 
Would it be possible to specify multiple spam folders?

i.e. spam, Spam, SPAM, junk, Junk, etc... ?

That would be very usefull...

--
Andraž ruskie Levstik
Source Mage GNU/Linux Games grimoire guru
Geek/Hacker/Tinker

Hacker FAQ: http://www.plethora.net/%7eseebs/faqs/hacker.html
Be sure brain is in gear before engaging mouth.

Key id = F4C1F89C
Key fingerprint = 6FF2 8F20 4C9D DB36 B5B6  F134 884D 72CC F4C1 F89C