Re: opensmtpd 6.6.4p1 crashes on netbsd 9.0

2020-03-09 Thread Andi Vajda


On Mon, 9 Mar 2020, Martijn van Duren wrote:


On 3/9/20 8:15 AM, Andi Vajda wrote:



On Mar 8, 2020, at 23:58, Martijn van Duren  
wrote:

I guess not a lot of opensmtpd developers have a NetBSD machine at hand
(I certainly don't). Could you supply us with a backtrace, which most
likely will be needed from the pony process.


Rebuilding with libressl 3.0.2 (instead of openssl 1.1.1d) worked around the 
problem.


So it's safe for me to assume you're fine with applying the workaround
for every release and letting other people do the same?


Speaking for myself, I am fine with building with libressl instead of 
openssl, yes.


Here is a stacktrace of the crash in the pony process, without debugging 
symbols:

(what extra flags do I need to pass to configure to get a build with debug
 symbols ? Adding --with-cflags=-g was not enough)

#0  0x7cb54f76c8cf in ?? ()
#1  0x00430aa7 in resolver_getaddrinfo (hostname=0x7cb5514b4000 "",
servname=0x8 ,
hints=0x7f7fff5009c0, cb=0x7cb550feac48, arg=0x9)
at ../../smtpd/resolver.c:91
#2  0x in ?? ()

Andi..

Re: filter question

2020-03-09 Thread Edgar Pettijohn

On Mar 9, 2020 1:34 AM, Martijn van Duren  wrote:
>
> On 3/6/20 5:00 PM, epektasis wrote:
> > Greetings.  I have my own blacklist file of email addresses
> > (some in the format microcen...@microcenter.com and some in 
> > the format *@squaredeals.com), one per line.  I would like to
> > filter each incoming email so that a mail-from address
> > that matches any line in the blacklist file will go to a
> > junk file.  In the smtpd.conf I have tried
> > 
> > table blksender file:/etc/blksender
> > filter mail-from  junk
> > match filter mail-from  junk
> > 
> > but get syntax errors on both of the last two lines when
> > checking the configuration.  There's something I'm not
> > understanding and am asking for advice.
> > epektasis
> > 
> Have another look at the manpage:
>  filter filter-name phase phase-name match conditions decision
>  Register a filter filter-name.  A decision about what to do
>  with the mail is taken at phase phase-name when matching
>  conditions.  Phases, matching conditions, and decisions are
>  described in MAIL FILTERING, below.
>
> So without testing (you should do that yourself anyway) I think what you
> want would be:
>
> table blksender file:/etc/blksender
> filter blksender phase mail-from match mail-from  junk
> listen on   filter blksender
>

Also look at table(5) '*' is only allowed on the domain side of the '@'.

Edgar

Re: opensmtpd 6.6.4p1 crashes on netbsd 9.0

