Re: Panic: file smtp-address.c: line 530 (smtp_address_write): assertion failed: (smtp_char_is_qpair(*p))

2018-03-03 Thread John Fawcett
On 04/03/18 08:08, A.L.E.C wrote:
> On 03/02/2018 03:32 PM, Ralf Hildebrandt wrote:
>> The address causing the error is:
>>
>> From: =?utf-8?Q?Dorit_M=C3=BCller?= 
>>
>> Note the "umlaut" in the email address... :)
> This is about SMTPUTF8 (RFC6531). Looks like your only option is to disable
> smtputf8_enable in Postfix config. Of course Dovecot should never panic, so a 
> fix for this
> would be nice, separately from the SMTPUTF8 support.
>
Postfix already permitted UTF8 in message headers and local part of the
address before the introduction of SMTPUTF8 and that has remained so. I
don't believe turning off SMTPUTF8 in Postfix will change the behaviour
in this case.

John



Re: Panic: file smtp-address.c: line 530 (smtp_address_write): assertion failed: (smtp_char_is_qpair(*p))

2018-03-03 Thread A.L.E.C
On 03/02/2018 03:32 PM, Ralf Hildebrandt wrote:
> The address causing the error is:
> 
> From: =?utf-8?Q?Dorit_M=C3=BCller?= 
> 
> Note the "umlaut" in the email address... :)

This is about SMTPUTF8 (RFC6531). Looks like your only option is to disable
smtputf8_enable in Postfix config. Of course Dovecot should never panic, so a 
fix for this
would be nice, separately from the SMTPUTF8 support.

