Re: [Dovecot] First time Dovecot user, really impressed so far. What is best IMAP enabled webmail package to go with Dovecot?

2010-01-06 Thread aja-lists

On 01/04/2010 10:00 PM, Stan Hoeppner wrote:

Hi,


So, what's the best FOSS IMAP enabled web mail front end with a
modern look/feel?  I'd like to run it on lighttpd, which I'm already
 using, not apache.


I'm using RoundCube 0.3.x (from the RoundCube website) + mysql + apache2
on Debian Lenny, and I'm very pleased with it so far.

In the RC configuration I have set the "preview pane" on by default, I
don't understand why it was off by default (The comment in the config
file even mentions that "preview pane" on is better), so I recommend
doing that too.

And I suggest that you install/enable at least the "address book
compose" plugin, and the "squirrelmail copy prefs" plugins.

I found out that the "squirrelmail copy prefs" RC plugin even converts
the address-books from Squirrelmail :) !!
But note : this plugin apparently works only at the first RC login of an
user, so make sure the "squirrelmail copy prefs" plugin is installed and
configured correctly before you log in as your user.

Make sure you read enough about how to install and configure RC,
and secure at least the directories "temp" and "logs", and make sure
that the RC .htaccess files work with your lighttpd installation.

If you try Roundcube for a while you might find out nice features,
like the "del" key works for deleting an email, drag and drop is
possible, and there's "email auto completion" within the email compose
window, and you can add email-addresses in emails to the address-book
with just one mouse click.

Drawbacks I've found in RoundCube so far : I couldn't find out how to 
toggle individual emails in the mailbox window, and the search options 
seem rather limited compared to Squirrelmail, and RoundCube only has one 
official skin/theme included.


(And for the record : imho Squirrelmail is a very decent webmail,
too bad that the very nice themes for it are closed source and
commercially priced, and I really dislike installing/configuring and
using Horde)

Regards,
Adrian




Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Noel Butler
On Wed, 2010-01-06 at 12:43 -0500, Jerry wrote:


> 
> Ubuntu is an ancient African word meaning, "I can’t install Debian."


Jerry, you debian people steal everything, its...  Ubuntu is an ancient
African word meaning, "I can’t install Slackware."  :P



--

Kind Regards,
SSA Noel Butler
L.C.P No. 251002 

This Email, including any attachments, may contain legally privileged
information, therefore remains confidential and subject to copyright
protected under international law. You may not disseminate or reveal any
part to anyone without the authors express written authority to do so.
If you are not the intended recipient, please notify the sender and
delete all relevance of this message including any attachments,
immediately. Confidentiality, copyright, and legal privilege are not
waived or lost by reason of the mistaken delivery of this message. Only
PDF and ODF documents are accepted, do not send Microsoft proprietary
formatted documents.




Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Noel Butler
On Wed, 2010-01-06 at 14:15 +0100, Thomas Wolf wrote:

> Timo Sirainen schrieb:
> > On 5.1.2010, at 13.55, Charles Marcus wrote:
> > 
> >> In other words, would you really have to remember to run dovecot -n -c
> >> per your example above?
> >>
> >> I ask because I've never used it with a config file in a non-default
> >> location.
> >>
> >> If this is correct, I would consider it a bug - dovecot -n should know
> >> which config file it is using, and outout accordingly.
> > 
> > How would it know what config file Dovecot is using? The config file needs 
> > to be read before it even knows where the base_dir is. 
>  > What if there are multiple Dovecots running? The main problem
>  > here is that Ubuntu for some reason decided to use dovecot-postfix.conf
>  > instead of the default dovecot.conf..
> 
> Depends on the package that is installed:
> 
> t...@mail2:~$ apt-cache search dovecot
> dovecot-common - secure mail server that supports mbox and maildir mailboxes
> dovecot-dev - header files for the dovecot mail server
> dovecot-imapd - secure IMAP server that supports mbox and maildir mailboxes
> dovecot-pop3d - secure POP3 server that supports mbox and maildir mailboxes
> dovecot-postfix - full mail server stack provided by Ubuntu server team
> 
> The package "dovecot-postfix" installs and uses dovecot-postfix.conf but
> unfortunately also puts the default dovecot.conf in /etc/dovecot
> (driving everyone crazy who blindly follows howtos editing
> dovecot.conf). Highly recommended to remove/rename dovecot.conf in this
> configuration.
> 
> Thomas
> 


Then complain to ubuntu, how is it Timo's problem they screwed, no,
rooted it to hell and back again.


--
Kind Regards,
SSA Noel Butler
L.C.P No. 251002 

This Email, including any attachments, may contain legally privileged
information, therefore remains confidential and subject to copyright
protected under international law. You may not disseminate or reveal any
part to anyone without the authors express written authority to do so.
If you are not the intended recipient, please notify the sender and
delete all relevance of this message including any attachments,
immediately. Confidentiality, copyright, and legal privilege are not
waived or lost by reason of the mistaken delivery of this message. Only
PDF and ODF documents are accepted, do not send Microsoft proprietary
formatted documents.




[Dovecot] Dovecot(MYSQL)/Lda/Postfix/Postfixadmin and Quota limit per user

2010-01-06 Thread leo

== DOVECOT.CONF =
# 1.2.8: /usr/local/etc/dovecot.conf
# OS: FreeBSD 8.0-STABLE i386  ufs
log_path: /var/log/dovecot-error.log
info_log_path: /var/log/dovecot.log
protocols: imap imaps pop3 pop3s
ssl_cert_file: /etc/ssl/dovecot/cert.pem
ssl_key_file: /etc/ssl/dovecot/key.pem
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/local/libexec/dovecot/imap-login
login_executable(imap): /usr/local/libexec/dovecot/imap-login
login_executable(pop3): /usr/local/libexec/dovecot/pop3-login
login_user: postfix
login_greeting: Server ready.
login_processes_count: 4
verbose_proctitle: yes
first_valid_uid: 6000
last_valid_uid: 6000
first_valid_gid: 6000
last_valid_gid: 6000
mail_privileged_group: mail
mail_location: maildir:/home/vmail/%d/%n/Maildir
mail_debug: yes
mail_executable(default): /usr/local/libexec/dovecot/imap
mail_executable(imap): /usr/local/libexec/dovecot/imap
mail_executable(pop3): /usr/local/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3): quota
mail_plugin_dir(default): /usr/local/lib/dovecot/imap
mail_plugin_dir(imap): /usr/local/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3
imap_client_workarounds(default): delay-newmail netscape-eoh 
tb-extra-mailbox-sep
imap_client_workarounds(imap): delay-newmail netscape-eoh 
tb-extra-mailbox-sep

