Can't get out of loop in sendmail

Denys Vlasenko vda.linux at googlemail.com
Tue Mar 10 14:56:39 UTC 2009


On Tuesday 10 March 2009 01:04:44 pm Lars Lockenvitz wrote:
> Hi,
> 
> I tried to subscribe, but get never any mail!
> So I thought, I try it!
> 
> Is there any problem from my side, that I can't subscribe?

Start by describing what you did in order to subscribe.


> > Betreff:
> > Can't get out of loop in sendmail
> > Von:
> > Lars Lockenvitz <l.locke at web.de>
> > Datum:
> > Tue, 10 Mar 2009 12:44:03 +0100
> > An:
> > busybox at busybox.net
> >
> > An:
> > busybox at busybox.net
> >
> >
> > Hi all,
> >
> > I have a problem with busybox sendmail and I use busybox with buildroot.
> >
> > My problem is that don't know how to go out of there "while ((s = 
> > xmalloc_fgetline(G.fp0)) != NULL)" statement.
> > He leave the loop if xmalloc_fgetline returns NULL but it doesn't!!!

It does leave the loop on NULL or it never gets NULL?

> > It is possible that I have to change the configuration for buildroot?
> >
> > Here are the last lines from sendmail.c:
> >
> >         char *s;
> >         // terminate headers
> >         printf("\r\n");
> >         // put plain text respecting leading dots
> >         while ((s = xmalloc_fgetline(G.fp0)) != NULL) {
> >             // escape leading dots
> >             // N.B. this feature is implied even if no -i (-oi) switch 
> > given
> >             // N.B. we need to escape the leading dot regardless of
> >             // whether it is single or not character on the line
> >             if ('.' == s[0] /*&& '\0' == s[1] */)
> >                 printf(".");
> >             // dump read line
> >             printf("%s\r\n", s);
> >         }
> >     }

considering that G.fp0 is a stdin:

        xdup2(STDIN_FILENO, 3);
        G.fp0 = fdopen(3, "r");

the way to get stdin to dry out is to redirect it from a file

sendmail ... <email.txt

If you insist on typing your mail in from keyboard, perhaps try
<enter>Ctrl-D<enter> to send EOF.

--
vda


More information about the busybox mailing list