Subject: Re: mini_sendmail doesn't parse recipient corectly
To: =?ISO-8859-2?Q?Ond=F8ej_T=F9ma?= <>
From: Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen <>
List: pkgsrc-users
Date: 12/01/2006 11:21:47

Your mail got me curious about what mini_sendmail was, and I took a look at
it. Jef Poskanzner usually writes great stuff, so I was surprised to see a
bug. Especially what looks like an "off-by-one" error.

It seems the error is not in the original code, but in patch-aa. I CC this to
pkgsrc-users, but you should probably file a PR with send-pr.

>Hi, i found error in mini_sendmail from pkgsrc, i didn't test on original d=
>istribution, only with pkgsrc patches.

>Error is in RCPT TO: command, it shorts recipient email address. It's only =
>doing, when recipient is write like this key: "Some Name <>=
>". If I write only email address: "" it works fine.

The bug is in mini_sendmail.c, remove or comment out line 600-601:

dog:../mini_sendmail-1.3.6 $ diff mini_sendmail.cBAK mini_sendmail.c    
<       if (recipient[len] == '>')
<           --len;
> /* THIS IS WRONG      if (recipient[len] == '>')
>           --len; END THIS IS WRONG */

Apparantly, someone must have gotten confused while fixing this code.