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

2018-03-07 Thread Stephan Bosch
Op 3/6/2018 om 2:46 AM schreef Stephan Bosch:
> Op 3/5/2018 om 3:14 PM schreef Ralf Hildebrandt:
>> Got a coredump:
>>
>> Mar  5 15:09:42 mail-cbf dovecot: 
>> lmtp(backup@backup.invalid)<15425><2B+kCaZPnVpBPAAAplP5LA>: Fatal: master: 
>> service(lmtp): child 15425 killed with signal 6 (core dumped)
> Hmm, yes, I think this an unnecessary RFC5322 -> RFC5321 address
> translation. Will look at making a fix tomorrow.

There is a fix pending review.

Regards,

Stephan.


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

2018-03-05 Thread Stephan Bosch
Op 3/5/2018 om 3:14 PM schreef Ralf Hildebrandt:
> Got a coredump:
>
> Mar  5 15:09:42 mail-cbf dovecot: 
> lmtp(backup@backup.invalid)<15425><2B+kCaZPnVpBPAAAplP5LA>: Fatal: master: 
> service(lmtp): child 15425 killed with signal 6 (core dumped)

Hmm, yes, I think this an unnecessary RFC5322 -> RFC5321 address
translation. Will look at making a fix tomorrow.

Regards,

Stephan.