imap_client_workarounds(pop3):
pop3_uidl_format(default): %08Xu%08Xv
pop3_uidl_format(imap): %08Xu%08Xv
pop3_uidl_format(pop3): %08Xu%08Xu
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
lda:
 postmaster_address: postmas...@example.com
 log_path: /var/log/dovecot-deliver.log
 info_log_path: /var/log/dovecot-deliver.log
 mail_plugins: quota
 mail_plugin_dir: /usr/local/lib/dovecot/lda
 quota_full_tempfail: yes
 deliver_log_format: msgid=%m: %$
 sendmail_path: /usr/sbin/sendmail
 rejection_reason: Twoja wiadomosc do <%t> zostala automatycznie 
odrzucona:%n%r

 auth_socket_path: /var/run/dovecot/auth-master
auth default:
 mechanisms: plain login
 user: nobody
 username_format: %Lu
 verbose: yes
 debug: yes
 passdb:
   driver: sql
   args: /usr/local/etc/dovecot-sql.conf
 userdb:
   driver: static
   args: uid=6000 gid=6000 home=/home/vmail/%d/%n allow_all_users=yes
 userdb:
   driver: sql
   args: /usr/local/etc/dovecot-sql.conf
 socket:
   type: listen
   client:
 path: /var/spool/postfix/private/auth
 mode: 432
 user: postfix
 group: postfix
   master:
 path: /var/run/dovecot/auth-master
 mode: 432
 user: vmailer
 group: vmailer
plugin:
 quota: maildir:User quota
 quota_rule: *:storage=4M
 convert_mail: mbox:%h/mboxmail
dict:
 quotadict: mysql:/usr/local/etc/dovecot-dict-quota.conf

== DOVECOT-SQL.CONF =
driver = mysql
connect = host=localhost dbname=xxx user=xxx password=xxx
default_pass_scheme = MD5
user_query = SELECT '/home/vmail/%d/%n' as home, 
'maildir:/home/vmail/%d/%n' as mail, 6000 AS uid, 6000 AS gid, 
concat('*:bytes=', mailbox.quota) AS quota_rule FROM mailbox WHERE 
mailbox.username = '%u' AND active = '1'
password_query = SELECT password, '/home/vmail/%d/%n' as home, 
'maildir:/home/vmail/%d/%n' as mail, 6000 AS uid, 6000 AS gid, 
concat('dict:bytes=', quota) AS quota_rule FROM mailbox WHERE username = 
'%u' AND active = '1'


=== DOVECOT.LOG AND DELIVER LOG=

[r...@frodo /usr/local/etc]# tail -f /var/log/dovecot.log
Jan 06 15:07:38 auth(default): Info: new auth connection: pid=44519
Jan 06 15:07:38 auth(default): Info: master in: USER1   
ro...@example.com service=deliver
Jan 06 15:07:38 auth(default): Info: master out: USER   1   
ro...@example.com uid=6000gid=6000
home=/home/vmail/example.com/round


[r...@frodo /usr/local/etc]# tail -f /var/log/dovecot-deliver.log
Jan 06 15:07:38 deliver(ro...@example.com): Info: Module loaded: 
/usr/local/lib/dovecot/lda/lib10_quota_plugin.so

