On Mon, Jul 10, 2000 at 03:37:11PM +0200, Magnus Bodin wrote:
>
>
> Look further down the thread. It is an error that may be qmail-inject
> specific with arguments on the command line.
And the solution seems to queue mail with a wrapper program.
Attached is muttqmail.c that fixes the thing.
set sendmail="/usr/local/sbin/muttqmail -f [EMAIL PROTECTED]"
works now like a charm.
Interopability issue.
/magnus
--
http://x42.com/
#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);
}