Re: Sieve coding question

2017-11-18 Thread Roger B.A. Klorese

On 11/16/17 11:03 AM, Stephan Bosch wrote:

Op 11/16/2017 om 7:42 PM schreef lists.dove...@rogerklorese.com:

Is there a more appropriate list on which to ask for assistance in
coding Sieve rules, or may I ask here?

I know of no other suitable venue, so go ahead.

Regards,

Stephan.



Here is the config. I don't think IMAPsieve is configured...

# dovecot -n
# 2.2.30.2 (c0c463e): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.18 (29cc74d)
# OS: Linux 3.10.0-514.6.1.el7.x86_64 x86_64 CentOS Linux release 
7.3.1611 (Core)  xfs

first_valid_uid = 1000
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
listen = *
mail_gid = mailboxes
mail_home = maildir:/home/mailboxes/%d/%u
mail_location = maildir:/home/mailboxes/%d/%u
mail_privileged_group = mailboxes
mail_uid = mailboxes
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope 
encoded-character vacation subaddress comparator-i;ascii-numeric 
relational regex imap4flags copy include variables body enotify 
environment mailbox date index ihave duplicate mime foreverypart 
extracttext imapflags notify

mbox_write_locks = fcntl
namespace inbox {
  inbox = yes
  list = yes
  location =
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Junk {
    auto = subscribe
    special_use = \Junk
  }
  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    auto = no
    special_use = \Sent
  }
  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
  prefix = INBOX.
  separator = .
  subscriptions = yes
  type = private
}
passdb {
  driver = pam
}
passdb {
  args = /etc/dovecot/conf.d/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  recipient_delimiter = +
  sieve = /home/mailboxes/%d/%u/sieve/dovecot.sieve
  sieve_default = /etc/dovecot/sieve/default.sieve
  sieve_dir = /home/mailboxes/%d/%u/sieve
  sieve_extensions = +notify +imapflags
  sieve_global_dir = /etc/dovecot/sieve/global/
  sieve_global_path = /etc/dovecot/sieve/default.sieve
}
pop3_uidl_format = %v-%u
protocols = imap pop3 lmtp sieve sieve
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-master {
    group = mailboxes
    mode = 0660
    user = mailboxes
  }
  unix_listener auth-userdb {
    mode = 0777
  }
}
service managesieve-login {
  inet_listener sieve {
    port = 4190
  }
}
ssl_cert = 

Dovecots header files not optimized for external plugins

2017-11-18 Thread Jan Engelhardt

Making third-party plugins for Dovecot is really hard and frustrating.
Using dovecot 2.2.33.2 and the following sources, the compile errors keep
coming. The use of g++ is mandated as the underlying backend this plugin
will access only has a C++ interface.


== Source 1
/* g++-7 -c a.cpp */
#include 
#include 
#include 
#include 
static enum passdb_result
authdb_mapi_logon(struct auth_request *rq, const char *password)
{
int x = dev_null_fd + bswap_16(1);
}

== Problems 1
/usr/include/dovecot/compat.h:45:4: error: #error uoff_t size not set
 #  error uoff_t size not set

== Source 2
/* g++-7 -DHAVE_CONFIG_H -c a.cpp */
#include "config.h" /* generated by my configure */
#include 
#include 
#include 
#include 
static enum passdb_result
authdb_mapi_logon(struct auth_request *rq, const char *password)
{
int x = dev_null_fd + bswap_16(1);
}

== Problems 2
In file included from /usr/include/bits/byteswap.h:35:0,
 from /usr/include/byteswap.h:24,
 from a.cpp:2:
/usr/include/dovecot/byteorder.h:32:24: error: expected unqualified-id before 
‘__extension__’
 static inline uint16_t bswap_16(uint16_t in);

== Other problems
dovecot headers files are missing 'extern "C"' lines.
This means the linkage of symbols like dev_null_fd is not what it should be.
I can't use
 extern "C" {
 #include 
 }
either because then the standardy library headers that are included
by dovecot headers can easily start acting up too.


Re: Log rotation and combining...

2017-11-18 Thread Tom Hendrikx
HI,

Do you have selinux activated? Maybe the context for logrotate does not
allow accessing files under /home, and the root cli is not troubled by
such a limitation? Why are you storing log files under /home anyway?

Note: I don't use any OS with selinux, so can't really help with fixing
this an issue.

Regards,
Tom