Jan 06 15:07:38 deliver(ro...@example.com): Info: auth input: uid=6000
Jan 06 15:07:38 deliver(ro...@example.com): Info: auth input: gid=6000
Jan 06 15:07:38 deliver(ro...@example.com): Info: auth input: 
home=/home/vmail/example.com/round
Jan 06 15:07:38 deliver(ro...@example.com): Info: Quota root: name=User 
quota backend=maildir args=
Jan 06 15:07:38 deliver(ro...@example.com): Info: Quota rule: root=User 
quota mailbox=* bytes=4194304 messages=0
Jan 06 15:07:38 deliver(ro...@example.com): Info: maildir: 
data=/home/vmail/example.com/round/Maildir
Jan 06 15:07:38 deliver(ro...@example.com): Info: maildir++: 
root=/home/vmail/example.com/round/Maildir, index=, control=, 
inbox=/home/vmail/example.com/round/Maildir
Jan 06 15:07:38 deliver(ro...@example.com): Info: Namespace : Using 
permissions from /home/vmail/example.com/round/Maildir: mode=0700 gid=-1
Jan 06 15:07:39 deliver(ro...@example.

Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Thomas Berezansky
Literally, in a recent case with me. Debian (any build I could get my  
hands on, I tried quite a few) would literally not install on a box. I  
was lucky if the installer ran, let alone did anything. Spent a week  
trying.


Ubuntu installed on the first try and was up and running after fifteen  
minutes.


Thomas Berezansky
Merrimack Valley Library Consortium


Quoting Jerry :

On Wed, 06 Jan 2010 14:41:32 -0200 Eduardo M KALINOWSKI  


articulated:


On Qua, 06 Jan 2010, Pascal Volk wrote:
> Sorry, but I really can't understand, why the most unbuntu users seems
> to be unable to read AND understand so simple written documentation. :(


If they could, they'd be running debian. :-)



Ubuntu is an ancient African word meaning, "I can’t install Debian."

--
Jerry
ges...@yahoo.com






Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Jerry
On Wed, 06 Jan 2010 14:41:32 -0200 Eduardo M KALINOWSKI 

articulated:

> On Qua, 06 Jan 2010, Pascal Volk wrote:
> > Sorry, but I really can't understand, why the most unbuntu users seems
> > to be unable to read AND understand so simple written documentation. :(
> 
> 
> If they could, they'd be running debian. :-)
> 

Ubuntu is an ancient African word meaning, "I can’t install Debian."

-- 
Jerry
ges...@yahoo.com



Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Anthony Nedland

Anthony Nedland wrote:

Eduardo M KALINOWSKI wrote:

On Qua, 06 Jan 2010, Pascal Volk wrote:

Sorry, but I really can't understand, why the most unbuntu users seems
to be unable to read AND understand so simple written documentation. :(



If they could, they'd be running debian. :-)



Distro discussion aside, I think I know for sure what my issue is at 
this point.
I looked at the tables I have in mysql. The show du...@baldtel.com in 
the username field. Every email username is listed as u...@domain. 
There is also a domain field that just has baldtel.com in it. No @ there.
My logs are showing that when the server looks for a username to 
send/receive as, it refuses anything like duane, because it's looking 
for the username du...@baldtel.com. That's what I must have to change 
right?
When someone tries to send from an external domain to this address 
they get the server bounce back message that duane doesn't exist. When 
I log into the POP side of the server it works because I use the 
username with the @.

Does this make sense at all?





You know what?
I got it.
Awesome.
Thanks for the help folks.


Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Guy
2010/1/6 Eduardo M KALINOWSKI 
>
> 
> If they could, they'd be running debian. :-)
> 



  insert flame from ubuntu admin ;)


I tried the postfix-dovecot package once and dumped it. Found it easier
using the separate packages. I'd also recommend installing Dovecot from
source under Ubuntu as they're lagging well behind. Karmic still only has
Dovecot 1.1.11.

Cheers
Guy

-- 
Don't just do something...sit there!


Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Anthony Nedland

Eduardo M KALINOWSKI wrote:

On Qua, 06 Jan 2010, Pascal Volk wrote:

Sorry, but I really can't understand, why the most unbuntu users seems
to be unable to read AND understand so simple written documentation. :(



If they could, they'd be running debian. :-)



Distro discussion aside, I think I know for sure what my issue is at 
this point.
I looked at the tables I have in mysql. The show du...@baldtel.com in 
the username field. Every email username is listed as u...@domain. There 
is also a domain field that just has baldtel.com in it. No @ there.
My logs are showing that when the server looks for a username to 
send/receive as, it refuses anything like duane, because it's looking 
for the username du...@baldtel.com. That's what I must have to change right?
When someone tries to send from an external domain to this address they 
get the server bounce back message that duane doesn't exist. When I log 
into the POP side of the server it works because I use the username with 
the @.

Does this make sense at all?



Re: [Dovecot] virtual mailbox / INTHREAD use case, issues, questions

2010-01-06 Thread David Abrahams
At Wed, 6 Jan 2010 14:17:40 +0200,
Timo Sirainen wrote:
> 
> On 4.1.2010, at 20.47, David Abrahams wrote:
> 
> > 1. I had to manually create the virtual folder for all my users or
> >   they couldn't access their mail at all.  Is this fixed in 2.0?
> 
> No.

OK, is it considered a bug that should be addressed?  IMO there should
at least be a way to tell dovecot to ignore the non-existence of a
particular folder.

> > 2. My users were getting errors when accessing via POP3.  The possible
> >   meaning of such a virtual folder under POP3 is lost on me, but I
> >   had to enable the virtual plugin for that protocol too.  I think
> >   that should at least be in the documentation, or better yet the
> >   requirement should that it be enabled for POP3 should be dropped.
> 
> I think you could put the virtual namespace inside protocol imap {} section.

I'm pretty sure I tried that and it didn't work for some reason.
Unfortunately I don't remember the reason, so I could be mistaken.

> > 3. I couldn't get the virtual "conversation view" inbox to show any
> >   messages.  But maybe that's because of a possible issue I describe
> >   below with x-mailbox

> > 5. The "all" virtual mailbox would only show 89 messages.  I switched
> >   it to be a mirror of my "archive" mailbox and the number started to
> >   look more reasonable.  This could be the "lots of mailboxes" bug
> >   describe in
> >   http://dovecot.org/list/dovecot-news/2009-December/000145.html
> 
> "lots of mailboxes" should cause error to be logged.

What does the error look like?  I could search my logs for it.

> > 7. I tried to create an IMAP search, rather than a virtual folder,
> >   that looked for x-mailbox INBOX header like the virtual folder
> >   does.  It too came up empty.  It doesn't exactly surprise me
> >   because I don't see an x-mailbox header in any of these messages.
> 
> x-mailbox doesn't use a header, it uses the actual mailbox name
> where the message exists.

Oh... what if the message exists in multiple mailboxes?  Typically
anything in INBOX can also be found in my "all mail" archive.

I guess that means it's crucial that, whatever else I do, INBOX should
be part of the "all mail" virtual folder in order for this to work.  I
didn't quite understand that before, and I think it's important to
have a description somewhere of how x-mailbox works that would help me
to get to that conclusion.  Certainly the existing description at
http://wiki.dovecot.org/Plugins/Virtual that it represents the
"original" mailbox isn't adequate for that purpose.

> > Lastly, I want to report that for me, the speed of these IMAP searches
> > doesn't begin to approach what I can do with mairix if I want a
> > message's entire thread.  I'm happy to use mairix, although it would
> > be nicer not to duplicate that capability if it's already in the
> > server.  But it needs to be fast.  Is there something I can do to make
> > it go faster?
> 
> How slow is it? How many messages do you have? I think it should be pretty 
> fast.

150523 messages in 2.6G

> Anyway, dovecot -n output and contents of dovecot-virtual file could help 
> figuring out what your problem is.

Having got the x-mailbox insight (I think---thanks), I have tried 
the following combinations:

  # ~/Maildir/virtual/INBOX/dovecot-virtual
  INBOX
  zz_archive*
inthread refs x-mailbox inbox

shows only messages in INBOX. THe archives are actually in folders
like zz_archive.2010.01

---

  # ~/Maildir/virtual/all/dovecot-virtual
  INBOX
  zz_archive*
all

  # ~/Maildir/virtual/INBOX/dovecot-virtual
  virtual.all
inthread refs x-mailbox inbox

shows only messages in INBOX

---

  # ~/Maildir/virtual/all/dovecot-virtual
  *
all

  # ~/Maildir/virtual/INBOX/dovecot-virtual
  virtual.all
inthread refs x-mailbox inbox

Appears to hang

---

  # ~/Maildir/virtual/INBOX/dovecot-virtual
  INBOX
  zz_archive.*.*
inthread refs x-mailbox inbox

Appears to hang.  For example, the little pie chart in Apple Mail that
shows mailbox scanning progress is stopped.  Wanderlust gets totally
stuck.

---


# 1.2.8: /usr/local/etc/dovecot.conf
# OS: FreeBSD 6.2-RELEASE amd64  
protocols: imap pop3 imaps pop3s
listen: 64.156.193.20
ssl_ca_file: /etc/ssl/private/network_solutions_ca.crt
ssl_cert_file: /etc/ssl/certs/www.boostpro.com.crt
ssl_key_file: /etc/ssl/private/www.boostpro.com.key
login_dir: /var/run/dovecot/login
login_executable(default): /usr/local/libexec/dovecot/imap-login
login_executable(imap): /usr/local/libexec/dovecot/imap-login
login_executable(pop3): /usr/local/libexec/dovecot/pop3-login
verbose_proctitle: yes
first_valid_gid: 0
mail_privileged_group: mail
mail_location: maildir:~/Maildir
mail_executable(default): /usr/local/libexec/dovecot/imap
mail_executable(imap): /usr/local/libexec/dovecot/imap
mail_executable(pop3): /usr/local/libexec/dovecot/pop3
mail_plugins(default): virtual autocreate
mail_plugins(imap): virtual autocreate
mail_plugins(pop3): virtual
mail_plugin_dir(de

Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Eduardo M KALINOWSKI

On Qua, 06 Jan 2010, Pascal Volk wrote:

Sorry, but I really can't understand, why the most unbuntu users seems
to be unable to read AND understand so simple written documentation. :(



If they could, they'd be running debian. :-)



--
The young lady had an unusual list,
Linked in part to a structural weakness.
She set no preconditions.

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



Re: [Dovecot] First time Dovecot user, really impressed so far. What is best IMAP enabled webmail package to go with Dovecot?

2010-01-06 Thread Steve

 Original-Nachricht 
> Datum: Wed, 06 Jan 2010 10:31:18 -0600
> Von: Stan Hoeppner 
> An: Dovecot Mailing List 
> Betreff: Re: [Dovecot] First time Dovecot user, really impressed so far. What 
> is best IMAP enabled webmail packageto go with Dovecot?

> David Abrahams put forth on 1/5/2010 1:44 PM:
> > At Mon, 4 Jan 2010 22:08:22 +0100,
> > Egbert Jan van den Bussche wrote:
> >>
> >> Welcome! 
> >> Have a look at RoundCube webmail. I used to use squirrelmail but had
> the
> >> same issues as you. RoundCube is very nice.
> > 
> > I second that emotion
> 
> After a bit of researching, I've decided to go with Roundcube.  However,
> my
> Linux distribution doesn't have a standard package of Roundcube, only a
> backport
> of Roundcube, version 0.2.2.
> 
> Normally I really prefer to stick with distro packages for my application
> needs,
> for a variety of reasons, mainly easy installation of security updates and
> dependency resolution.
> 
> Aptitude handles dependencies very well, so I'd really like to go with the
> Debian backport of Roundcube 2.2, **unless** there are majorly needed
> functionality upgrades or major bug fixes in the 0.3.1 available directly
> from
> the roundcube.net download section.
> 
> What will I be missing if I go with the Debian 0.2.2 backport instead of
> the
> current 0.3.1?  Are there any other Debian users here who have
> recommendations
> or advice?  Are there any installation gotchas via either the backport
> method or
> the straight install method via the roundcube.net files?
> 
> Thanks for any/all advice.
> 
An advice on another nice Web enabled mail client? Have you looked at SOGo? 
Have a look at their online demo -> 
http://www.scalableogo.org/tour/online_demo.html

It has more to offer then RoundCube (aka: Calendaring, synchronization with 
Funambol, etc).


> --
> Stan
>
// Steve
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


Re: [Dovecot] First time Dovecot user, really impressed so far. What is best IMAP enabled webmail package to go with Dovecot?

2010-01-06 Thread Stan Hoeppner
David Abrahams put forth on 1/5/2010 1:44 PM:
> At Mon, 4 Jan 2010 22:08:22 +0100,
> Egbert Jan van den Bussche wrote:
>>
>> Welcome! 
>> Have a look at RoundCube webmail. I used to use squirrelmail but had the
>> same issues as you. RoundCube is very nice.
> 
> I second that emotion

After a bit of researching, I've decided to go with Roundcube.  However, my
Linux distribution doesn't have a standard package of Roundcube, only a backport
of Roundcube, version 0.2.2.

Normally I really prefer to stick with distro packages for my application needs,
for a variety of reasons, mainly easy installation of security updates and
dependency resolution.

Aptitude handles dependencies very well, so I'd really like to go with the
Debian backport of Roundcube 2.2, **unless** there are majorly needed
functionality upgrades or major bug fixes in the 0.3.1 available directly from
the roundcube.net download section.

What will I be missing if I go with the Debian 0.2.2 backport instead of the
current 0.3.1?  Are there any other Debian users here who have recommendations
or advice?  Are there any installation gotchas via either the backport method or
the straight install method via the roundcube.net files?

Thanks for any/all advice.

--
Stan


Re: [Dovecot] Oracle SQL driver

2010-01-06 Thread Alexander Bukharov
> There wouldn't be any uncommitted statements. The only such statements
are
> sent inside commit(), the others are SELECTs and such that don't modify
> anything.

Ok. I made things this way.

> Well, that also wastes memory :) I thought I remembered using VARCHAR
> pointers about 10 years ago. I think I still have that code around, but I
> currently don't have a computer where I could put that hard drive. Maybe
in
> a few days.

No need for this. I found a way to handle VARCHAR pointers. Now all ok.
There is always a time to learn =)

> Does Oracle handle \ specially? I don't have Oracle installed currently
or
> access to any installations.

No unless an escape clause is specified in SQL-statement.

> I'll check the updated patch later.

Here is a fixed one.

driver-oracle.pc
Description: Binary data


[Dovecot] Log the virtual email address and not the local account - dovecot 1.2.2 w/ MySQL

2010-01-06 Thread Bill
I recently started using dovecot and have it working well but I have one item I 
haven't been able to find an answer for. I am using MySQL with Dovecot for 
authentication with my virtual email customers. When the user logs in and 
checks email a log entry is recorded. Instead of the email address 
(b...@bob.net) being logged it records the local account (vemail101) in the 
POP3 log. How can I get dovecot to reflect the email address that the customer 
logged in with instead of the local account?

Thx,

Bill

Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Pascal Volk
On 01/06/2010 03:44 PM Charles Marcus wrote:
> On 2010-01-06 7:20 AM, Timo Sirainen wrote:
>> On 5.1.2010, at 13.55, Charles Marcus wrote:
>>> dovecot -n should know which config file it is using, and outout
>>> accordingly.
> 
>> How would it know what config file Dovecot is using? The config file
>> needs to be read before it even knows where the base_dir is.
> 
> I don't know - :( - but I'm pretty sure postfix does it somehow...

Postfix's master uses also the -c option. But -c config_dir, because
Postfix searches its main.cf and master.cf configuration files in the
given config_dir. (see master(8))

>> What if there are multiple Dovecots running?
> 
> Hmmm... good point, don't know on that one, and I've never run multiple
> postfix instances, so don't know if/what it dos in that case either...

Each instance has its own configuration/data/spool directories with all
instance specific files.
And yes, a `postconf -n` for one the multi instances is more complex
than a simple `dovecot -n -c /path/to/funny-name.conf`. Looks like this:
postmulti -i $INSTANCE_NAME  -x postconf -n


Regards;
Pascal
-- 
The trapper recommends today: face1e55.1000...@localdomain.org


Re: [Dovecot] problem with uidlist

2010-01-06 Thread David Halik

On 12/29/2009 06:40 PM, Timo Sirainen wrote

I should probably try again stress testing on NFS with imaptest. Maybe
these happen constantly when imaptest is run on two machines at the same
time?..

   


That sounds like a good test to me. Our environment (which seems to trip 
many of these issues up) is 10 dedicated IMAP/POP servers, 2 frontend 
*nix boxes running pine, and four webmail machines using imapproxy to 
connect to the IMAP servers... all using the same NFS backend. More than 
likely it's an multi-server access NFS issue.


--

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




Re: [Dovecot] dovecot-1.2.8 imap crash (with backtrace)

2010-01-06 Thread David Halik


Timo, I reinstalled all our servers with -O0 and full debugging on 
"-gdwarf-2 -g3". I should be able to look up anything you need done now.


Here's some more examples with the data you asked for last time, now 
without optimization. I also noticed that there are a few users that 
seem to be regulars with this problem.


#4  0x004d8fd7 in i_panic (format=0x501688 "file %s: line %d 
(%s): assertion failed: (%s)") at failures.c:207
args = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 
0x7fffcf52b5a0, reg_save_area = 0x7fffcf52b4e0}}
#5  0x0044f34e in maildir_uidlist_records_array_delete 
(uidlist=0x1b612330, rec=0x1b61f1f8) at maildir-uidlist.c:405

recs = (struct maildir_uidlist_rec * const *) 0x1b607f60
pos = (struct maildir_uidlist_rec * const *) 0x0
idx = 0
count = 2
__PRETTY_FUNCTION__ = "maildir_uidlist_records_array_delete"
#6  0x0044f8fc in maildir_uidlist_next (uidlist=0x1b612330, 
line=0x1b60426a 
"1249562340.M302085P7316V04240006I00DB2CF1_0.gehenna7.rutgers.edu,S=19277:2,S") 
at maildir-uidlist.c:552

rec = (struct maildir_uidlist_rec *) 0x1b6209f8
old_rec = (struct maildir_uidlist_rec *) 0x1b61f1f8
recs = (struct maildir_uidlist_rec * const *) 0x1b604264
count = 0
uid = 2807

(gdb) fr 5
#5  0x0044f34e in maildir_uidlist_records_array_delete 
(uidlist=0x1b612330, rec=0x1b61f1f8) at maildir-uidlist.c:405

405i_assert(pos != NULL);
(gdb) p *recs
$1 = (struct maildir_uidlist_rec * const) 0x1b61fa60
(gdb) p count
$2 = 2
(gdb) p *recs[0]
$3 = {uid = 2735, flags = 6, filename = 0x1b61fa78 
"1262739815.M913182P4280V04240006I014D0F92_0.gehenna7.rutgers.edu,S=11791:2,", 
extensions = 0x1b620980 "W12036"}

(gdb) p *recs[1]
$4 = {uid = 2736, flags = 0, filename = 0x1b6209a0 
"1262739645.M307617P13458V04240006I014D0F91_0.gehenna10.rutgers.edu,S=5005:2,S", 
extensions = 0x1b6209f0 "W5124"}

(gdb)

Another user for comparison:

(gdb) fr 5
#5  0x0044f34e in maildir_uidlist_records_array_delete 
(uidlist=0x6bd7680, rec=0x6bc93d0) at maildir-uidlist.c:405

405i_assert(pos != NULL);
(gdb) p *recs
$1 = (struct maildir_uidlist_rec * const) 0x6d5c418
(gdb) p count
$2 = 7
(gdb) p *recs[0]
$3 = {uid = 52566, flags = 4, filename = 0x6d5c438 
"1262781360.M836147P9323V04240007I0148DC53_0.gehenna5.rutgers.edu,S=2157:2,a", 
extensions = 0x6d5c430 "W2201"}

(gdb) p *recs[1]
$4 = {uid = 52568, flags = 0, filename = 0x6cd4590 
"126262.M94168P6001V04240006I003C41C2_0.gehenna10.rutgers.edu,S=22946:2,Sa", 
extensions = 0x6cd4588 "W23481"}

(gdb) p *recs[2]
$5 = {uid = 52569, flags = 0, filename = 0x6bc9328 
"1041233872.06.mbox:2,S", extensions = 0x6bc9318 "W6334"}

(gdb) p *recs[3]
$6 = {uid = 52570, flags = 0, filename = 0x6bc9370 
"1041233872.13.mbox:2,S", extensions = 0x6bc9360 "W1193"}

(gdb) p *recs[4]
$7 = {uid = 52571, flags = 0, filename = 0x6bc92e0 
"1041233872.14.mbox:2,RS", extensions = 0x6bc92d0 "W3095"}

(gdb) p *recs[5]
$8 = {uid = 52572, flags = 4, filename = 0x6d58ec8 
"1262782141.M730129P15749V03E80006I0148DC54_0.gehenna9.rutgers.edu,S=7454:2,", 
extensions = 0x6d62160 "W7626"}

(gdb) p *recs[6]
$9 = {uid = 52573, flags = 0, filename = 0x6d62140 
"1041233872.16.mbox:2,S", extensions = 0x0}

(gdb)

And one more user:

(gdb) fr 5
#5  0x0044f34e in maildir_uidlist_records_array_delete 
(uidlist=0x10f44680, rec=0x10f67120) at maildir-uidlist.c:405

405i_assert(pos != NULL);
(gdb) p *recs
$1 = (struct maildir_uidlist_rec * const) 0x11093760
(gdb) p count
$2 = 2
(gdb) p *recs[0]
$3 = {uid = 55108, flags = 0, filename = 0x11093778 
"1262788462.M201250P7938V04240006I01EF76E0_0.gehenna10.rutgers.edu,S=1731278:2,", 
extensions = 0x1109d240 "W1753846"}

(gdb) p *recs[1]
$4 = {uid = 55109, flags = 4, filename = 0x1109d268 
"1262788793.M851477P3866V045C0007I01EF76E3_0.gehenna8.rutgers.edu,S=19990", 
extensions = 0x0}





On 12/30/2009 12:10 PM, David Halik wrote:


Ok, I think I've got some more info and a more accurate time line for 
you. I tried this on two different dumps from two different users. The 
count was 4 in the first example and 0 in the second. I'm guessing 
that's considered "small"? The links to my gdb sessions for both are 
below and have some of the info you were looking for. The 
corresponding logs are also there so you can see how each failed. I 
put everything on pastebin so it's a little easier to see.


By the way, I also found that the stale NFS file handle message does 
appear first in each instance, it was just farther back in the logs. 
"Lowering uid" message also appears immediately after every stale NFS 
message, which in turn causes all of this n amount of time later 
(sometimes 5 minutes, sometimes 20) when a user does a new action. The 
"file reappeared message only occurs some of the time. Here's the 
chain of events in every case so far that I can see:


1) fdatasync(/rci/nqu/rci/u8/user/dovecot/.INBOX/dovecot-uidlis

Re: [Dovecot] managesieve does call a wrong chown

2010-01-06 Thread Wolfgang . Friebel

On Mon, 4 Jan 2010, wolfgang.frie...@desy.de wrote:


After upgrading from dovecot 1.2.3, managesieve 0.11.8, sieve 0.1.11 to
dovecot 1.2.9, managesieve 0.11.10 and sieve 0.1.14 users who do not have 
sieve rules yet and use managesieve for the first time do trigger error 
messages in the log file (for the authenticated user ggg in group syspr):


Jan  4 17:35:26 apollo dovecot: MANAGESIEVE(ggg): chown(/var/spool/sieve/ggg, 
-1, 0(root)) failed: Operation not permitted (egid=203(syspr))
Jan  4 17:35:26 apollo dovecot: MANAGESIEVE(ggg): sieve-storage: 
sieve_storage_verify_dir(/var/spool/sieve/ggg/tmp) failed: Operation not 
permitted
Jan  4 17:35:26 apollo dovecot: MANAGESIEVE(ggg): Fatal: Failed to create 
sieve storage with data: /var/spool/sieve/ggg



replying to my own mail :-)