>
>
> #0  0x7fea19977428 in __GI_raise (sig=sig@entry=6) at 
> ../sysdeps/unix/sysv/linux/raise.c:54
> resultvar = 0
> pid = 15425
> selftid = 15425
> #1  0x7fea1997902a in __GI_abort () at abort.c:89
> save_stage = 2
> act = {
>   __sigaction_handler = {
> sa_handler = 0x56239d9a3890, 
> sa_sigaction = 0x56239d9a3890
>   }, 
>   sa_mask = {
> __val = {1, 94710917811261, 140643428345904, 94710917811577, 0, 
> 140735221053024, 94710938452648, 513, 7700885895375379200, 0, 
> 140643433202867, 94710938452648, 
>   140735221053120, 94710938452304, 140643433203225, 
> 94710938452648}
>   }, 
>   sa_flags = 433895898, 
>   sa_restorer = 0x5
> }
> sigs = {
>   __val = {32, 0 }
> }
> #2  0x7fea19dd2aaf in default_fatal_finish (type=LOG_TYPE_PANIC, 
> status=status@entry=0) at failures.c:228
> backtrace = 0x56239bd7c2e0 
> "/usr/lib/dovecot/libdovecot.so.0(+0xc6aca) [0x7fea19dd2aca] -> 
> /usr/lib/dovecot/libdovecot.so.0(+0xc6bad) [0x7fea19dd2bad] -> 
> /usr/lib/dovecot/libdovecot.so.0(i_fatal+0) [0x7fea19d44721] -> /usr/lib/d"...
> recursed = 0
> #3  0x7fea19dd2bad in i_internal_fatal_handler (ctx=0x7fff78dbb710, 
> format=, args=) at failures.c:718
> status = 0
> #4  0x7fea19d44721 in i_panic (format=format@entry=0x7fea19e0ec98 "file 
> %s: line %d (%s): assertion failed: (%s)") at failures.c:306
> ctx = {
>   type = LOG_TYPE_PANIC, 
>   exit_status = 0, 
>   timestamp = 0x0, 
>   timestamp_usecs = 0, 
>   log_prefix = 0x0
> }
> args =  pointer.)>
> #5  0x7fea19d4831d in smtp_address_write (out=0x56239bd7c150, 
> address=0x56239bd7c108) at smtp-address.c:530
> quoted = 
> p = 0x56239bd7c11b "üller"
> pend = 0x56239bd7c121 ""
> pblock = 0x56239bd7c11a "müller"
> __func__ = "smtp_address_write"
> #6  0x7fea19d48411 in smtp_address_encode (address=0x56239bd7c108) at 
> smtp-address.c:567
> str = 0x56239bd7c150
> #7  0x7fea1a3cf774 in mail_deliver_log_update_cache 
> (cache=cache@entry=0x56239bddf1c8, pool=0x56239bddf180, mail=0x56239be185c8) 
> at mail-deliver.c:111
> message_id = 0x56239d943a4c 
> ""
> subject = 0x56239d943b69 "JOMEC Seminar | Von Kennzahlencockpits und 
> Lean Hospital Strategien"
> from_envelope = 0x0
> from = 
> #8  0x7fea1a3cfabf in mail_deliver_save_finish (ctx=0x56239be14ca0) at 
> mail-deliver.c:533
> box = 
> mbox = 0x56239be0efc0
> muser = 0x56239bdcb7c0
> dt = 0x56239bddf1c0
> #9  0x7fea1a0c758c in mailbox_save_finish 
> (_ctx=_ctx@entry=0x7fff78dbb948) at mail-storage.c:2461
> _data_stack_cur_id = 4
> ctx = 0x56239be14ca0
> t = 0x56239be10ce0
> keywords = 0x0
> pvt_flags = 0
> copying_via_save = true
> ret = 
> #10 0x7fea1a0b9eb4 in mail_storage_copy (ctx=0x0, 
> ctx@entry=0x56239be14ca0, mail=mail@entry=0x56239bdfdb28) at mail-copy.c:112
> __func__ = "mail_storage_copy"
> #11 0x7fea1a0e03f6 in mdbox_copy (_ctx=0x56239be14ca0, 
> mail=0x56239bdfdb28) at mdbox-save.c:461
> ctx = 0x56239be14ca0
> save_mail = 0x56239bdfdb28
> src_mbox = 
> rec = {
>   map_uid = 2615013952, 
>   save_date = 22051
> }
> guid_data = 0x7fff78dbb9b0
> wanted_guid = "@\362ݛ#V\000\000\240L\341\233#V\000"
> #12 0x7fea1a3cf999 in mail_deliver_copy (ctx=0x56239be14ca0, 
> mail=0x56239bdfdb28) at mail-deliver.c:547
> box = 
> mbox = 0x56239be0efc0
> muser = 0x56239bdcb7c0
> dt = 0x56239bddf1c0
> #13 0x7fea1a0c7956 in mailbox_copy_int (_ctx=_ctx@entry=0x7fff78dbba98, 
> mail=0x56239bdfdb28) at mail-storage.c:2532
> _data_stack_cur_id = 3
> ctx = 0x56239be14ca0
> t = 0x56239be10ce0
> keywords = 0x0
> pvt_flags = 0
> backend_mail = 0x56239bdfdb28
> ret = 
> __func__ = "mailbox_copy_int"
> #14 0x7fea1a0c7c38 in mailbox_save_using_mail 
> (_ctx=_ctx@entry=0x7fff78dbba98, mail=) at mail-storage.c:2584
> ctx = 
> __func__ = "mailbox_save_using_mail"
> #15 0x7fea1a3d02ac in mail_deliver_save (ctx=ctx@entry=0x7fff78dbbc60, 
> mailbox=, flags=flags@entry=0, keywords=keywords@entry=0x0, 
> 

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

2018-03-05 Thread John Fawcett
On 05/03/18 14:03, Ralf Hildebrandt wrote:
> * 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.
> It IS already disabled.
>
Ralph

if you compile and enable SMTPUTF8 in Postfix the mails should bounce
without getting to dovecot. That may or may not be what you want, but at
least they won't stick in the queue.

John



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

