Re: Dovecot sieve - How to check which username a mail is being delivered to?

2016-02-26 Thread Tom Hendrikx
On 26-02-16 21:44, Yannik Sembritzki wrote:
> Hi everyone,
> 
> I am looking for a way to check which mailbox an email is being
> delivered to in a global sieve filter.
> 
> After not being able to find some kind of variable that is populated by
> dovecot automatically, I tried to use the `Delivered-To` header.
> I tried a check like this:
> 
> header :is "delivered-to" ""
> 

You're probably better off using envelope recipient:

envelope :is "to" "recipi...@example.org"

Regards,
Tom



signature.asc
Description: OpenPGP digital signature


Assertion crash: (idx * array->element_size < array->buffer->used)

2016-02-26 Thread Joseph Tam


Log message:

Traceback is hex gibberish: if symbolic traceback is needed, I'll
recompile with "cc -g" and retest.

Panic: file ../../../src/lib/array.h: line 219 (array_idx_i):
assertion failed : (idx * array->element_size < 
array->buffer->used)

(Similar to 
http://dovecot.org/pipermail/dovecot/2015-February/099771.html)

IMAP command that provoked the crash:

x1 FETCH 3 (BODY)

Dovecot version:

2.2.19, Solaris10
(I don't think doveconf -n is relevant, but willing to provide
if needed).

It seems like a mailbox index issue.  Removing, then recreating the
indices gets rid of the crash.  I saved these indices if it will help.

Joseph Tam 


Dovecot sieve - How to check which username a mail is being delivered to?

2016-02-26 Thread Yannik Sembritzki
Hi everyone,

I am looking for a way to check which mailbox an email is being
delivered to in a global sieve filter.

After not being able to find some kind of variable that is populated by
dovecot automatically, I tried to use the `Delivered-To` header.
I tried a check like this:

header :is "delivered-to" ""

Unfortunately, this does not only match the first occurence of the
header (which can be assumed is added by dovecot), but any occurence of
this header in the email, which could be added due to previous
deliveries and forwards, or just cause of malice.

Is there any way to achieve this?

Best regards,
Yannik


Question: Directory hashing to support large domains | Dovecot & MySQL

2016-02-26 Thread Altin Ukshini
Hello there,

I have a postfix + dovecot + mysql installation in an ubuntu server.
Virtual users and domains in a small mysql db that I manage via a web based
mailadmin I wrote myself.

The mysql db I'm talking about has a qmail structure that used to be
managed by qmailadmin and worked with vpopmail. As for information, I
cannot move to a different structure (exc postfixadmin/postfix) for many
reasons, so I was forced to stick with it and configure postfix and dovecot
to read that structure...

If you may know, qmail (depends on the configuration) uses a directory
hashing like /home/vpopmail/DOMAIN/P/7/USERNAME (something similar) in
order to manage large domains, and this is handled by vpopmail.
Please refer to these two links for details:
- http://free.acrconsulting.co.uk/email/qmh.html
- https://sourceforge.net/p/vpopmail/mailman/message/2710408/

I saw that dovecot uses something similar which I found in dovecot
documentation
​:
http://wiki2.dovecot.org/MailLocation#Directory_hashing

Unfortunately, I cannot find more details, so I'd be thankful if you help
me out with the following:

By reading the documentation, I can tell that I can use the dir hashing
variables in my dovecot configuration.
But, in my case, I get the directory path from my mysql db via dovecot sql
user_query - not from mail_location variable in 10-mail.conf
Therefore if in case of a first received email for a user: dovecot checks
in the db, gets the path and creates the maildir from the given path. In
case the maildir column is empty, it fails, and it also fails to
authenticate...

So, can dovecot write to mysql?
I would like to use directory hashing of dovecot, but from what I can find:
If dovecot has mail_location variable set to do the dir hashing, it will
not then go and add the created path in my mysql db. While if I try to
implement something similar from my web gui application, I'd probably have
to rewrite the algorithm that does this!?

Can anyone help me figure out what's the best way to implement this?

Thank you very much in advance for your help!

Best,
Altin Ukshini