I did try to look into the code and see where this chown(dir, -1, 0) is 
coming from. It looks like the call is in mkdir_chown invoked in

dovecot-1.2-managesieve-0.11.10/src/lib-sievestorage/sieve-storage.c
line 249.

This piece of code is (if I understand it correctly) trying to set the 
group permissions according to the parent directory (assuming that the 
sieve storage is somewhere in the users home dir).


I did however choose to have a different dir layout, the sieve storage is 
under /var/spool/sieve/ which has permissions 1777 and is owned by 
root:root. Therefore the chown(dir, -1, 0) call is failing, as the parent 
dir does not belong to the group of the user but to root.


As the directory structure is nevertheless created (with the correct 
permissions), the next use of managesieve does no longer complain about 
wrong permissions and managesieve is correctly working.


Should I change my choice of sieve_dir as suggested in the wiki:

# Directory for :personal include scripts. The default is to use home directory.
sieve_dir = %h/sieve

or is my setting a correct alternative?

Best regards
--
Wolfgang Friebel   Deutsches Elektronen-Synchrotron DESY
Phone/Fax:  +49 33762 77372/216Platanenallee 6
Mail: Wolfgang.Friebel AT desy.de  D-15738 Zeuthen  Germany


Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Charles Marcus
On 2010-01-06 7:20 AM, Timo Sirainen wrote:
> On 5.1.2010, at 13.55, Charles Marcus wrote:
>> dovecot -n should know which config file it is using, and outout
>> accordingly.