2020-03-09 Thread Martijn van Duren
On 3/9/20 8:15 AM, Andi Vajda wrote:
> 
>> On Mar 8, 2020, at 23:58, Martijn van Duren  
>> wrote:
>>
>> I guess not a lot of opensmtpd developers have a NetBSD machine at hand
>> (I certainly don't). Could you supply us with a backtrace, which most
>> likely will be needed from the pony process.
> 
> Rebuilding with libressl 3.0.2 (instead of openssl 1.1.1d) worked around the 
> problem.

So it's safe for me to assume you're fine with applying the workaround
for every release and letting other people do the same?
> 
> Andi..
> 
>>
>> martijn@



Re: opensmtpd 6.6.4p1 crashes on netbsd 9.0

2020-03-09 Thread Andi Vajda


> On Mar 8, 2020, at 23:58, Martijn van Duren  
> wrote:
> 
> I guess not a lot of opensmtpd developers have a NetBSD machine at hand
> (I certainly don't). Could you supply us with a backtrace, which most
> likely will be needed from the pony process.

Rebuilding with libressl 3.0.2 (instead of openssl 1.1.1d) worked around the 
problem.

Andi..

> 
> martijn@
> 
>> On 3/7/20 1:38 AM, Andi Vajda wrote:
>> 
>>  Hi,
>> 
>> I've been running opensmtpd 6.6.4p1 on netbsd 7.2 just fine.
>> 
>> I'm now upgrading to netbsd 9.0 and I'm seeing that opensmtpd 6.6.4p1 crashes
>> when mail is submitted to it. The crash seems to happen right after 'message
>> begin':
>> 
>>   --- snip ---
>> smtp: 0x7ad646215000: fd 24 from queue
>> smtp: 0x7ad646215000: message fd 24
>> smtp: 0x7ad646215000: message begin
>> debug: parent -> pony: pipe closed
>> debug: control -> pony express: pipe closed
>> debug: control agent exiting
>> smtpd: process pony socket closed
>> debug: ca -> pony express: pipe closed
>>   --- snip ---
>> 
>> If I copy the smtpd binary built on netbsd 7.2 to netbsd 9.0 then smtpd works
>> fine again:
>>   --- snip ---
>> smtp: 0x76e3f19b8000: fd 24 from queue
>> smtp: 0x76e3f19b8000: message fd 24
>> smtp: 0x76e3f19b8000: message begin
>> debug: 0x76e3f19b8000: end of message, error=0
>> ad1ae4fedfe423f1 smtp message msgid=c931775c size=567 nrcpt=1 proto=ESMTP
>>   --- snip --- 
>> and mail is delivered as expected.
>> 
>> There is an ldd difference between the two binaries:
>> 
>> on netbsd 7.2:
>> -lz.1 => /usr/pkg/lib/libz.so.1
>> -lgcc_s.1 => /usr/lib/libgcc_s.so.1
>> -lc.12 => /usr/lib/libc.so.12
>> -lcrypto.1.1 => /usr/pkg/lib/libcrypto.so.1.1
>> -lpthread.1 => /usr/lib/libpthread.so.1
>> -lssl.1.1 => /usr/pkg/lib/libssl.so.1.1
>> -levent-2.1.7 => /usr/pkg/lib/libevent-2.1.so.7
>> -lasr.0 => /usr/pkg/lib/libasr.so.0
>> -lcrypt.1 => /usr/lib/libcrypt.so.1
>> 
>>  on netbsd 9.0:
>> -lz.1 => /usr/pkg/lib/libz.so.1
>> -lc.12 => /usr/lib/libc.so.12
>> -lcrypto.1.1 => /usr/pkg/lib/libcrypto.so.1.1
>> -lpthread.1 => /usr/lib/libpthread.so.1
>> -lssl.1.1 => /usr/pkg/lib/libssl.so.1.1
>> -levent-2.1.7 => /usr/pkg/lib/libevent-2.1.so.7
>> -lasr.0 => /usr/pkg/lib/libasr.so.0
>> -lcrypt.1 => /usr/lib/libcrypt.so.1
>> 
>> The -lgcc_s.1 entry is not present on 9.0.
>> 
>> The compiler used on netbsd 7.2: gcc (nb2 20150115) 4.8.5
>> The compiler used on netbsd 9.0: gcc (nb3 20190319) 7.4.0
>> 
>> I also tried building opensmtpd 6.6.2p1 on netbsd 9.0, with the same result.
>> 
>> Is there something about netbsd 9.0 (and its gcc 7.4.0 system compiler) that
>> is known to cause this ? Is there some configure setting I need to change ?
>> (on both OSs, I'm only changing paths, ie --prefix, --with-libssl, 
>> --with-libasr, --with-libevent as I'm using the pkgsrc installations (also 
>> built from sources) of these libraries).
>> 
>> I'm going to try building opensmtpd with llvm next...
>> Thank you for your insights !
>> 
>> Andi..
>> 
> 




Re: opensmtpd 6.6.4p1 crashes on netbsd 9.0

2020-03-09 Thread Martijn van Duren
I guess not a lot of opensmtpd developers have a NetBSD machine at hand
(I certainly don't). Could you supply us with a backtrace, which most
likely will be needed from the pony process.

martijn@

On 3/7/20 1:38 AM, Andi Vajda wrote:
> 
>   Hi,
> 
> I've been running opensmtpd 6.6.4p1 on netbsd 7.2 just fine.
> 
> I'm now upgrading to netbsd 9.0 and I'm seeing that opensmtpd 6.6.4p1 crashes
> when mail is submitted to it. The crash seems to happen right after 'message
> begin':
> 
>--- snip ---
> smtp: 0x7ad646215000: fd 24 from queue
> smtp: 0x7ad646215000: message fd 24
> smtp: 0x7ad646215000: message begin
> debug: parent -> pony: pipe closed
> debug: control -> pony express: pipe closed
> debug: control agent exiting
> smtpd: process pony socket closed
> debug: ca -> pony express: pipe closed
>--- snip ---
> 
> If I copy the smtpd binary built on netbsd 7.2 to netbsd 9.0 then smtpd works
> fine again:
>--- snip ---
> smtp: 0x76e3f19b8000: fd 24 from queue
> smtp: 0x76e3f19b8000: message fd 24
> smtp: 0x76e3f19b8000: message begin
> debug: 0x76e3f19b8000: end of message, error=0
> ad1ae4fedfe423f1 smtp message msgid=c931775c size=567 nrcpt=1 proto=ESMTP
>--- snip --- 
> and mail is delivered as expected.
> 
> There is an ldd difference between the two binaries:
> 
> on netbsd 7.2:
>  -lz.1 => /usr/pkg/lib/libz.so.1
>  -lgcc_s.1 => /usr/lib/libgcc_s.so.1
>  -lc.12 => /usr/lib/libc.so.12
>  -lcrypto.1.1 => /usr/pkg/lib/libcrypto.so.1.1
>  -lpthread.1 => /usr/lib/libpthread.so.1
>  -lssl.1.1 => /usr/pkg/lib/libssl.so.1.1
>  -levent-2.1.7 => /usr/pkg/lib/libevent-2.1.so.7
>  -lasr.0 => /usr/pkg/lib/libasr.so.0
>  -lcrypt.1 => /usr/lib/libcrypt.so.1
> 
>   on netbsd 9.0:
>  -lz.1 => /usr/pkg/lib/libz.so.1
>  -lc.12 => /usr/lib/libc.so.12
>  -lcrypto.1.1 => /usr/pkg/lib/libcrypto.so.1.1
>  -lpthread.1 => /usr/lib/libpthread.so.1
>  -lssl.1.1 => /usr/pkg/lib/libssl.so.1.1
>  -levent-2.1.7 => /usr/pkg/lib/libevent-2.1.so.7
>  -lasr.0 => /usr/pkg/lib/libasr.so.0
>  -lcrypt.1 => /usr/lib/libcrypt.so.1
> 
> The -lgcc_s.1 entry is not present on 9.0.
> 
> The compiler used on netbsd 7.2: gcc (nb2 20150115) 4.8.5
> The compiler used on netbsd 9.0: gcc (nb3 20190319) 7.4.0
> 
> I also tried building opensmtpd 6.6.2p1 on netbsd 9.0, with the same result.
> 
> Is there something about netbsd 9.0 (and its gcc 7.4.0 system compiler) that
> is known to cause this ? Is there some configure setting I need to change ?
> (on both OSs, I'm only changing paths, ie --prefix, --with-libssl, 
> --with-libasr, --with-libevent as I'm using the pkgsrc installations (also 
> built from sources) of these libraries).
> 
> I'm going to try building opensmtpd with llvm next...
> Thank you for your insights !
> 
> Andi..
> 



Re: filter question

2020-03-09 Thread Martijn van Duren
On 3/6/20 5:00 PM, epektasis wrote:
> Greetings.  I have my own blacklist file of email addresses
> (some in the format microcen...@microcenter.com and some in 
> the format *@squaredeals.com), one per line.  I would like to
> filter each incoming email so that a mail-from address
> that matches any line in the blacklist file will go to a
> junk file.  In the smtpd.conf I have tried
> 
> table blksender file:/etc/blksender
> filter mail-from  junk
> match filter mail-from  junk
> 
> but get syntax errors on both of the last two lines when
> checking the configuration.  There's something I'm not
> understanding and am asking for advice.
>   epektasis
> 
Have another look at the manpage:
 filter filter-name phase phase-name match conditions decision
 Register a filter filter-name.  A decision about what to do
 with the mail is taken at phase phase-name when matching
 conditions.  Phases, matching conditions, and decisions are
 described in MAIL FILTERING, below.

So without testing (you should do that yourself anyway) I think what you
want would be:

table blksender file:/etc/blksender
filter blksender phase mail-from match mail-from  junk
listen on   filter blksender