2018-03-05 Thread John Fawcett
extra_params = {
>   arr = {
> buffer = 0x0, 
> element_size = 0
>   }, 
>   v = 0x0, 
>   v_modifiable = 0x0
> }
>   }, 
>   rcpt_user = 0x56239bdcacb8, 
>   rcpt_default_mailbox = 0x56239a9d0a54 "INBOX", 
>   dest_mail = 0x0, 
>   cache = 0x0, 
>   tempfail_error = 0x0, 
>   tried_default_save = true, 
>   saved_mail = false, 
>   save_dest_mail = false, 
>   mailbox_full = false, 
>   dsn = false
> }
> input = 
> var_table = 
> error = 0x0
> #18 lmtp_local_deliver_to_rcpts (session=0x56239bddf1a8, 
> trans=0x56239bde0d68, cmd=0x56239bde1ea8, local=0x56239bde2020) at 
> lmtp-local.c:657
> rcpt = 0x56239bdd5c80
> first_uid = 4294967295
> src_mail = 0x56239bdfdb28
> count = 
> i = 0
> #19 lmtp_local_data (client=client@entry=0x56239bdbc338, 
> cmd=cmd@entry=0x56239bde1ea8, trans=trans@entry=0x56239bde0d68, 
> input=) at lmtp-local.c:734
> local = 0x56239bde2020
> session = 0x56239bddf1a8
> old_uid = 0
> #20 0x56239a9cdb53 in cmd_data_finish (trans=0x56239bde0d68, 
> cmd=0x56239bde1ea8, client=0x56239bdbc338) at commands.c:144
> state = 0x56239bdbc3c0
> input_proxy = 0x0
> input_msg = 0x0
> input_local = 0x56239bde26b8
> inputs = {0x0, 0x56239bde2238, 0x0}
> #21 cmd_data_continue (conn_ctx=0x56239bdbc338, cmd=0x56239bde1ea8, 
> trans=0x56239bde0d68) at commands.c:190
> client = 0x56239bdbc338
> state = 0x56239bdbc3c0
> data_input = 
> data = 
> size = 543
> ret = 
> __func__ = "cmd_data_continue"
> #22 0x7fea19d566e0 in cmd_data_handle_input (cmd=0x56239bde1ea8) at 
> smtp-server-cmd-data.c:199
> conn = 0x56239bde0930
> callbacks = 0x56239abd27a0 
> command = 0x56239bde1ea8
> data_cmd = 0x56239bde83e8
> ret = 
> __func__ = "cmd_data_handle_input"
> #23 0x7fea19dea649 in io_loop_call_io (io=0x56239bdba970) at ioloop.c:614
> ioloop = 0x56239bd82c70
> t_id = 2
> __func__ = "io_loop_call_io"
> #24 0x7fea19debf29 in io_loop_handler_run_internal 
> (ioloop=ioloop@entry=0x56239bd82c70) at ioloop-epoll.c:222
> ctx = 0x56239bd849f0
> ret = 
> __func__ = "cmd_data_handle_input"
> #23 0x7fea19dea649 in io_loop_call_io (io=0x56239bdba970) at ioloop.c:614
> ioloop = 0x56239bd82c70
> t_id = 2
> __func__ = "io_loop_call_io"
> #24 0x7fea19debf29 in io_loop_handler_run_internal 
> (ioloop=ioloop@entry=0x56239bd82c70) at ioloop-epoll.c:222
> ctx = 0x56239bd849f0
> ---Type  to continue, or q  to quit---
> io = 
> tv = {
>   tv_sec = 299, 
>   tv_usec = 999816
> }
> events_count = 
> msecs = 
> ret = 1
> i = 0
> j = 
> call = 
> __func__ = "io_loop_handler_run_internal"
> #25 0x7fea19dea752 in io_loop_handler_run (ioloop=) at 
> ioloop.c:666
> No locals.
> #26 0x7fea19dea968 in io_loop_run (ioloop=0x56239bd82c70) at ioloop.c:639
> __func__ = "io_loop_run"
> #27 0x7fea19d672a3 in master_service_run (service=0x56239bd82b00, 
> callback=) at master-service.c:767
> No locals.
> #28 0x56239a9ccc3d in main (argc=1, argv=0x56239bd82890) at main.c:159
> set_roots = {0x56239abd3280 , 
> 0x56239abd31e0 , 0x56239abd2600 
> , 0x0}
> service_flags = 
> storage_service_flags = (MAIL_STORAGE_SERVICE_FLAG_DISALLOW_ROOT | 
> MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP | 
> MAIL_STORAGE_SERVICE_FLAG_TEMP_PRIV_DROP | 
> MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT | 
> MAIL_STORAGE_SERVICE_FLAG_NO_IDLE_TIMEOUT)
> tmp_base_dir = 0x56239bd7a040 "tp data)"
> c = 
> error = 0x0
>
>
The assert and consequent core dump is happening when processing the u
umlaut character from the From header.