> How would it know what config file Dovecot is using? The config file
> needs to be read before it even knows where the base_dir is.

I don't know - :( - but I'm pretty sure postfix does it somehow...

> What if there are multiple Dovecots running?

Hmmm... good point, don't know on that one, and I've never run multiple
postfix instances, so don't know if/what it dos in that case either...


Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Thomas Wolf

Pascal Volk schrieb:

On 01/06/2010 02:15 PM Thomas Wolf wrote:

…
The package "dovecot-postfix" installs and uses dovecot-postfix.conf but
unfortunately also puts the default dovecot.conf in /etc/dovecot
(driving everyone crazy who blindly follows howtos editing
dovecot.conf). Highly recommended to remove/rename dovecot.conf in this
configuration.


And there is big fat warning at the top of the unbuntus's dovecot.conf
file:
# -- WARNING ---

# If there's a file /etc/dovecot/dovecot-postfix.conf, which is part of
# dovecot-postfix package, it will be used instead of dovecot.conf.

# Keep in mind that, if that file exist, none of the changes in
# /etc/dovecot/dovecot.conf will have effect on dovecot's configuration.
# In that case you should customize /etc/dovecot/dovecot-postfix.conf.

# -- WARNING ---

Further more, the file /usr/share/doc/dovecot-postfix/README.Debian
contains:
"dovecot's init script checks existance of /etc/dovecot/dovecot-postfix.conf
and if that file exists, it reads it instead of /etc/dovecot/dovecot.conf."

