Eray Aslan | 14 Aug 09:53 2011
Picon

segfault in make check?

I have a user who gets a segfault during make check on arm and ia64
for maildrop 2.5.4.  I cannot reproduce it in amd64 and x86.

Some relevant info and backtrace is below.  Any ideas?  Thanks.

[...]
make[2]: Entering directory
`/var/tmp/portage/mail-filter/maildrop-2.5.4/work/maildrop-2.5.4/rfc2045'
/bin/sh ./testsuite | cmp -s - ./testsuite.txt.idn
./testsuite: line 142: 24116 Segmentation fault      LANG=en_US.utf-8
./reformime -i < ./testsuite.dat
make[2]: *** [check-am] Error 1
[...]

# LANG=en_US.utf-8 gdb ./reformime
GNU gdb (Gentoo 7.2 p1) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"
and "show warranty" for details.
This GDB was configured as "armv5tel-softfloat-linux-gnueabi".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from
/var/tmp/portage/mail-filter/maildrop-2.5.4/work/maildrop-2.5.4/rfc2045/reformime...done.
(gdb) set args -i < ./testsuite.dat
(gdb) run
(Continue reading)

Sam Varshavchik | 14 Aug 14:08 2011

Re: segfault in make check?

Eray Aslan writes:

> I have a user who gets a segfault during make check on arm and ia64
> for maildrop 2.5.4.  I cannot reproduce it in amd64 and x86.
>
> Some relevant info and backtrace is below.  Any ideas?  Thanks.

Thanks -- this is indeed arch-specific -- looks like arm and ia64 put argv  
into readonly memory. This patch will fix this.

Index: rfc2045/reformime.c
===================================================================
--- rfc2045/reformime.c	(revision 102)
+++ rfc2045/reformime.c	(working copy)
 <at>  <at>  -996,7 +996,7  <at>  <at> 
 		case 's':
 			if (!optarg && argn < argc)
 				optarg=argv[argn++];
-			if (optarg && *optarg)	section=optarg;
+			if (optarg && *optarg)	section=strdup(optarg);
 			break;
 		case 'i':
 			doinfo=1;
------------------------------------------------------------------------------
FREE DOWNLOAD - uberSVN with Social Coding for Subversion.
Subversion made easy with a complete admin console. Easy 
(Continue reading)

Micah Anderson | 30 Aug 23:20 2011
Picon

request: maildrop and dovecot integration


Back in 2009, Max posted to this list a patch to maildrop that would
provide dovecot integration to maildrop[0]. Since that time, he has
continued to maintain that patch for new versions of maildrop, as they
are released[1].

I would like to request that the maildrop developers consider accepting
this patch, if it is suitable code. It provides very useful
functionality and works great.

Thank you for your consideration in this matter,
Micah

0. http://permalink.gmane.org/gmane.mail.maildrop/4771
1. http://wiki.dovecot.org/maildrop
--

-- 

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Courier-maildrop mailing list
Courier-maildrop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
(Continue reading)

Sam Varshavchik | 31 Aug 04:50 2011

Re: request: maildrop and dovecot integration

Micah Anderson writes:

>
> Back in 2009, Max posted to this list a patch to maildrop that would
> provide dovecot integration to maildrop[0]. Since that time, he has
> continued to maintain that patch for new versions of maildrop, as they
> are released[1].
>
> I would like to request that the maildrop developers consider accepting
> this patch, if it is suitable code. It provides very useful
> functionality and works great.
>
> Thank you for your consideration in this matter,
> Micah
>
>
> 0. http://permalink.gmane.org/gmane.mail.maildrop/4771
> 1. http://wiki.dovecot.org/maildrop

What this patch does is take a large chunk of code out of courier-authlib,  
add a small amount of dovecot-specific logic, and include it into maildrop's  
source.

A very large portion of code ends up being duplicated here. This is not a  
good way to do thing, from a long-term maintenance perspective.

Maildrop already has an authentication plugin – the courier-authlib hook.  
The right way to implement this functionality would be to add a Dovecot  
module to courier-authlib. I would be generally agreeable to this approach.  
In addition to mailrop, this would also allow sqwebmail to leverage this  
(Continue reading)

Eray Aslan | 31 Aug 08:42 2011
Picon

Re: segfault in make check?

On Sun, Aug 14, 2011 at 08:08:21AM -0400, Sam Varshavchik wrote:
> Thanks -- this is indeed arch-specific -- looks like arm and ia64 put argv  
> into readonly memory. This patch will fix this.

Sorry for the late reply.

Unfortunately, the patch did not fix the problem.  I am told that with
the patch, there is still a segfault on alpha/arm/ia64/s390/sparc
architectures.

# LANG=en_US.utf-8 gdb ./reformime
GNU gdb (Gentoo 7.2 p1) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "armv5tel-softfloat-linux-gnueabi".
For bug reporting instructions, please see:
<http://bugs.gentoo.org>...
Reading symbols from
/var/tmp/portage/mail-filter/maildrop-2.5.4/work/maildrop-2.5.4/rfc2045/reformime...done.
(gdb) set args -i <./testsuite.dat
(gdb) run
Starting program:
/var/tmp/portage/mail-filter/maildrop-2.5.4/work/maildrop-2.5.4/rfc2045/reformime
-i <./testsuite.dat

Program received signal SIGSEGV, Segmentation fault.
0x4010f988 in strspn () from /lib/libc.so.6
(Continue reading)

Sam Varshavchik | 31 Aug 15:22 2011

Courier 20110831 build

Download: http://www.courier-mta.org/download.php

Pushed builds of courier and maildrop packages, dated 20110831.

Changes

  • Added "feedback" and "replyfeedback" formats to mailbot, that generate Email Feed Reports, per RFC 5965.

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Courier-maildrop mailing list
Courier-maildrop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
Sam Varshavchik | 31 Aug 15:26 2011

Re: segfault in make check?

Eray Aslan writes:

> On Sun, Aug 14, 2011 at 08:08:21AM -0400, Sam Varshavchik wrote:
> > Thanks -- this is indeed arch-specific -- looks like arm and ia64 put argv
> > into readonly memory. This patch will fix this.
>
> Sorry for the late reply.
>
> Unfortunately, the patch did not fix the problem.  I am told that with
> the patch, there is still a segfault on alpha/arm/ia64/s390/sparc
> architectures.

Can you try this patch on top of the first one. You can take the 20110831  
build, which includes the first patch, and just apply this one.

If you still have a problem, it's more helpful to have a traceback with a  
build that disables compiler optimizations – pass CFLAGS=-g and CXXFLAGS=-g  
options to the configure script, to build without optimizations.

Index: rfc2045/reformime.c
===================================================================
--- rfc2045/reformime.c	(revision 137)
+++ rfc2045/reformime.c	(working copy)
 <at>  <at>  -1150,7 +1150,7  <at>  <at> 

 	if (doinfo)
 	{
-		mimesection = strtok(section,",");
+		mimesection = section ? strtok(section, ","):NULL;
 		do {
 			print_info(p, mimesection);
 			if (do_extract)
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Courier-maildrop mailing list
Courier-maildrop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
mr.maX | 31 Aug 16:21 2011

Re: request: maildrop and dovecot integration

Hi everybody,

as author of mentioned patch, I'm replying here just to clarify some things.

> What this patch does is take a large chunk of code out of courier-authlib,  
> add a small amount of dovecot-specific logic, and include it into maildrop's  
> source.
> 
> A very large portion of code ends up being duplicated here. This is not a  
> good way to do thing, from a long-term maintenance perspective.

Although as a software developer I'm also strongly against unnecessary 
duplicated code, you're exaggerating here a little bit. Only code that was 
copied (with some minor changes) from authlib is related to socket communication 
as I did not want to reinvent the wheel (and is properly documented). If you 
take a brief look at dovecotauth.c where most of the code is you'll see that the 
ratio between authlib code and dovecot communication code is along the lines of 
50:50. Also, the overall file size is just 10k, so saying that a "large" portion 
of code is duplicated in general is overstating. Not to mention that there is 
also a lot of duplicated code in authlib itself (one example from top of my head 
is read_env() function that's re-implemented in several auth modules).

With that being said, I would like to elaborate why I wrote the patch in this 
way. The main reason is that I did not want or need to use authlib at all. There 
simply is no need for having one more daemon running just for doing user info 
lookups. Not using authlib simplifies things greatly as there is no additional 
maintenance needed (or code compilation for that matter). The idea was to make 
maildrop be able to use different authentication libraries (dovecot, authlib, 
etc.) and allow users to choose which one to use. The second reason is that I 
only wanted to implement user info lookups ("PRE" auth in authlib terminology or 
"MASTER" lookups in dovecot terminology), which are only thing needed by 
maildrop. Implementing full username / password login capability ("CLIENT" 
lookups in dovecot terminology) is beyond the scope of my needs and having an 
authentication backend in authlib that just implements user info lookups will be 
very limited in its use. Not to mention that trying to implement full login 
capability will result in a lot of duplicated functionality as dovecot 
authentication protocol for example is able to process challenge-response 
authentication mechanisms on its own.

> Maildrop already has an authentication plugin – the courier-authlib hook.  
> The right way to implement this functionality would be to add a Dovecot  
> module to courier-authlib. I would be generally agreeable to this approach.  
> In addition to mailrop, this would also allow sqwebmail to leverage this  
> functionality too.

As my patch only implements user info lookups, I doubt that it would work with 
sqwebmail, since it would also require login capability. Anyway, I wrote above 
the reasons why I did not implement this in authlib and now that I don't even 
use maildrop anymore, I personally won't be spending any of my time on improving 
the patch. However, if there is someone interested in pursuing this further 
current code can probably be integrated with authlib, main part of code is 
located in dovecotauth.c in two functions: _dovecotauth_getuserinfo(), 
parse_userinfo(). But, as this only implements user info lookups, use of such 
authentication backed would be very limited.

Oh, I would like to thank Sam for making maildrop, which is a great piece of 
software (especially its xfilter command) that I have been using in the past 
(and Courier-IMAP, which I also used for quite some time).

--

-- 
Regards,
Marko Njezic - mr.maX  <at>  MAX Interactive corp.
Personal: http://www.markonjezic.com/
MAX's Empire: http://www.maxempire.com/
MAX's HTML Beauty++ 2004: http://www.htmlbeauty.com/

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Courier-maildrop mailing list
Courier-maildrop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
Sam Varshavchik | 31 Aug 18:15 2011

Re: request: maildrop and dovecot integration

mr.maX writes:

> Oh, I would like to thank Sam for making maildrop, which is a great piece of
> software (especially its xfilter command) that I have been using in the past
> (and Courier-IMAP, which I also used for quite some time).

Thanks.

It's just been my experience that it's better to avoid duplicating more than  
just something that's trivial.

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Courier-maildrop mailing list
Courier-maildrop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
Matthias Andree | 31 Aug 19:20 2011
Picon
Picon

.procmailrc converter anyone?

Greetings,

is anyone aware of a tool that can convert a .procmailrc script to
.mailfilter (or at least those parts that have equivalents)?

Thanks.

Matthias

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev

Gmane