p = 0x56239bd7c11b "üller"


The problem is reproducible with a simple test case using a file
/tmp/test.txt that contains some 8 bit character like the u umlaut

From: a.mül...@example.com
To: whoe...@example.com
Date: 05 March 2018 21:00:00
Subject: test

test
EOF

Then it can be fed into posfix substituting youremailaddress@yourdomain
with a real account on the dovecot server.

cat /tmp/test.txt | sendmail -f some...@example.com
youremailaddress@yourdomain

In the maillog there is the following error message:
Mar  5 01:00:40 localhost dovecot:
lmtp(admin99)<22325>: Panic: file
smtp-address.c: line 530 (smtp_address_write): assertion failed:
(smtp_char_is_qpair(*p))


There are two ways to fix this: 1) let dovecot accept non ascii chars in
the local part as it did until 2.2 (see attached patch) or 2) instead of
the i_assert() call, log an error and reject the email. But this second
approach looks more complicated.

The patch just removes the i_assert() call. I tried that patch and it
seems ok. Before applying it, it is worthwhile if anyone can remember
what was the logic behind this i_assert() call in the first place (which
I fail to see), in case there is something that I am overlooking.

John

--- smtp-address.c.orig    2018-03-05 20:47:35.654257741 +0100
+++ smtp-address.c    2018-03-05 20:47:48.550311547 +0100
@@ -527,7 +527,6 @@
     if (!quoted) {
         str_append_c(out, '.');
     } else {
-            i_assert(smtp_char_is_qpair(*p));
         if (!smtp_char_is_qtext(*p))
             str_append_c(out, '\\');
         str_append_c(out, *p);



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

2018-03-05 Thread Ralf Hildebrandt
Got a coredump:

Mar  5 15:09:42 mail-cbf dovecot: 
lmtp(backup@backup.invalid)<15425><2B+kCaZPnVpBPAAAplP5LA>: Fatal: master: 
service(lmtp): child 15425 killed with signal 6 (core dumped)


#0  0x7fea19977428 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/unix/sysv/linux/raise.c:54
resultvar = 0
pid = 15425
selftid = 15425
#1  0x7fea1997902a in __GI_abort () at abort.c:89
save_stage = 2
act = {
  __sigaction_handler = {
sa_handler = 0x56239d9a3890, 
sa_sigaction = 0x56239d9a3890
  }, 
  sa_mask = {
__val = {1, 94710917811261, 140643428345904, 94710917811577, 0, 
140735221053024, 94710938452648, 513, 7700885895375379200, 0, 140643433202867, 
94710938452648, 
  140735221053120, 94710938452304, 140643433203225, 94710938452648}
  }, 
  sa_flags = 433895898, 
  sa_restorer = 0x5
}
sigs = {
  __val = {32, 0 }
}
#2  0x7fea19dd2aaf in default_fatal_finish (type=LOG_TYPE_PANIC, 
status=status@entry=0) at failures.c:228
backtrace = 0x56239bd7c2e0 "/usr/lib/dovecot/libdovecot.so.0(+0xc6aca) 
[0x7fea19dd2aca] -> /usr/lib/dovecot/libdovecot.so.0(+0xc6bad) [0x7fea19dd2bad] 
-> /usr/lib/dovecot/libdovecot.so.0(i_fatal+0) [0x7fea19d44721] -> 
/usr/lib/d"...
recursed = 0
#3  0x7fea19dd2bad in i_internal_fatal_handler (ctx=0x7fff78dbb710, 
format=, args=) at failures.c:718
status = 0
#4  0x7fea19d44721 in i_panic (format=format@entry=0x7fea19e0ec98 "file %s: 
line %d (%s): assertion failed: (%s)") at failures.c:306
ctx = {
  type = LOG_TYPE_PANIC, 
  exit_status = 0, 
  timestamp = 0x0, 
  timestamp_usecs = 0, 
  log_prefix = 0x0
}
args = 
#5  0x7fea19d4831d in smtp_address_write (out=0x56239bd7c150, 
address=0x56239bd7c108) at smtp-address.c:530
quoted = 
p = 0x56239bd7c11b "üller"
pend = 0x56239bd7c121 ""
pblock = 0x56239bd7c11a "müller"
__func__ = "smtp_address_write"
#6  0x7fea19d48411 in smtp_address_encode (address=0x56239bd7c108) at 
smtp-address.c:567
str = 0x56239bd7c150
#7  0x7fea1a3cf774 in mail_deliver_log_update_cache 
(cache=cache@entry=0x56239bddf1c8, pool=0x56239bddf180, mail=0x56239be185c8) at 
mail-deliver.c:111
message_id = 0x56239d943a4c 
""
subject = 0x56239d943b69 "JOMEC Seminar | Von Kennzahlencockpits und 
Lean Hospital Strategien"
from_envelope = 0x0
from = 
#8  0x7fea1a3cfabf in mail_deliver_save_finish (ctx=0x56239be14ca0) at 
mail-deliver.c:533
box = 
mbox = 0x56239be0efc0
muser = 0x56239bdcb7c0
dt = 0x56239bddf1c0
#9  0x7fea1a0c758c in mailbox_save_finish (_ctx=_ctx@entry=0x7fff78dbb948) 
at mail-storage.c:2461
_data_stack_cur_id = 4
ctx = 0x56239be14ca0
t = 0x56239be10ce0
keywords = 0x0
pvt_flags = 0
copying_via_save = true
ret = 
#10 0x7fea1a0b9eb4 in mail_storage_copy (ctx=0x0, ctx@entry=0x56239be14ca0, 
mail=mail@entry=0x56239bdfdb28) at mail-copy.c:112
__func__ = "mail_storage_copy"
#11 0x7fea1a0e03f6 in mdbox_copy (_ctx=0x56239be14ca0, mail=0x56239bdfdb28) 
at mdbox-save.c:461
ctx = 0x56239be14ca0
save_mail = 0x56239bdfdb28
src_mbox = 
rec = {
  map_uid = 2615013952, 
  save_date = 22051
}
guid_data = 0x7fff78dbb9b0
wanted_guid = "@\362ݛ#V\000\000\240L\341\233#V\000"
#12 0x7fea1a3cf999 in mail_deliver_copy (ctx=0x56239be14ca0, 
mail=0x56239bdfdb28) at mail-deliver.c:547
box = 
mbox = 0x56239be0efc0
muser = 0x56239bdcb7c0
dt = 0x56239bddf1c0
#13 0x7fea1a0c7956 in mailbox_copy_int (_ctx=_ctx@entry=0x7fff78dbba98, 
mail=0x56239bdfdb28) at mail-storage.c:2532
_data_stack_cur_id = 3
ctx = 0x56239be14ca0
t = 0x56239be10ce0
keywords = 0x0
pvt_flags = 0
backend_mail = 0x56239bdfdb28
ret = 
__func__ = "mailbox_copy_int"
#14 0x7fea1a0c7c38 in mailbox_save_using_mail 
(_ctx=_ctx@entry=0x7fff78dbba98, mail=) at mail-storage.c:2584
ctx = 
__func__ = "mailbox_save_using_mail"
#15 0x7fea1a3d02ac in mail_deliver_save (ctx=ctx@entry=0x7fff78dbbc60, 
mailbox=, flags=flags@entry=0, keywords=keywords@entry=0x0, 
storage_r=storage_r@entry=0x7fff78dbbc50) at mail-deliver.c:363
open_ctx = {
  user = 0x56239bdcacb8, 
  lda_mailbox_autocreate = false, 
  lda_mailbox_autosubscribe = false
}
box = 0x56239be0e6b8
trans_flags = 
t = 0x56239be10ce0
save_ctx = 0x0
headers_ctx = 0x0
kw = 0x0
dest_mail = 
error = MAIL_ERROR_NONE
mailbox_name = 0x56239a9d0a54 "INBOX"
errstr = 0x0

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