On 17-11-17 22:42, SH Development wrote:
> So, the question is, why can I rotate the log manually, but cron returns a 
> permission error?  Do I need to tell cron to run it as sudo or something like 
> that?
> 
> Ethon
> 
>> On Nov 17, 2017, at 2:29 AM, Tom Hendrikx > > wrote:
>>
>> Hi,
>>
>>
>> Your crontab should normally mail you error output. But you can also run
>> the logrotate command manually, in verbose mode.
>>
>>
>> Kind regards,
>>  Tom
>>
>> On 17-11-17 03:35, SH Development wrote:
>>> That doesn’t seem to work either.  Where do I find logs for log rotation to 
>>> see the reason it failed?
>>>
>>> Ethon
>>>
>>>
>>>
 On Nov 16, 2017, at 7:53 PM, Bill Shirley  >> wrote:

 I believe you need a 'create' statement to set the permissions. Here
 is an example for mariadb:
 /var/log/mariadb/general.log
 /var/log/mariadb/slow_query.log
 /var/log/mariadb/error.log
 /var/log/mariadb/mariadb.log {
create 640 mysql mysql
daily
minsize 30M
notifempty
rotate 3
missingok
compress
sharedscripts
postrotate
 #   # just if mysqld is really running
if test -x /usr/bin/mysqladmin && \
/usr/bin/mysqladmin ping &>/dev/null
then
/usr/bin/mysqladmin flush-logs
fi
endscript
 }

 Bill


 On 11/16/2017 4:27 AM, SH Development wrote:
> I have recently noticed that my dovecot-deliver.log is huge and wanted to 
> start rotating it.  So a couple of questions:
>
> 1. Can the dovecot-deliver.log be combined with the maillog, that gets 
> rotated weekly?  If it can be done, is it advisable?
> Since the inception of this particular server, the log file has been 
> located in the /home/vmail directory.  Is there a reason it shouldn’t be 
> located in the /var/log directory with the maillog?
>
> 2. Separate from above, if I create a new logrotate script example as 
> follows:
>
> # dovecot SIGUSR1: Re-opens the log files.
> /home/vmail/dovecot-deliver.log {
>  missingok
>  notifempty
>  delaycompress
>  sharedscripts
>  postrotate
>/bin/kill -USR1 `cat /var/run/dovecot/master.pid 2>/dev/null` 2> 
> /dev/null || true
>  endscript
> }
>
> I get the following error only when cron tries to run it:
>
> /etc/cron.daily/logrotate:
> error: stat of /home/vmail/dovecot-deliver.log failed: Permission denied
>
>
> Owner on the log are vmail:vmail.  If I manually force logrotate on this 
> particular log, it works fine.
>
>
> Ethon




signature.asc
Description: OpenPGP digital signature


user selection for replication

2017-11-18 Thread Remko Lodder
Hi,

I am running a setup where I have a multitude of users.
Usernames are formed in both user-domain.tld and u...@domain.tld.
One to be able to login with the @ account to dovecot / webmail etc
and the - account to be able to deliver email to it.

Virtualmin does it like that for example.

This is fine for logging in to accounts and telling postfix via lmtp which
users are valid. But I do not want the - AND @ account to both synchronise.

How can I select which users can replicate and then ideally like I can do
in ldap ‘uid=*@*’ for example?

Thanks
Remko




signature.asc
Description: Message signed with OpenPGP


Re: Plugin virtual, Horde BAD IMAP QRESYNC not enabled

2017-11-18 Thread Jakobus Schürz

 Hi!

Thank you for the fix!

- Nachricht von Timo Sirainen  -
  Datum: Fri, 17 Nov 2017 23:54:25 +0200
    Von: Timo Sirainen 
Betreff: Re: Plugin virtual, Horde BAD IMAP QRESYNC not enabled
     An: wertsto...@nurfuerspam.de, Dovecot Mailing List 


On 17 Nov 2017, at 21.36, Aki Tuomi  wrote:




On November 16, 2017 at 9:59 AM wertsto...@nurfuerspam.de wrote:

 


Hi!

Thanks for the sample, we were able to identify the problem!


   
Fixed: https://github.com/dovecot/core/commit/489af46c6c1ee32fe6a6ff96a8281f2ef5870c8d

   


- Ende der Nachricht von Timo Sirainen  -

compiled it, and it seems to work for me. Tested it with several  
messages which are not working before. I can see them now in Horde in  
dovecots virtual folders.


Great thanks!!


Re: [Mailbox aliases] Sponsoring of bug fixing

2017-11-18 Thread azurit


Citát Aki Tuomi :


On 09.11.2017 10:28, Aki Tuomi wrote:


On 09.11.2017 10:14, azu...@pobox.sk wrote:

Hi,

how much would it cost to sponsor a complete* fix of mailbox aliases?

https://www.dovecot.org/list/dovecot/2015-June/101176.html
https://dovecot.org/list/dovecot/2016-September/105459.html

* i.e. without any workarounds like disabling mailbox_list_index

Thank you for info.

azur

Hi!

I'll discuss this internally and see if we can come up with anything.

Aki Tuomi
Dovecot oy


We have this issue in our backlog and it'll get fixed eventually, for
free, but we cannot promise any exact release version and accepting
money for the fix at this moment is not feasible.

Aki




Ok, what about sponsoring of raising a priority of this bug? :)