-- 
Aleksander 'A.L.E.C' Machniak
Kolab Groupware Developer [http://kolab.org]
Roundcube Webmail Developer   [http://roundcube.net]

PGP: 19359DC1 # Blog: https://kolabian.wordpress.com


2.2.34 fails to build on OpenBSD

2018-03-03 Thread Brad Smith

Trying to build Dovecot 2.2.34 on OpenBSD fails.

This seems to have been introduced by this commit..
https://github.com/dovecot/core/commit/4a9020ed888caf03fd3132a30a7818b01daa4b9d

Fairly -current..

/usr/bin/libtool  --tag=CC--mode=link cc  -std=gnu99 -O2 -pipe -Wall 
-W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith 
-Wchar-subscripts -Wformat=2 -Wbad-function-cast 
-Wno-duplicate-decl-specifier -Wstrict-aliasing=2  -L/usr/local/lib 
-o libssl_iostream.la  iostream-ssl.lo

libtool: link: ar cru .libs/libssl_iostream.a .libs/iostream-ssl.o
libtool: link: ranlib .libs/libssl_iostream.a
cc -DHAVE_CONFIG_H -I. -I../..  -I../../src/lib  -I../../src/lib-test 
-DMODULE_DIR=\""/usr/local/lib/dovecot"\" -I/usr/local/include 
-I../../src/lib  -I../../src/lib-test 
-DMODULE_DIR=\""/usr/local/lib/dovecot"\" -std=gnu99 -O2 -pipe -Wall -W 
-Wmissing-prototypes -Wmissing-declarations -Wpointer-arith 
-Wchar-subscripts -Wformat=2 -Wbad-function-cast 
-Wno-duplicate-decl-specifier -Wstrict-aliasing=2   -MT 
test_ssl_iostream-test-ssl-iostream.o -MD -MP -MF 
.deps/test_ssl_iostream-test-ssl-iostream.Tpo -c -o 
test_ssl_iostream-test-ssl-iostream.o `test -f 'test-ssl-iostream.c' || 
echo './'`test-ssl-iostream.c
mv -f .deps/test_ssl_iostream-test-ssl-iostream.Tpo 
.deps/test_ssl_iostream-test-ssl-iostream.Po
/usr/bin/libtool  --tag=CC--mode=link cc  -I../../src/lib 
-I../../src/lib-test  -DMODULE_DIR=\""/usr/local/lib/dovecot"\" 
-std=gnu99 -O2 -pipe -Wall -W -Wmissing-prototypes 
-Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 
-Wbad-function-cast -Wno-duplicate-decl-specifier -Wstrict-aliasing=2 
 -L/usr/local/lib  -o test-ssl-iostream 
test_ssl_iostream-test-ssl-iostream.o libssl_iostream_openssl.la 
libssl_iostream.la  ../lib-test/libtest.la  ../lib/liblib.la 
-export-dynamic
warning: library filename 
/home/ports/pobj/dovecot-2.2.34-no_db-no_ldap-no_mysql-no_postgresql/dovecot-2.2.34/src/lib-ssl-iostream/.libs/libssl_iostream_openssl.so 
has no version number
libtool: link: cc -o .libs/test-ssl-iostream -I../../src/lib 
-I../../src/lib-test -DMODULE_DIR="/usr/local/lib/dovecot" -std=gnu99 
-O2 -pipe -Wall -W -Wmissing-prototypes -Wmissing-declarations 
-Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast 
-Wno-duplicate-decl-specifier -Wstrict-aliasing=2 -Wl,-E 
test_ssl_iostream-test-ssl-iostream.o 
/home/ports/pobj/dovecot-2.2.34-no_db-no_ldap-no_mysql-no_postgresql/dovecot-2.2.34/src/lib-ssl-iostream/.libs/libssl_iostream.a 
/home/ports/pobj/dovecot-2.2.34-no_db-no_ldap-no_mysql-no_postgresql/dovecot-2.2.34/src/lib-test/.libs/libtest.a 
/home/ports/pobj/dovecot-2.2.34-no_db-no_ldap-no_mysql-no_postgresql/dovecot-2.2.34/src/lib/.libs/liblib.a 
-L.libs -lssl_iostream_openssl -lssl -lcrypto 
-Wl,-rpath,/usr/local/lib/dovecot
/home/ports/pobj/dovecot-2.2.34-no_db-no_ldap-no_mysql-no_postgresql/dovecot-2.2.34/src/lib/.libs/liblib.a(net.o): 
In function `net_connect_unix_with_retries':
net.c:(.text+0x852): warning: rand() may return deterministic values, is 
that what you want?
.libs/libssl_iostream_openssl.so: undefined reference to 
`ssl_iostream_cert_match_name'
.libs/libssl_iostream_openssl.so: undefined reference to 
`ssl_iostream_context_deinit'
.libs/libssl_iostream_openssl.so: undefined reference to 
`ssl_iostream_handshake'
.libs/libssl_iostream_openssl.so: undefined reference to 
`ssl_iostream_unref'
.libs/libssl_iostream_openssl.so: undefined reference to 
`iostream_ssl_module_init'
.libs/libssl_iostream_openssl.so: undefined reference to 
`ssl_iostream_has_valid_client_cert'

cc: error: linker command failed with exit code 1 (use -v to see invocation)
Error while executing cc -o .libs/test-ssl-iostream -I../../src/lib 
-I../../src/lib-test -DMODULE_DIR="/usr/local/lib/dovecot" -std=gnu99 
-O2 -pipe -Wall -W -Wmissing-prototypes -Wmissing-declarations 
-Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast 
-Wno-duplicate-decl-specifier -Wstrict-aliasing=2 -Wl,-E 
test_ssl_iostream-test-ssl-iostream.o 
/home/ports/pobj/dovecot-2.2.34-no_db-no_ldap-no_mysql-no_postgresql/dovecot-2.2.34/src/lib-ssl-iostream/.libs/libssl_iostream.a 
/home/ports/pobj/dovecot-2.2.34-no_db-no_ldap-no_mysql-no_postgresql/dovecot-2.2.34/src/lib-test/.libs/libtest.a 
/home/ports/pobj/dovecot-2.2.34-no_db-no_ldap-no_mysql-no_postgresql/dovecot-2.2.34/src/lib/.libs/liblib.a 
-L.libs -lssl_iostream_openssl -lssl -lcrypto 
-Wl,-rpath,/usr/local/lib/dovecot


A 6.0-ish build..

/usr/bin/libtool  --tag=CC--mode=link cc  -std=gnu99 -O2 -pipe -Wall 
-W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith 
-Wchar-subscripts -Wformat=2 -Wbad-function-cast -fno-builtin-strftime
 -Wstrict-aliasing=2 -I/usr/include -L/usr/local/lib -o 
libssl_iostream.la  iostream-ssl.lo

libtool: link: ar cru .libs/libssl_iostream.a .libs/iostream-ssl.o
libtool: link: ranlib .libs/libssl_iostream.a
cc -DHAVE_CONFIG_H -I. -I../..  -I../../src/lib  -I../../src/lib-test 

Re: [ext] Re: Panic: file smtp-address.c: line 530 (smtp_address_write): assertion failed: (smtp_char_is_qpair(*p))

2018-03-03 Thread Ralf Hildebrandt
> 1) Who or what is sending messages like that (without the proper
> capability support available at the server side)?

I think that was some sort of commercial mass mailer:

List-Unsubscribe:  

> 2) Why would an MTA accept this message? What software is doing that
> (and why)?

Postfix. It was just in the headers, so it was not relevvant for delivery.

> 3) What does the envelope address look like? Do both header and envelope
> have that umlaut (unlikely, because Dovecot should reject that already)?
> Maybe this could be fixed by substituting the envelope address if it is
> sufficiently similar.

Envelope sender is: bounce+15...@bounce.crsend.com

> 4) Where does this fail actually? At some point it is trying to
> construct an SMTP (RFC 5321) address from the header address (RFC 5322).
> Do you have a GDB backtrace with proper symbols?

Don't have a backtrace yet, but since the mail is still in the queue I
could try getting one.

-- 
Ralf Hildebrandt
  Geschäftsbereich IT | Abteilung Netzwerk
  Charité - Universitätsmedizin Berlin
  Campus Benjamin Franklin
  Hindenburgdamm 30 | D-12203 Berlin
  Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
  ralf.hildebra...@charite.de | https://www.charite.de



Re: sieve vacation alias handling problem

2018-03-03 Thread Karol Augustin
On 2018-03-03 21:28, Stephan Bosch wrote:
> Op 3/2/2018 om 3:35 PM schreef Karol Augustin:
>> Hi,
>>
>> I am using Dovecot LDA as LMTP renders envelope extension unusable.
>>
>> The problem I have noticed is that when user has multiple aliases sieve
>> responds to all of them, not only to :addresses specified.
>>
>> From testing it seems that :addresses only adds addresses to the list of
>> "known" emails to check against. It is not limiting it.
>>
>> As I understand, sieve should check if To: header is consistent with
>> addresses known to be users. But how Dovecot knows about aliases
>> assigned to the user?
>>
>> From my testing if header To: address is consistent with envelope To:
>> address the reply is fired. I have sieve_vacation_use_original_recipient
>> left at it's default value (no), so that shouldn't be the case. Now if
>> user addr...@example.com has alias al...@example.com specified, the
>> vacation reply will be sent to email addressed to al...@example.com,
>> which is weird, because this behavior should be enabled by switching
>> sieve_vacation_use_original_recipient to yes.
>>
>> When user receives an email that was originally sent to his gmail
>> account (forwarded) there is no reply. If I add gmail address to
>> :addresses reply is generated as expected.
>>
>> So my main question is if this is expected? I would like to enable only
>> delivery to primary address and to + extensions to that address by
>> default.
>>
>> I think that it might be that Postfix is expanding aliases and passing
>> the final recipient (as to=) to dovecot. Then dovecot is using that
>> address to check for explicit delivery, but something fails, as this
>> address is obviously not in To: header. So it looks like orig_to has to
>> be used as well which should be disabled by
>> sieve_vacation_use_original_recipient?
>>
>>
>> My address is: ka...@augustin.pl, alias is: ca...@augustin.pl
>>
>>
>> Mar  2 12:37:32 mail dovecot: lda(ka...@augustin.pl): sieve:
>> msgid=<3ba0578a5f6b170e942b5bac1b19b...@posteo.net>: sent vacation
>> response to 
>> Mar  2 12:37:32 mail postfix/qmgr[4744]: 3zt82h4CG4z2xlw: from=<>,
>> size=732, nrcpt=1 (queue active)
>> Mar  2 12:37:32 mail dovecot: lda(ka...@augustin.pl): sieve:
>> msgid=<3ba0578a5f6b170e942b5bac1b19b...@posteo.net>: stored mail into
>> mailbox 'INBOX'
>> Mar  2 12:37:32 mail postfix/pipe[8793]: 3zt82f3x4xz2xmw:
>> to=, orig_to=, relay=dovecot,
>> delay=2.2, delays=2.2/0/0/0.06, dsn=2.0.0, status=sent (delivered via
>> dovecot service)
>>
>>
>> Forward from from gmail:
>>
>> Mar  2 11:38:19 mail postfix/qmgr[4744]: 3zt6kL1yF7z2xgg:
>> from=, size=5831, nrcpt=1
>> (queue active)
>> Mar  2 11:38:19 mail dovecot: lda(ka...@augustin.pl): sieve:
>> msgid=: discarding vacation
>> response for implicitly delivered message; no known (envelope) recipient
>> address found in message headers (recipient=, and
>> additional `:addresses' are specified)
>> Mar  2 11:38:19 mail dovecot: lda(ka...@augustin.pl): sieve:
>> msgid=: stored mail into
>> mailbox 'INBOX'
>> Mar  2 11:38:19 mail postfix/pipe[5362]: 3zt6kL1yF7z2xgg:
>> to=, relay=dovecot, delay=1.3, delays=1.2/0/0/0.05,
>> dsn=2.0.0, status=sent (delivered via dovecot service)
>>
>>
>> from my master.cf:
>> dovecot unix - n n - - pipe
>>flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/dovecot-lda -f
>> ${sender} -a ${original_recipient} -d ${user}@${nexthop}
> 
> What is your configuration. Please provide output from `dovecot -n`.
> 
> Regards,
> 
> Stephan.

To clarify the problem. After more testing I figured that the vacation
works as specified in RFC, taking known address from envelope recipient
and comparing it with To and Cc. If it matches, which is true also for
aliases, the reply is generated.

My problem is that from documentation I understand that this behavior
(RFC5230 point 4.5 par 2.) is controlled by
sieve_vacation_use_original_recipient parameter, which doesn't disable
envelope address check if set at default "no" and also if explicitly set
in the config.

dovecot -n as requested:

# 2.2.33.2 (d6601f4ec): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.21 (92477967)
# OS: Linux 4.14.0-3-amd64 x86_64 Debian buster/sid ext4
auth_cache_negative_ttl = 1 mins
auth_cache_size = 3000 B
auth_master_user_separator = *
auth_mechanisms = plain login
auth_username_chars =
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@+
auth_verbose = yes
dict {
  expire = mysql:/etc/dovecot/dovecot-dict-expire.conf
  quota = mysql:/etc/dovecot/dovecot-dict-sql.conf
}
hostname = mail.nimitz.pl
imap_idle_notify_interval = 29 mins
listen = *, [::]
log_timestamp = "%Y-%m-%d %H:%M:%S "
login_log_format_elements = user=<%u> method=%m rip=%r lip=%l %c %k
mail_attribute_dict = 

Re: sieve vacation alias handling problem

2018-03-03 Thread Stephan Bosch
Op 3/2/2018 om 3:35 PM schreef Karol Augustin:
> Hi,
>
> I am using Dovecot LDA as LMTP renders envelope extension unusable.
>
> The problem I have noticed is that when user has multiple aliases sieve
> responds to all of them, not only to :addresses specified.
>
> From testing it seems that :addresses only adds addresses to the list of
> "known" emails to check against. It is not limiting it.
>
> As I understand, sieve should check if To: header is consistent with
> addresses known to be users. But how Dovecot knows about aliases
> assigned to the user?
>
> From my testing if header To: address is consistent with envelope To:
> address the reply is fired. I have sieve_vacation_use_original_recipient
> left at it's default value (no), so that shouldn't be the case. Now if
> user addr...@example.com has alias al...@example.com specified, the
> vacation reply will be sent to email addressed to al...@example.com,
> which is weird, because this behavior should be enabled by switching
> sieve_vacation_use_original_recipient to yes.
>
> When user receives an email that was originally sent to his gmail
> account (forwarded) there is no reply. If I add gmail address to
> :addresses reply is generated as expected.
>
> So my main question is if this is expected? I would like to enable only
> delivery to primary address and to + extensions to that address by
> default.
>
> I think that it might be that Postfix is expanding aliases and passing
> the final recipient (as to=) to dovecot. Then dovecot is using that
> address to check for explicit delivery, but something fails, as this
> address is obviously not in To: header. So it looks like orig_to has to
> be used as well which should be disabled by
> sieve_vacation_use_original_recipient?
>
>
> My address is: ka...@augustin.pl, alias is: ca...@augustin.pl
>
>
> Mar  2 12:37:32 mail dovecot: lda(ka...@augustin.pl): sieve:
> msgid=<3ba0578a5f6b170e942b5bac1b19b...@posteo.net>: sent vacation
> response to 
> Mar  2 12:37:32 mail postfix/qmgr[4744]: 3zt82h4CG4z2xlw: from=<>,
> size=732, nrcpt=1 (queue active)
> Mar  2 12:37:32 mail dovecot: lda(ka...@augustin.pl): sieve:
> msgid=<3ba0578a5f6b170e942b5bac1b19b...@posteo.net>: stored mail into
> mailbox 'INBOX'
> Mar  2 12:37:32 mail postfix/pipe[8793]: 3zt82f3x4xz2xmw:
> to=, orig_to=, relay=dovecot,
> delay=2.2, delays=2.2/0/0/0.06, dsn=2.0.0, status=sent (delivered via
> dovecot service)
>
>
> Forward from from gmail:
>
> Mar  2 11:38:19 mail postfix/qmgr[4744]: 3zt6kL1yF7z2xgg:
> from=, size=5831, nrcpt=1
> (queue active)
> Mar  2 11:38:19 mail dovecot: lda(ka...@augustin.pl): sieve:
> msgid=: discarding vacation
> response for implicitly delivered message; no known (envelope) recipient
> address found in message headers (recipient=, and
> additional `:addresses' are specified)
> Mar  2 11:38:19 mail dovecot: lda(ka...@augustin.pl): sieve:
> msgid=: stored mail into
> mailbox 'INBOX'
> Mar  2 11:38:19 mail postfix/pipe[5362]: 3zt6kL1yF7z2xgg:
> to=, relay=dovecot, delay=1.3, delays=1.2/0/0/0.05,
> dsn=2.0.0, status=sent (delivered via dovecot service)
>
>
> from my master.cf:
> dovecot unix - n n - - pipe
>flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/dovecot-lda -f
> ${sender} -a ${original_recipient} -d ${user}@${nexthop}

What is your configuration. Please provide output from `dovecot -n`.

Regards,

Stephan.



Re: Panic: file smtp-address.c: line 530 (smtp_address_write): assertion failed: (smtp_char_is_qpair(*p))

2018-03-03 Thread Stephan Bosch
Hi Ralf,

Op 3/2/2018 om 3:32 PM schreef Ralf Hildebrandt:
> I have an email which cannot be delivered using LMTP:
>
> Mar  2 15:26:54 mail-cbf dovecot: 
> lmtp(backup@backup.invalid)<29736>: Panic: file 
> smtp-address.c: line 530 (smtp_address_write): assertion failed: 
> (smtp_char_is_qpair(*p))
> Mar  2 15:26:54 mail-cbf dovecot: 
> lmtp(backup@backup.invalid)<29736>: Error: Raw 
> backtrace: /usr/lib/dovecot/libdovecot.so.0(+0xc6aca) [0x7f7fb50d3aca] -> 
> /usr/lib/dovecot/libdovecot.so.0(+0xc6bad) 

A panic like that is always a bad thing and it should be fixed. Question
is how this should be addressed.

> Using  dovecot 2:2.3.0.1-6 packages on Ubuntu 16.04
>
> The address causing the error is:
>
> From: =?utf-8?Q?Dorit_M=C3=BCller?= 
>
> Note the "umlaut" in the email address... :)

Clearly, the relevant specifications don't allow UTF-8 in the local part
without email address internationalization (EAI), which Dovecot does not
support nor announce yet (although that should be mended somewhat soon).
My preferred fix for now would be to reject addresses like that, which
would maybe still mean that this message is rejected entirely.
Alternatively, that address at least needs to be skipped, ignored, or
modified: all of which aren't very nice things to do. The alternative is
forwarding this violation to other systems, which is seldom acceptable
either.

But first a few questions:

1) Who or what is sending messages like that (without the proper
capability support available at the server side)?
2) Why would an MTA accept this message? What software is doing that
(and why)?
3) What does the envelope address look like? Do both header and envelope
have that umlaut (unlikely, because Dovecot should reject that already)?
Maybe this could be fixed by substituting the envelope address if it is
sufficiently similar.
4) Where does this fail actually? At some point it is trying to
construct an SMTP (RFC 5321) address from the header address (RFC 5322).
Do you have a GDB backtrace with proper symbols?

Regards,

Stephan.



RE: Dovecot (doveadm, ssl, sync) - SSL error

2018-03-03 Thread Arkadiusz Majewski
Hello!

 

dsync SSL still doesn't work for replication, so I've disabled it and tried
to sync without.

But I have a problem with temp directory.

 

Is it possible to change path to temp folder?

I don't want to set permissions but change temporary folder for replication.

Thanks in advance.

 

 

dovecot: doveadm: Error: safe_mkstemp(/tmp/dovecot.doveadm.) failed:
Permission denied

 

 

Arkadiusz Majewski

 

From: Arkadiusz Majewski  
Sent: Sunday, December 3, 2017 7:38 PM
To: 'dovecot@dovecot.org' 
Subject: Dovecot (doveadm, ssl, sync) - SSL error

 

Hello!

I've got a problem to run syncing between both dovecot services on the
separate servers.
The error indicates to the problem with SSL.

Directly using openssl command to connect from one server to other and vice
versa is passed without any errors.

 

OS: FreeBSD 11.1-RELEASE-p4

Dovecot: 2.2.33.2_2 and the older one dovecot-2.2.32.1_1 (or similar) -
build by ports.

OpenSSL: 1.0.2k-freebsd 26 Jan 2017

 

dovecot: doveadm(10.18.1.15): Error: doveadm client disconnected before
handshake: SSL_accept() failed: error:140760FC:SSL
routines:SSL23_GET_CLIENT_HELLO:unknown protocol

 

dovecot.conf (on both servers):

 

mail_plugins = $mail_plugins notify replication

 

service replicator {

  process_min_avail = 1

}

 

service aggregator {

  fifo_listener replication-notify-fifo {

user = dovecot

  }

  unix_listener replication-notify {

user = dovecot

  }

}

 

service replicator {

  unix_listener replicator-doveadm {

mode = 0600

  }

}

 

replication_max_conns = 10

 

service doveadm {

  inet_listener {

port = 12130

ssl = yes

  }

}

 

ssl = required
ssl_protocols = SSLv3 TLSv1 TLSv1.1 TLSv1.2
ssl_cert = 

Re: pigeonhole 0.4.22 with sieve_before script crashes

2018-03-03 Thread Stephan Bosch
Op 3/3/2018 om 6:17 PM schreef Jan:
 We're looking into it.
>>> Right, this is not reproducible in the test suite, but I can reproduce
>>> it when I replicate your setup.
>>
>> I created a special test suite that reproduces the problem reliably.
>> This occurs when Sieve editheader, Sieve redirect and LMTP are combined.
>>
>> Now to fix it...
>
> Hello Stephan!
>
> Thank you for your quick reply and the informations.
> If a fix is available, I will test it.

There is a fix. Pending internal review, I will submit it here.

Regards,

Stephan.



Re: pigeonhole 0.4.22 with sieve_before script crashes

2018-03-03 Thread Jan

We're looking into it.

Right, this is not reproducible in the test suite, but I can reproduce
it when I replicate your setup.


I created a special test suite that reproduces the problem reliably.
This occurs when Sieve editheader, Sieve redirect and LMTP are 
combined.


Now to fix it...


Hello Stephan!

Thank you for your quick reply and the informations.
If a fix is available, I will test it.

Regards,
Jan


Re: Virtual question

2018-03-03 Thread LuKreme
Sorry, the correct path is:

# cat /usr/local/etc/dovecot/virtual/month/dovecot-vitual 
# ~/Maildir/virtual/month/dovecot-virtual
*
  all younger 2678400

>  # cat /usr/local/etc/virtual/month/dovecot-vitual 

-- 
My main job is trying to come up with new and innovative and effective ways to 
reject even more mail. I'm up to about 97% now.




Re: pigeonhole 0.4.22 with sieve_before script crashes

2018-03-03 Thread Stephan Bosch
Op 3/3/2018 om 9:35 AM schreef Stephan Bosch:
> Op 3/3/2018 om 9:15 AM schreef Stephan Bosch:
>> Op 3/3/2018 om 2:57 AM schreef Jan:
>>> Hello!
>>>
>> We're looking into it.
> Right, this is not reproducible in the test suite, but I can reproduce
> it when I replicate your setup.

I created a special test suite that reproduces the problem reliably.
This occurs when Sieve editheader, Sieve redirect and LMTP are combined.

Now to fix it...

Regards,

Stephan.

>>> Dovecot 2.2.34 (874deae)
>>> Pigeonhole version 0.4.22 (22940fb7)
>>>
>>> After the update to pigeonhole version 0.4.22 the following
>>> configuration does not work. With version 0.4.21 it works.
>>>
>>> dovecot.conf (only sieve configuration)
>>> ---
>>> 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 editheader
>>> sieve = file:~/sieve;active=~/.dovecot.sieve
>>> sieve_before = /etc/dovecot/sieve/filter
>>> sieve_extensions = +editheader
>>> sieve_max_script_size = 1M
>>> service managesieve-login {
>>>   inet_listener sieve {
>>>     port = 4190
>>>   }
>>> }
>>> protocol sieve {
>>>   mail_max_userip_connections = 10
>>>   managesieve_implementation_string = Sieve
>>>   managesieve_logout_format = bytes=%i/%o
>>> }
>>> ---
>>>
>>> sieve_before script for all users (/etc/dovecot/sieve/filter)
>>> ---
>>> require ["editheader"];
>>>
>>> if header :contains "X-Spam-Flag" "YES" {
>>>   addheader "X-Filter-Junk-Flag" "YES";
>>>   addheader "X-Filter-Junk-Type" "SPAM";
>>> }
>>> elsif header :contains "X-Amavis-Alert" "INFECTED" {
>>>   addheader "X-Filter-Junk-Flag" "YES";
>>>   addheader "X-Filter-Junk-Type" "VIRUS";
>>> }
>>> elsif header :contains "X-Amavis-Alert" "BANNED" {
>>>   addheader "X-Filter-Junk-Flag" "YES";
>>>   addheader "X-Filter-Junk-Type" "ATTACHMENT";
>>> }
>>> else {
>>>   addheader "X-Filter-Junk-Flag" "NO";
>>>   addheader "X-Filter-Junk-Type" "NONE";
>>> }
>>> ---
>>>
>>> sieve script for user post...@example.com (.dovecot.sieve)
>>> ---
>>> require ["copy"];
>>> if allof (header :is "X-Filter-Junk-Flag" "NO")
>>> {
>>>   redirect :copy "c...@example.com";
>>> }
>>> ---
>>>
>>> I use LMTP to deliver the mail to the user and the
>>> following error occurs:
>>>
>>> Mar  3 02:31:34 test dovecot: lmtp(post...@example.com): Panic: file
>>> istream.c: line 197 (i_stream_read): assertion failed:
>>> ((size_t)ret+old_size == _stream->pos - _stream->skip)
>>> Mar  3 02:31:34 test dovecot: lmtp(post...@example.com): Error: Raw
>>> backtrace: /usr/local/lib/dovecot/libdovecot.so.0(+0x9c7a0)
>>> [0x7f8c015be7a0] -> /usr/local/lib/dovecot/libdovecot.so.0(+0x9c88c)
>>> [0x7f8c015be88c] -> /usr/local/lib/dovecot/libdovecot.so.0(i_fatal+0)
>>> [0x7f8c0155294d] ->
>>> /usr/local/lib/dovecot/libdovecot.so.0(i_stream_read+0x2c8)
>>> [0x7f8c015c99d8] ->
>>> /usr/local/lib/dovecot/libdovecot.so.0(i_stream_read_data+0x3d)
>>> [0x7f8c015ca15d] ->
>>> /usr/local/lib/dovecot/libdovecot.so.0(message_parse_header_next+0x63)
>>> [0x7f8c015a72e3] -> /usr/local/lib/dovecot/libdovecot.so.0(+0x7efb1)
>>> [0x7f8c015a0fb1] ->
>>> /usr/local/lib/dovecot/libdovecot.so.0(i_stream_read+0x53)
>>> [0x7f8c015c9763] ->
>>> /usr/local/lib/dovecot/libdovecot.so.0(i_stream_read_data+0x3d)
>>> [0x7f8c015ca15d] ->
>>> /usr/local/lib/dovecot/libdovecot.so.0(io_stream_copy+0x75)
>>> [0x7f8c015df1a5] -> /usr/local/lib/dovecot/libdovecot.so.0(+0xbf5e0)
>>> [0x7f8c015e15e0] ->
>>> /usr/local/lib/dovecot/libdovecot.so.0(o_stream_send_istream+0x33)
>>> [0x7f8c015df003] ->
>>> /usr/local/lib/dovecot/libdovecot-sieve.so.0(+0x4dbf4)
>>> [0x7f8bfbb3abf4] ->
>>> /usr/local/lib/dovecot/libdovecot-sieve.so.0(+0x3f22a)
>>> [0x7f8bfbb2c22a] ->
>>> /usr/local/lib/dovecot/libdovecot-sieve.so.0(sieve_result_execute+0x27f)
>>> [0x7f8bfbb2da6f] ->
>>> /usr/local/lib/dovecot/libdovecot-sieve.so.0(+0x502ee)
>>> [0x7f8bfbb3d2ee] ->
>>> /usr/local/lib/dovecot/libdovecot-sieve.so.0(sieve_multiscript_run+0xa6)
>>> [0x7f8bfbb3def6] ->
>>> /usr/local/lib/dovecot/lib90_sieve_plugin.so(+0x379a) [0x7f8bfbda279a]
>>> -> /usr/local/lib/dovecot/libdovecot-lda.so.0(mail_deliver+0xa2)
>>> [0x7f8c01b9d942] -> dovecot/lmtp [DATA 127.0.0.1
>>> post...@example.com]() [0x406c0b] ->
>>> /usr/local/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x52)
>>> [0x7f8c015d3c22] ->
>>> /usr/local/lib/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0xea)
>>> [0x7f8c015d51ca] ->
>>> 

Re: Debian: Dovecot 2.3.0.1 won't start if dovecot-pop3d is missing

2018-03-03 Thread Markus Schönhaber
Stephan Bosch, Sat, 3 Mar 2018 08:59:16 +0100:

> Op 3/2/2018 om 8:58 PM schreef Markus Schönhaber:

>> Yep, explicitly setting
>> protocols =
>> before
>> !include_try /usr/share/dovecot/protocols.d/*.protocol
>> helps.
>>
>> IMO Something like that should be changed in the official packages too.
> 
> The official packages patch Dovecot to set the protocols to none in the
> defaul config.

First: Many thanks for providing the package repository!

WRT the default config: doesn't seem so.
I purged all Dovecot packages, removed /etc/dovecot and did

> apt -V install dovecot-imapd dovecot-lmtpd dovecot-managesieved dovecot-mysql 
> dovecot-sqlite dovecot-solr dovecot-lucene

but the freshly installed dovecot won't start because
/usr/lib/dovecot/pop3 is not there.

> # doveconf protocols
> protocols = imap pop3 lmtp imap lmtp sieve

> # LANG=C apt-cache policy dovecot-core 
> dovecot-core:
>   Installed: 2:2.3.0.1-6
>   Candidate: 2:2.3.0.1-6
>   Version table:
>  *** 2:2.3.0.1-6 500
> 500 http://repo.dovecot.org/ce-2.3-latest/debian/stretch stretch/main 
> amd64 Packages
> 100 /var/lib/dpkg/status
>  2:2.3.0-4 500
> 500 http://repo.dovecot.org/ce-2.3-latest/debian/stretch stretch/main 
> amd64 Packages
>  2:2.3.0-3 500
> 500 http://repo.dovecot.org/ce-2.3-latest/debian/stretch stretch/main 
> amd64 Packages
>  2:2.3.0-2 500
> 500 http://repo.dovecot.org/ce-2.3-latest/debian/stretch stretch/main 
> amd64 Packages
>  2:2.2.34-1~ddt1 500
> 500 http://ddt-web5/stretch stretch/main amd64 Packages
>  1:2.2.27-3+deb9u2 500
> 500 http://security.debian.org stretch/updates/main amd64 Packages
>  1:2.2.27-3+deb9u1 500
> 500 http://ftp.de.debian.org/debian stretch/main amd64 Packages

> # doveconf -n
> # 2.3.0.1 (ffd8a29): /etc/dovecot/dovecot.conf
> # Pigeonhole version 0.5.0.1 (d33dca2)
> # OS: Linux 4.9.0-6-amd64 x86_64 Debian 9.3 
> doveconf: Error: t_readlink(/var/run/dovecot/dovecot.conf) failed: readlink() 
> failed: No such file or directory
> mail_location = mbox:~/mail:INBOX=/var/mail/%u
> 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
> namespace inbox {
>   inbox = yes
>   location = 
>   mailbox Drafts {
> special_use = \Drafts
>   }
>   mailbox Junk {
> special_use = \Junk
>   }
>   mailbox Sent {
> special_use = \Sent
>   }
>   mailbox "Sent Messages" {
> special_use = \Sent
>   }
>   mailbox Trash {
> special_use = \Trash
>   }
>   prefix = 
> }
> passdb {
>   driver = pam
> }
> plugin {
>   sieve = file:~/sieve;active=~/.dovecot.sieve
> }
> protocols = imap pop3 lmtp imap lmtp sieve
> ssl = no
> userdb {
>   driver = passwd
> }


-- 
Regards
  mks



Re: pigeonhole 0.4.22 with sieve_before script crashes

2018-03-03 Thread Stephan Bosch
Op 3/3/2018 om 9:15 AM schreef Stephan Bosch:
> Op 3/3/2018 om 2:57 AM schreef Jan:
>> Hello!
>>
> We're looking into it.

Right, this is not reproducible in the test suite, but I can reproduce
it when I replicate your setup.

Regards,

Stephan.

>> Dovecot 2.2.34 (874deae)
>> Pigeonhole version 0.4.22 (22940fb7)
>>
>> After the update to pigeonhole version 0.4.22 the following
>> configuration does not work. With version 0.4.21 it works.
>>
>> dovecot.conf (only sieve configuration)
>> ---
>> 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 editheader
>> sieve = file:~/sieve;active=~/.dovecot.sieve
>> sieve_before = /etc/dovecot/sieve/filter
>> sieve_extensions = +editheader
>> sieve_max_script_size = 1M
>> service managesieve-login {
>>   inet_listener sieve {
>>     port = 4190
>>   }
>> }
>> protocol sieve {
>>   mail_max_userip_connections = 10
>>   managesieve_implementation_string = Sieve
>>   managesieve_logout_format = bytes=%i/%o
>> }
>> ---
>>
>> sieve_before script for all users (/etc/dovecot/sieve/filter)
>> ---
>> require ["editheader"];
>>
>> if header :contains "X-Spam-Flag" "YES" {
>>   addheader "X-Filter-Junk-Flag" "YES";
>>   addheader "X-Filter-Junk-Type" "SPAM";
>> }
>> elsif header :contains "X-Amavis-Alert" "INFECTED" {
>>   addheader "X-Filter-Junk-Flag" "YES";
>>   addheader "X-Filter-Junk-Type" "VIRUS";
>> }
>> elsif header :contains "X-Amavis-Alert" "BANNED" {
>>   addheader "X-Filter-Junk-Flag" "YES";
>>   addheader "X-Filter-Junk-Type" "ATTACHMENT";
>> }
>> else {
>>   addheader "X-Filter-Junk-Flag" "NO";
>>   addheader "X-Filter-Junk-Type" "NONE";
>> }
>> ---
>>
>> sieve script for user post...@example.com (.dovecot.sieve)
>> ---
>> require ["copy"];
>> if allof (header :is "X-Filter-Junk-Flag" "NO")
>> {
>>   redirect :copy "c...@example.com";
>> }
>> ---
>>
>> I use LMTP to deliver the mail to the user and the
>> following error occurs:
>>
>> Mar  3 02:31:34 test dovecot: lmtp(post...@example.com): Panic: file
>> istream.c: line 197 (i_stream_read): assertion failed:
>> ((size_t)ret+old_size == _stream->pos - _stream->skip)
>> Mar  3 02:31:34 test dovecot: lmtp(post...@example.com): Error: Raw
>> backtrace: /usr/local/lib/dovecot/libdovecot.so.0(+0x9c7a0)
>> [0x7f8c015be7a0] -> /usr/local/lib/dovecot/libdovecot.so.0(+0x9c88c)
>> [0x7f8c015be88c] -> /usr/local/lib/dovecot/libdovecot.so.0(i_fatal+0)
>> [0x7f8c0155294d] ->
>> /usr/local/lib/dovecot/libdovecot.so.0(i_stream_read+0x2c8)
>> [0x7f8c015c99d8] ->
>> /usr/local/lib/dovecot/libdovecot.so.0(i_stream_read_data+0x3d)
>> [0x7f8c015ca15d] ->
>> /usr/local/lib/dovecot/libdovecot.so.0(message_parse_header_next+0x63)
>> [0x7f8c015a72e3] -> /usr/local/lib/dovecot/libdovecot.so.0(+0x7efb1)
>> [0x7f8c015a0fb1] ->
>> /usr/local/lib/dovecot/libdovecot.so.0(i_stream_read+0x53)
>> [0x7f8c015c9763] ->
>> /usr/local/lib/dovecot/libdovecot.so.0(i_stream_read_data+0x3d)
>> [0x7f8c015ca15d] ->
>> /usr/local/lib/dovecot/libdovecot.so.0(io_stream_copy+0x75)
>> [0x7f8c015df1a5] -> /usr/local/lib/dovecot/libdovecot.so.0(+0xbf5e0)
>> [0x7f8c015e15e0] ->
>> /usr/local/lib/dovecot/libdovecot.so.0(o_stream_send_istream+0x33)
>> [0x7f8c015df003] ->
>> /usr/local/lib/dovecot/libdovecot-sieve.so.0(+0x4dbf4)
>> [0x7f8bfbb3abf4] ->
>> /usr/local/lib/dovecot/libdovecot-sieve.so.0(+0x3f22a)
>> [0x7f8bfbb2c22a] ->
>> /usr/local/lib/dovecot/libdovecot-sieve.so.0(sieve_result_execute+0x27f)
>> [0x7f8bfbb2da6f] ->
>> /usr/local/lib/dovecot/libdovecot-sieve.so.0(+0x502ee)
>> [0x7f8bfbb3d2ee] ->
>> /usr/local/lib/dovecot/libdovecot-sieve.so.0(sieve_multiscript_run+0xa6)
>> [0x7f8bfbb3def6] ->
>> /usr/local/lib/dovecot/lib90_sieve_plugin.so(+0x379a) [0x7f8bfbda279a]
>> -> /usr/local/lib/dovecot/libdovecot-lda.so.0(mail_deliver+0xa2)
>> [0x7f8c01b9d942] -> dovecot/lmtp [DATA 127.0.0.1
>> post...@example.com]() [0x406c0b] ->
>> /usr/local/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x52)
>> [0x7f8c015d3c22] ->
>> /usr/local/lib/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0xea)
>> [0x7f8c015d51ca] ->
>> /usr/local/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x3c)
>> [0x7f8c015d3cbc] ->
>> /usr/local/lib/dovecot/libdovecot.so.0(io_loop_run+0x38)
>> [0x7f8c015d3e68] ->
>> /usr/local/lib/dovecot/libdovecot.so.0(master_service_run+0x13)
>> [0x7f8c0155caa3] -> dovecot/lmtp [DATA 127.0.0.1
>> post...@example.com](main+0x18c) [0x404fbc] ->

Re: pigeonhole 0.4.22 with sieve_before script crashes

2018-03-03 Thread Stephan Bosch
Op 3/3/2018 om 2:57 AM schreef Jan:
> Hello!
>

We're looking into it.

Regards,

Stephan.

> Dovecot 2.2.34 (874deae)
> Pigeonhole version 0.4.22 (22940fb7)
>
> After the update to pigeonhole version 0.4.22 the following
> configuration does not work. With version 0.4.21 it works.
>
> dovecot.conf (only sieve configuration)
> ---
> 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 editheader
> sieve = file:~/sieve;active=~/.dovecot.sieve
> sieve_before = /etc/dovecot/sieve/filter
> sieve_extensions = +editheader
> sieve_max_script_size = 1M
> service managesieve-login {
>   inet_listener sieve {
>     port = 4190
>   }
> }
> protocol sieve {
>   mail_max_userip_connections = 10
>   managesieve_implementation_string = Sieve
>   managesieve_logout_format = bytes=%i/%o
> }
> ---
>
> sieve_before script for all users (/etc/dovecot/sieve/filter)
> ---
> require ["editheader"];
>
> if header :contains "X-Spam-Flag" "YES" {
>   addheader "X-Filter-Junk-Flag" "YES";
>   addheader "X-Filter-Junk-Type" "SPAM";
> }
> elsif header :contains "X-Amavis-Alert" "INFECTED" {
>   addheader "X-Filter-Junk-Flag" "YES";
>   addheader "X-Filter-Junk-Type" "VIRUS";
> }
> elsif header :contains "X-Amavis-Alert" "BANNED" {
>   addheader "X-Filter-Junk-Flag" "YES";
>   addheader "X-Filter-Junk-Type" "ATTACHMENT";
> }
> else {
>   addheader "X-Filter-Junk-Flag" "NO";
>   addheader "X-Filter-Junk-Type" "NONE";
> }
> ---
>
> sieve script for user post...@example.com (.dovecot.sieve)
> ---
> require ["copy"];
> if allof (header :is "X-Filter-Junk-Flag" "NO")
> {
>   redirect :copy "c...@example.com";
> }
> ---
>
> I use LMTP to deliver the mail to the user and the
> following error occurs:
>
> Mar  3 02:31:34 test dovecot: lmtp(post...@example.com): Panic: file
> istream.c: line 197 (i_stream_read): assertion failed:
> ((size_t)ret+old_size == _stream->pos - _stream->skip)
> Mar  3 02:31:34 test dovecot: lmtp(post...@example.com): Error: Raw
> backtrace: /usr/local/lib/dovecot/libdovecot.so.0(+0x9c7a0)
> [0x7f8c015be7a0] -> /usr/local/lib/dovecot/libdovecot.so.0(+0x9c88c)
> [0x7f8c015be88c] -> /usr/local/lib/dovecot/libdovecot.so.0(i_fatal+0)
> [0x7f8c0155294d] ->
> /usr/local/lib/dovecot/libdovecot.so.0(i_stream_read+0x2c8)
> [0x7f8c015c99d8] ->
> /usr/local/lib/dovecot/libdovecot.so.0(i_stream_read_data+0x3d)
> [0x7f8c015ca15d] ->
> /usr/local/lib/dovecot/libdovecot.so.0(message_parse_header_next+0x63)
> [0x7f8c015a72e3] -> /usr/local/lib/dovecot/libdovecot.so.0(+0x7efb1)
> [0x7f8c015a0fb1] ->
> /usr/local/lib/dovecot/libdovecot.so.0(i_stream_read+0x53)
> [0x7f8c015c9763] ->
> /usr/local/lib/dovecot/libdovecot.so.0(i_stream_read_data+0x3d)
> [0x7f8c015ca15d] ->
> /usr/local/lib/dovecot/libdovecot.so.0(io_stream_copy+0x75)
> [0x7f8c015df1a5] -> /usr/local/lib/dovecot/libdovecot.so.0(+0xbf5e0)
> [0x7f8c015e15e0] ->
> /usr/local/lib/dovecot/libdovecot.so.0(o_stream_send_istream+0x33)
> [0x7f8c015df003] ->
> /usr/local/lib/dovecot/libdovecot-sieve.so.0(+0x4dbf4)
> [0x7f8bfbb3abf4] ->
> /usr/local/lib/dovecot/libdovecot-sieve.so.0(+0x3f22a)
> [0x7f8bfbb2c22a] ->
> /usr/local/lib/dovecot/libdovecot-sieve.so.0(sieve_result_execute+0x27f)
> [0x7f8bfbb2da6f] ->
> /usr/local/lib/dovecot/libdovecot-sieve.so.0(+0x502ee)
> [0x7f8bfbb3d2ee] ->
> /usr/local/lib/dovecot/libdovecot-sieve.so.0(sieve_multiscript_run+0xa6)
> [0x7f8bfbb3def6] ->
> /usr/local/lib/dovecot/lib90_sieve_plugin.so(+0x379a) [0x7f8bfbda279a]
> -> /usr/local/lib/dovecot/libdovecot-lda.so.0(mail_deliver+0xa2)
> [0x7f8c01b9d942] -> dovecot/lmtp [DATA 127.0.0.1
> post...@example.com]() [0x406c0b] ->
> /usr/local/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x52)
> [0x7f8c015d3c22] ->
> /usr/local/lib/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0xea)
> [0x7f8c015d51ca] ->
> /usr/local/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x3c)
> [0x7f8c015d3cbc] ->
> /usr/local/lib/dovecot/libdovecot.so.0(io_loop_run+0x38)
> [0x7f8c015d3e68] ->
> /usr/local/lib/dovecot/libdovecot.so.0(master_service_run+0x13)
> [0x7f8c0155caa3] -> dovecot/lmtp [DATA 127.0.0.1
> post...@example.com](main+0x18c) [0x404fbc] ->
> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)
> [0x7f8c01198b45] -> dovecot/lmtp [DATA 127.0.0.1
> post...@example.com]() [0x405065]
> Mar  3 02:31:34 test dovecot: lmtp(post...@example.com): Fatal:
> master: service(lmtp): child 13445 killed with signal 6 

Re: Debian: Dovecot 2.3.0.1 won't start if dovecot-pop3d is missing

2018-03-03 Thread Stephan Bosch
Op 3/2/2018 om 8:58 PM schreef Markus Schönhaber:
> Aki Tuomi, Fri, 02 Mar 2018 20:06:35 +0200:
>
>> the problem is default
>>  protocols = imap pop3 
> Ah, OK. I wasn't aware that the default had changed. It seems to be
> protocols = imap pop3 lmtp
> now.
>
>> packaging should use
>> protocols =
>> protocols = $protocols imap
> Yep, explicitly setting
> protocols =
> before
> !include_try /usr/share/dovecot/protocols.d/*.protocol
> helps.
>
> IMO Something like that should be changed in the official packages too.

The official packages patch Dovecot to set the protocols to none in the
defaul config.

Regards,

Stephan.