2018-03-05 Thread Reio Remma

Mine ended up in /tmp on CentOS 7.

Good luck!
Reio


On 05.03.18 16:02, Ralf Hildebrandt wrote:

* Ralf Hildebrandt :

 From the code in lib-smtp/smtp-address.c function smtp_address_write, it
looks as though the assertion will happen whenever there is a non ascii
char that is also non qpair in the local part, ie
!smtp_char_is_atext(*p) and !smtp_char_is_qpair(*p).

Could somebody please point me in the direction how to obtain a
coredump here?

I found
sysctl -w fs.suid_dumpable=2
but where will coredumps be written?





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

2018-03-05 Thread Ralf Hildebrandt
* Ralf Hildebrandt :
> > From the code in lib-smtp/smtp-address.c function smtp_address_write, it
> > looks as though the assertion will happen whenever there is a non ascii
> > char that is also non qpair in the local part, ie
> > !smtp_char_is_atext(*p) and !smtp_char_is_qpair(*p).
> 
> Could somebody please point me in the direction how to obtain a
> coredump here?

I found
sysctl -w fs.suid_dumpable=2
but where will coredumps be written?

-- 
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


signature.asc
Description: PGP signature


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

2018-03-05 Thread Ralf Hildebrandt
> From the code in lib-smtp/smtp-address.c function smtp_address_write, it
> looks as though the assertion will happen whenever there is a non ascii
> char that is also non qpair in the local part, ie
> !smtp_char_is_atext(*p) and !smtp_char_is_qpair(*p).

