Proper way to enable plugin for some users

2017-08-29 Thread Ian Bobbitt
What's the best way to enable a plugin (in this case, mail_log) for only some 
users? I have this as a field returned in
my sql user_query that seems to be doing the job:

if(debug_log != 0 and '%s' = 'imap', 'listescape acl notify replication 
mail_log', 'listescape acl notify replication')
as mail_plugins

But it feels clunky and error prone having to replicate the entire list of 
plugins in my userdb. Is this the best way to
do it, or is there something I should be doing differently?

OS: CentOS 7
Dovecot: 2.2.31, GF RPMs



smime.p7s
Description: S/MIME Cryptographic Signature


Re: unexpected delivery location

2017-08-29 Thread lists

For the archives:

On 23-8-2017 21:56, Noel wrote:

Perhaps you can adjust your query or your database to return the
desired result.  Otherwise, use your scripting skills to generate a
file, then automate the procedure.


I ended up creating a file /etc/postfix/olddomain with this contents:


/^([^@]*)@olddomain.com/ $(1)@newdomain.com


and reference that in main.cf like:

virtual_alias_maps = regexp:/etc/postfix/olddomain

That seems to to the job nicely:

Emails for exist...@olddomain.com are delivered to 
exist...@newdomain.com, and mails sent to nonexist...@olddomain.com 
receive DSN Undelivered Mail Returned to Sender, with:


 (expanded from ): 
user unknown


Perfect. :-)


Re: dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c: 4 * suspicious expression ?

2017-08-29 Thread Aki Tuomi



On 2017-08-24 21:39, David Binderman wrote:

Hello there,

dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:130]: (style) Suspicious 
condition (assignment + comparison); Clarify expression with parentheses.

Source code is

 if ((ret = doveadm_print_istream(input) < 0))

Maybe better code

 if ((ret = doveadm_print_istream(input)) < 0)

Some duplicates:

[dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:220]: (style) Suspicious 
condition (assignment + comparison); Clarify expression with parentheses.
[dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:237]: (style) Suspicious 
condition (assignment + comparison); Clarify expression with parentheses.
[dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:261]: (style) Suspicious 
condition (assignment + comparison); Clarify expression with parentheses.

Regards

David Binderman


Hi!

This is already fixed in master

commit d9a7e950a9cd21f2b4a90ec7759fca9e8fcc7995
Author: Timo Sirainen 
Date:   Sun Jun 5 15:37:06 2016 +0300

global: Fixed mismatched bool vs. int/pointer handling

I don't think these fix any actual bugs.

Aki


Re: dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c: 4 * suspicious expression ?

2017-08-29 Thread Aki Tuomi


On 2017-08-24 21:39, David Binderman wrote:

Hello there,

dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:130]: (style) Suspicious 
condition (assignment + comparison); Clarify expression with parentheses.

Source code is

 if ((ret = doveadm_print_istream(input) < 0))

Maybe better code

 if ((ret = doveadm_print_istream(input)) < 0)

Some duplicates:

[dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:220]: (style) Suspicious 
condition (assignment + comparison); Clarify expression with parentheses.
[dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:237]: (style) Suspicious 
condition (assignment + comparison); Clarify expression with parentheses.
[dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:261]: (style) Suspicious 
condition (assignment + comparison); Clarify expression with parentheses.

Regards

David Binderman


Thank you, we'll take a look.

Aki