Sorry, but I really can't understand, why the most unbuntu users seems
to be unable to read AND understand so simple written documentation. :(



I agree (that's why i wrote "..who *blindly* follows howtos").
Nevertheless, renaming /etc/dovecot/dovecot.conf helps troubleshooting
while using dovecot-postfix (forgetting -c when using deliver elsewhere
for example)

Thomas







Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Pascal Volk
On 01/06/2010 02:15 PM Thomas Wolf wrote:
> …
> The package "dovecot-postfix" installs and uses dovecot-postfix.conf but
> unfortunately also puts the default dovecot.conf in /etc/dovecot
> (driving everyone crazy who blindly follows howtos editing
> dovecot.conf). Highly recommended to remove/rename dovecot.conf in this
> configuration.

And there is big fat warning at the top of the unbuntus's dovecot.conf
file:
# -- WARNING ---

# If there's a file /etc/dovecot/dovecot-postfix.conf, which is part of
# dovecot-postfix package, it will be used instead of dovecot.conf.

# Keep in mind that, if that file exist, none of the changes in
# /etc/dovecot/dovecot.conf will have effect on dovecot's configuration.
# In that case you should customize /etc/dovecot/dovecot-postfix.conf.

# -- WARNING ---

Further more, the file /usr/share/doc/dovecot-postfix/README.Debian
contains:
"dovecot's init script checks existance of /etc/dovecot/dovecot-postfix.conf
and if that file exists, it reads it instead of /etc/dovecot/dovecot.conf."

Sorry, but I really can't understand, why the most unbuntu users seems
to be unable to read AND understand so simple written documentation. :(


Regards,
Pascal
-- 
Ubuntu is an ancient African word meaning “I can’t install Debian.”
 -- unknown


Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Thomas Wolf

Timo Sirainen schrieb:

On 5.1.2010, at 13.55, Charles Marcus wrote:


In other words, would you really have to remember to run dovecot -n -c
per your example above?

I ask because I've never used it with a config file in a non-default
location.

If this is correct, I would consider it a bug - dovecot -n should know
which config file it is using, and outout accordingly.


How would it know what config file Dovecot is using? The config file needs to be read before it even knows where the base_dir is. 

> What if there are multiple Dovecots running? The main problem
> here is that Ubuntu for some reason decided to use dovecot-postfix.conf
> instead of the default dovecot.conf..

Depends on the package that is installed:

t...@mail2:~$ apt-cache search dovecot
dovecot-common - secure mail server that supports mbox and maildir mailboxes
dovecot-dev - header files for the dovecot mail server
dovecot-imapd - secure IMAP server that supports mbox and maildir mailboxes
dovecot-pop3d - secure POP3 server that supports mbox and maildir mailboxes
dovecot-postfix - full mail server stack provided by Ubuntu server team

The package "dovecot-postfix" installs and uses dovecot-postfix.conf but
unfortunately also puts the default dovecot.conf in /etc/dovecot
(driving everyone crazy who blindly follows howtos editing
dovecot.conf). Highly recommended to remove/rename dovecot.conf in this
configuration.

Thomas







Re: [Dovecot] Post-logoff script

2010-01-06 Thread Timo Sirainen
On 6.1.2010, at 11.51, Aaron Roberts wrote:

> Hi,
>   Is it possible with dovecot to run a script on user logoff event - 
> something like post-login script?

You could do a post-login script that does:

#!/bin/sh

# post-login stuff
/usr/local/libexec/dovecot/imap
ex=$?
# post-logout stuff
exit $ex

Of course that means some annoying extra shell processes. An alternative would 
be for you to create a plugin that does the post-logout stuff in its deinit() 
function.



Re: [Dovecot] Oracle SQL driver

2010-01-06 Thread Timo Sirainen
On 6.1.2010, at 14.09, Alexander Bukharov wrote:

>> The transaction handling doesn't look correct to me. The sql_update()s
>> just add the change to a linked list and commit() is then supposed to
>> run them in one transaction and either everything should succeed or
>> fail. Your commit appears to ignore errors and just commit everything
>> that goes through? Also since nothing is actually sent before commit(),
>> your rollback() shouldn't need to send ROLLBACK.
> 
> You right. I've corrected the transaction handling mechanism. The only
> thing I couldn't understand: why rollback() shouldn't need to make real
> ROLLBACK? In case when whole transaction was failed succeded statements
> will remain uncommited. Then they will be commited later on next successful
> transaction. May be ROLLBACK is still needed?

There wouldn't be any uncommitted statements. The only such statements are sent 
inside commit(), the others are SELECTs and such that don't modify anything.

>> The "VARCHAR sqltext[2048]" seems like an unnecessary restriction on the
>> query length. Wasn't there a way to do this without the limit? Or in
> 
> AFAIK there is no possibility to use C types in PREPARE statement. Also
> Oracle cannot handle unsized VARCHARs. I've increased VARCHAR size to
> 65535.

Well, that also wastes memory :) I thought I remembered using VARCHAR pointers 
about 10 years ago. I think I still have that code around, but I currently 
don't have a computer where I could put that hard drive. Maybe in a few days.

>> driver_oracle_escape_string() really should be escaping the string.
> 
> I made this function to replace single quote in string with two single
> quotes. IMHO this should be enough. How do you think?

Does Oracle handle \ specially? I don't have Oracle installed currently or 
access to any installations.

I'll check the updated patch later.

Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Timo Sirainen
On 5.1.2010, at 16.26, Anthony Nedland wrote:

> For example, I sent to du...@baldtel.com from an external address. The server 
> returned the error 'user duane does not exist' in the form of an 
> undeliverable bounce back email.

Set auth_debug=yes. Show what deliver logs 
(http://wiki.dovecot.org/LDA#Logging) and what dovecot-auth logs. If you can't 
see deliver logging anything, show what Postfix logs about the deliver.



Re: [Dovecot] Dovecot not delivering mail.

2010-01-06 Thread Timo Sirainen
On 5.1.2010, at 13.55, Charles Marcus wrote:

> In other words, would you really have to remember to run dovecot -n -c
> per your example above?
> 
> I ask because I've never used it with a config file in a non-default
> location.
> 
> If this is correct, I would consider it a bug - dovecot -n should know
> which config file it is using, and outout accordingly.

How would it know what config file Dovecot is using? The config file needs to 
be read before it even knows where the base_dir is. What if there are multiple 
Dovecots running? The main problem here is that Ubuntu for some reason decided 
to use dovecot-postfix.conf instead of the default dovecot.conf..

Re: [Dovecot] virtual mailbox / INTHREAD use case, issues, questions

2010-01-06 Thread Timo Sirainen
On 4.1.2010, at 20.47, David Abrahams wrote:

> 1. I had to manually create the virtual folder for all my users or
>   they couldn't access their mail at all.  Is this fixed in 2.0?

No.

> 2. My users were getting errors when accessing via POP3.  The possible
>   meaning of such a virtual folder under POP3 is lost on me, but I
>   had to enable the virtual plugin for that protocol too.  I think
>   that should at least be in the documentation, or better yet the
>   requirement should that it be enabled for POP3 should be dropped.

I think you could put the virtual namespace inside protocol imap {} section.

> 3. I couldn't get the virtual "conversation view" inbox to show any
>   messages.  But maybe that's because of a possible issue I describe
>   below with x-mailbox
> 
> 4. At some point I ended up with an empty mailbox called
>   "private.virtual" --- I have no idea how.  Probably user error.

Dunno.

> 5. The "all" virtual mailbox would only show 89 messages.  I switched
>   it to be a mirror of my "archive" mailbox and the number started to
>   look more reasonable.  This could be the "lots of mailboxes" bug
>   describe in
>   http://dovecot.org/list/dovecot-news/2009-December/000145.html

"lots of mailboxes" should cause error to be logged.

> 6. I got the impression that looking at the virtual INBOX didn't cause
>   the "all" mailbox to be updated, which I'd guess that it should be.

It should.

> 7. I tried to create an IMAP search, rather than a virtual folder,
>   that looked for x-mailbox INBOX header like the virtual folder
>   does.  It too came up empty.  It doesn't exactly surprise me
>   because I don't see an x-mailbox header in any of these messages.

x-mailbox doesn't use a header, it uses the actual mailbox name where the 
message exists.

> Lastly, I want to report that for me, the speed of these IMAP searches
> doesn't begin to approach what I can do with mairix if I want a
> message's entire thread.  I'm happy to use mairix, although it would
> be nicer not to duplicate that capability if it's already in the
> server.  But it needs to be fast.  Is there something I can do to make
> it go faster?

How slow is it? How many messages do you have? I think it should be pretty fast.

Anyway, dovecot -n output and contents of dovecot-virtual file could help 
figuring out what your problem is.

Re: [Dovecot] Oracle SQL driver

2010-01-06 Thread Alexander Bukharov
> The transaction handling doesn't look correct to me. The sql_update()s
> just add the change to a linked list and commit() is then supposed to
> run them in one transaction and either everything should succeed or
> fail. Your commit appears to ignore errors and just commit everything
> that goes through? Also since nothing is actually sent before commit(),
> your rollback() shouldn't need to send ROLLBACK.

You right. I've corrected the transaction handling mechanism. The only
thing I couldn't understand: why rollback() shouldn't need to make real
ROLLBACK? In case when whole transaction was failed succeded statements
will remain uncommited. Then they will be commited later on next successful
transaction. May be ROLLBACK is still needed?

> The "VARCHAR sqltext[2048]" seems like an unnecessary restriction on the
> query length. Wasn't there a way to do this without the limit? Or in

AFAIK there is no possibility to use C types in PREPARE statement. Also
Oracle cannot handle unsized VARCHARs. I've increased VARCHAR size to
65535.

> test_connection() seems unnecessary.

Right you are.

> Couldn't driver_oracle_generate_name() be simply:
> static unsigned int counter = 0;
> return i_strdup_printf("ORACONN_%x", ++counter);

=) Right.

> driver_oracle_escape_string() really should be escaping the string.

I made this function to replace single quote in string with two single
quotes. IMHO this should be enough. How do you think?

> Kind of annoying that each query needs a cursor, even though nearly all
> queries are expected to return only a single row, but I guess that can't
> be helped with the current API..

Yes. There are no other ways to work with untyped statements in OCI. But
Oracle claims that all these statements shouldn't produce significant
performance impact.

The new version attached.

driver-oracle.pc
Description: Binary data


[Dovecot] strange behaviour with seen/unseen messages in virtual folders.

2010-01-06 Thread Matthias Rieber

Hi,

I've a virtual folder that contains unseen messages. When I mark the 
message and expunge the folder, the message should disappear. This works 
as expected in alpine. Alpine uses the following commands:


0610 STORE 1 +Flags (\SEEN)
0620 EXPUNGE

Using roundcube mail, the message wont disappear, when I perform the same 
steps. RoundCube Mails sends:


flg UID STORE 445 +FLAGS (\Seen)
exp1 EXPUNGE

But the message doesn't dissapear. But I can expunge it with alpine, as 
long as the folder contains one message. If it contains more messages, 
some or even all messages won't disappear. When I mark them as unseen/seen 
in alpine, I can expunge them with alpine.


The expunge command send by roundcube mail never expunges any seen message 
in the unseen folder. Whether it was flagged as seen by alpine nor 
roundcube mail.


kind regards,
matthias



[Dovecot] Post-logoff script

2010-01-06 Thread Aaron Roberts
Hi,
Is it possible with dovecot to run a script on user logoff event - 
something like post-login script?

What I want to achieve is updating a SQL table with online/offline status.

Thanks in advance,
Aaron


Re: [Dovecot] Sieve > Pigeonhole > external storage with LDAP or other data source available to dovecot

2010-01-06 Thread Martin F. Foster



On 5.1.2010, at 10.02, Martin F. Foster wrote:

   

I am looking at porting and generalizing an old in-house patch that I'm using for 
the CMU Sieve plugin.  It allows sieve script to test&  lookup arguments from 
LDAP.
 

..
   

Related work:

  1. Pigeonhole low priority TODO would like to implement alternate
 script storage, eg: LDAP&  SQL.  I'm not immediately interested in
 alternate types of script storage, but for what I want to acheive,
 I need to sanely access at least an LDAP directory.
  2. draft-ietf-sieve-external-lists
 (http://tools.ietf.org/html/draft-ietf-sieve-external-lists-01)
 proposes a mechanism to pull mailing list addresses from external
 storage mechanisms such as LDAP, ACAP or relational databases.  I'm 
interested in this, but would like to extend this
 functionality beyond just lists as the example above demonstrates.
 

I haven't looked into that draft or thought much about this, but would doing 
the lookups via Dovecot's lib-dict be ok? That would of course need a dict-ldap 
backend implemented, but it would be a generic way to solve this, if its API is 
good enough.
   


After another day of looking into this, I believe that there are two 
concerns to be addressed:
1. dovecot implementation: how dovecot/pigeonhole provides access to 
these external sources in a sane way. I do like the dict interface for 
this, which could keep LDAP url's (or SQL queries, etc) out of sieve 
scripts, and into nicely compartementalized configuration files. Being 
very ldap focussed at my site, I hadn't looked at dict before today.
2. sieve language: an extension which would allow scripts to get 
information from an external source. I'm asking the 
draft-ietf-sieve-external-lists authors a few questions about this.



The end result would be something like what follows:

Dovecot implementation (proposed):
-


dict {
dict_sieve = ldap:/etc/dovecot/dovecot-sieve-ldap.conf
}

plugin {
# TODO: proxy this dict?
sieve_extsrc = dict
}


then I'm not sure how you specify multiple hosts with the dict-sql 
format, so I'm using the postfix convention. there's probably a better 
way for dovecot.


map {
name = responder_mode
server_host = ldap://server1.mycorp.com, ldap://server2.mycorp.com
search_base = o=mailstuff
query_filter = (&(objectclass=mailschema)(uid=%u))
result_attribute = responder_mode
result_scope = sub
bind = no
version = 3
}
map {
name = responder_text
server_host = ldap://server1.mycorp.com, ldap://server2.mycorp.com
search_base = o=mailstuff
query_filter = (&(objectclass=mailschema)(uid=%u))
result_attribute = responder_text
result_scope = sub
bind = no
version = 3
}
map {
name = forward_keep
server_host = ldap://server1.mycorp.com, ldap://server2.mycorp.com
search_base = o=mailstuff
query_filter = (&(objectclass=mailschema)(uid=%u))
result_attribute = mailForwardKeep
result_scope = sub
bind = no
version = 3
}
map {
# in this case we can have many responses
name = forward_addresses
server_host = ldap://server1.mycorp.com, ldap://server2.mycorp.com
search_base = o=mailstuff
query_filter = (&(objectclass=mailschema)(uid=%u))
result_attribute = mailForwardAddress
result_scope = sub
bind = no
version = 3
}


Sieve language:
-
then with proposed new functions of the sieve language (all names 
plucked out of my head 2hrs ago, would have to think about the semantics 
some more):


1. a “:list” argument that expects a string-list

2. a “:extsrc” argument that expects an  and returns a 
string-list


3. a “:extsrc1” argument that expects an  and returns 
a string


4. a new test that uses information that is not in the message, say 
“arbitrary [comparator] string string” (syntax needs work)



sample uses in scripts are then:

1. redirect to a mailing list sourced from ldap (or wheverver):

# mailForwardAddress attribute can be present >=0 times

redirect :list :extsrc “dict:forward_addresses”

2. decide whether to keep or discard forwarded messages (eg: after the 
above rule)


# mailForwardKeep attribute should only be present once, if at all

if arbitrary :is :extsrc1 “dict:forward_keep” “TRUE” {

keep;

}

3. decide vacation action and text based in information in an ldap dir:

# mailResponderMode & mailResponderText attrs should only be present 
once, if at all


if arbitrary :is :extsrc1 “dict:responder_mode” “alwaysreply” {

vacation :days 1 :extsrc1 “dict:responder_text";

}

if arbitrary :is :extsrc1 “dict:responder_mode” “holiday” {

vacation :days 30 :extsrc1 “dict:responder_text”;

}


... where the "dict:mapname" syntax would be dovecot implementation 
specific. could also support the URL & TAG-URI schemes as proposed by 
draft-ietf-sieve-external-lists. This would allow query URLs as a more 
general case, using whatever's configured in /etc/ldap/ldap.conf (or 
whatever the platform's ldap client lib uses). Doing this does raise 
some resource consumption concerns, hence there should