On Tue, Mar 23, 1999 at 02:22:46AM -0000, Russell Nelson wrote:
> Giles Lean writes:
>  > 
>  > Specifying an empty envelope sender is different:
>  > 
>  > sendmail-8.8.x:    sendmail -f '<>' ...
>  > qmail's clone:  sendmail -f '' ...
> 
> Anybody have anything to add to this list before I put it up on
> www.qmail.org?

If addresses given on the command line contain something funny, sendmail
expects them quoted and qmail not. See djb's message in qmail list
with Message-ID: <[EMAIL PROTECTED]> and
Date: 22 Aug 1998 21:48:27 -0000.

That's why I use the attached wrapper between Mutt and qmail. In Mutt set
sendmail='/some/path/muttqmail'.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

void nomem()
{
   printf("muttqmail: out of memory\n");
   exit(111);
}

void removequote (char *d, char *s)
{
   char c;
   do
     {
        c = *s++;
        if (c != '\"')
          {
             if (c == '\\')
               c = *s++;
             *d++ = c;
          }
     }
   while (c != '\0');
}

void main(int argc,char **argv)
{
   char **newargv;
   char **arg;
   int i;
   
   newargv = (char **) malloc((argc + 1) * sizeof(char *));
   if (!newargv) nomem();
   arg = newargv;
   *arg++ = "/var/qmail/bin/qmail-inject";
   for (i = 1;i < argc;++i)
     {
        *arg=malloc((strlen(argv[i])+1)*sizeof(char));
        if (!*arg) nomem();
        removequote(*arg,argv[i]);
        arg++;
     }
   *arg = NULL;
   execv(*newargv,newargv);
   printf("muttqmail: unable to run qmail-inject\n");
   exit(111);
}

Reply via email to