Could somebody please point me in the direction how to obtain a
coredump here?

-- 
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


signature.asc
Description: PGP signature


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

2018-03-05 Thread Ralf Hildebrandt
* John Fawcett :

> 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.

I agree.

-- 
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


signature.asc
Description: PGP signature


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

2018-03-05 Thread Ralf Hildebrandt
* 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.

It IS already disabled.

-- 
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


signature.asc
Description: PGP signature


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

2018-03-05 Thread Ralf Hildebrandt
> I wasn't able to confirm it since I've not moved to 2.3 yet and the 2.2
> code is different, but this should happen if there are characters from
> 0x01 to 0x1f or from 0x7f to 0xff in the local part.

Yeah, I was running 2.2.x prior to my upgrade and never encountered
this.

> By the way I noticed that if Postfix has SMTPUTF8 enabled, then it won't
> hand off messages with this content to Dovecot since Dovecot does not
> advertise support for SMTPUTF8. If SMTPUTF8 is unavailable or disabled
> then Postfix passes on those characters. I suspect that Ralph has
> SMTPUTF8 turned off.

Ah I see:

When a message is received with the SMTPUTF8 request, Postfix will
deliver the message to a non-SMTPUTF8 SMTP or LMTP server ONLY if:

* No message header value contains UTF-8.
* The envelope sender address contains no UTF-8,
* No envelope recipient address for that specific SMTP/LMTP delivery 
transaction contains UTF-8.

I wonder if this will break a lot.



-- 
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: Panic: file smtp-address.c: line 530 (smtp_address_write): assertion failed: (smtp_char_is_qpair(*p))

2018-03-04 Thread John Fawcett
On 04/03/18 09:55, Stephan Bosch wrote:
> Op 3/4/2018 om 9:07 AM schreef John Fawcett:
>> On 03/03/18 22:10, Stephan Bosch wrote:
>>> 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.
>>>
>> Would accepting UTF8 local part in the From header have any negative
>> consequences for Dovecot? If it does not I would accept it, based on the
>> fact that it maintains greater interoperability with other systems.
>> John
>>
> Depends on what causes the panic. I don't know that yet.
>
> Regards,
>
> Stephan.

>From the code in lib-smtp/smtp-address.c function smtp_address_write, it
looks as though the assertion will happen whenever there is a non ascii
char that is also non qpair in the local part, ie
!smtp_char_is_atext(*p) and !smtp_char_is_qpair(*p).

I wasn't able to confirm it since I've not moved to 2.3 yet and the 2.2
code is different, but this should happen if there are characters from
0x01 to 0x1f or from 0x7f to 0xff in the local part.

By the way I noticed that if Postfix has SMTPUTF8 enabled, then it won't
hand off messages with this content to Dovecot since Dovecot does not
advertise support for SMTPUTF8. If SMTPUTF8 is unavailable or disabled
then Postfix passes on those characters. I suspect that Ralph has
SMTPUTF8 turned off.

John



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

2018-03-04 Thread Stephan Bosch
Op 3/4/2018 om 9:07 AM schreef John Fawcett:
> On 03/03/18 22:10, Stephan Bosch wrote:
>> 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.
>>
> Would accepting UTF8 local part in the From header have any negative
> consequences for Dovecot? If it does not I would accept it, based on the
> fact that it maintains greater interoperability with other systems.
> John
>
Depends on what causes the panic. I don't know that yet.

Regards,

Stephan.


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

2018-03-04 Thread John Fawcett
On 03/03/18 22:10, Stephan Bosch wrote:
>
> 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.
>
Would accepting UTF8 local part in the From header have any negative
consequences for Dovecot? If it does not I would accept it, based on the
fact that it maintains greater interoperability with other systems.
John



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


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: 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?= <d.mül...@jomec.de>
>
> 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.



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

2018-03-02 Thread 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) [0x7f7fb50d3bad] ->
/usr/lib/dovecot/libdovecot.so.0(i_fatal+0) [0x7f7fb5045721] -> 
/usr/lib/dovecot/libdovecot.so.0(smtp_address_write+0x21d)
[0x7f7fb504931d] -> /usr/lib/dovecot/libdovecot.so.0(smtp_address_encode+0x21)
[0x7f7fb5049411] -> /usr/lib/dovecot/libdovecot-lda.so.0(+0x3774)
[0x7f7fb56d0774] -> /usr/lib/dovecot/libdovecot-lda.so.0(+0x3abf)
[0x7f7fb56d0abf] -> 
/usr/lib/dovecot/libdovecot-storage.so.0(mailbox_save_finish+0x7c)
[0x7f7fb53c858c] -> 
/usr/lib/dovecot/libdovecot-storage.so.0(mail_storage_copy+0x104)
[0x7f7fb53baeb4] -> /usr/lib/dovecot/libdovecot-storage.so.0(mdbox_copy+0x46)
[0x7f7fb53e13f6] -> /usr/lib/dovecot/libdovecot-lda.so.0(+0x3999)
[0x7f7fb56d0999] -> /usr/lib/dovecot/libdovecot-storage.so.0(+0x48956)
[0x7f7fb53c8956] -> 
/usr/lib/dovecot/libdovecot-lda.so.0(mail_deliver_save+0x1ac)
[0x7f7fb56d12ac] -> /usr/lib/dovecot/libdovecot-lda.so.0(mail_deliver+0x1f6)
[0x7f7fb56d1916] -> dovecot/lmtp(lmtp_local_data+0x610)
[0x560dfd665dc0] -> dovecot/lmtp(cmd_data_continue+0x233)
[0x560dfd664b53] -> /usr/lib/dovecot/libdovecot.so.0(+0x4a6e0)
[0x7f7fb50576e0] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x69)
[0x7f7fb50eb649] -> 
/usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0x109)
[0x7f7fb50ecf29] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x52)
[0x7f7fb50eb752] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_run+0x38)
[0x7f7fb50eb968] -> /usr/lib/dovecot/libdovecot.so.0(master_service_run+0x13)
[0x7f7fb50682a3] -> dovecot/lmtp(main+0x23d) [0x560dfd663c3d] -> 
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)
[0x7f7fb4c63830] -> dovecot/lmtp(_start+0x29) [0x560dfd663d79]
Mar  2 15:26:55 mail-cbf dovecot: 
lmtp(backup@backup.invalid)<29736>: Fatal: master: 
service(lmtp): child 29736 killed with signal 6 (core dumped)

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?= <d.mül...@jomec.de>

Note the "umlaut" in the email address... :)
-- 
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