help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Cfengine] cfengine "MAIL FROM" bug?


From: Adam M. Dunn
Subject: Re: [Cfengine] cfengine "MAIL FROM" bug?
Date: Fri, 20 Aug 2004 09:25:46 -0500 (CDT)

On Fri, 20 Aug 2004, Bas van der Vlies wrote:

> Adam M. Dunn wrote:
> 
> > I'm having a problem with mail in the stock cfengine 2.1.9.  I recently
> > installed it and am just trying to learn it, and ran into trouble getting
> > it to send out email.  After a long time of investication I resorted to
> > editing the C code in cfexecd.c to make it work!  Could this be a bug?
> > 
> > Here is what my mail configuration in cfagent.conf looks like (names have 
> > been changed to protect the innocent!):
> > 
> >    site       = ( mysite )
> >    domain     = ( mysite.domain.edu )
> >    inform     = ( on )
> >    sysadm     = ( myname@domain.edu )
> >    smtpserver = ( mail.mysite.domain.edu )
> >    EmailMaxLines = ( 100 )
> > 
> > 
> > My SMTP server is running sendmail, and if I run in debug mode:
> > cfexecd -F --verbose --debug
> > 
> > I get mail failure output like this:
> > 
> > ------------------------------------------------------------------
> > Connecting...
> > Nothing to send .. waiting for opening
> > 220 mailhost.mysite.domain.edu ESMTP Sendmail 8.12.9/8.12.9; Thu, 19 Aug
> > 2004
> > 13:27:42 -0500 (CDT)
> > HELO client.mysite.domain.edu
> > SENT(30)->HELO client.mysite.domain.edu
> > 250 client.mysite.domain.edu Hello client.mysite.domain.edu
> > [128.249.154.195], pleased to meet you
> > MAIL FROM: <cfengine@myname@domain.edu>
> > SENT(41)->MAIL FROM: <cfengine@myname@domain.edu>
> > 553 5.1.3 <cfengine@myname@domain.edu>... Invalid route address
> > cfexecd: Cannot mail to myname@domain.edu.
> > ------------------------------------------------------------------
> > 
> > Why is the MAIL FROM trying to set to <cfengine@myname@domain.edu>!?!
> > 
> > 
> > I ended up temporarily making the following change in the cfexecd.c file, 
> > and it works for me now:
> > 
> > ------------------------------------------------------------------
> > 935,936c935
> > <    /*sprintf(VBUFF,"MAIL FROM: <cfengine@%s>\r\n",domain);*/
> > <    sprintf(VBUFF,"MAIL FROM: <cfengine@%s>\r\n",VFQNAME);
> > ---
> > 
> >>   sprintf(VBUFF,"MAIL FROM: <cfengine@%s>\r\n",domain);
> > 
> > ------------------------------------------------------------------
> > 
> > 
> > Anyone know why this is happening?  Mark, is this a bug??
> > 
> > 
> 
> The bug must be in this statement:
>     sscanf(to,"%s@%.64s",domain);
> 
> Can you print the value of domain?
> 
> 
> Currently i am rewriting cfexecd.c so we can set from which address we 
> send (smtpfrom variable).  I have written an patch with Andrew 
> Stribblehill (who is the debian maintainer for cfengine2) We are 
> currently testing the patch. It implements a query mode for variables:
> 
>   # cfagent -Q sysadm,smtpfrom,SV_OVERLAY_DIR
>   sysadm=32:cfengine@spiegel.rainbow.sara.nl
>   smtpfrom=8:cfengine
>   SV_OVERLAY_DIR=40:/data/cfengine/test_cluster/data/overlay
> 


I didn't test that or really persue it further, because upgrading to the
newest 2.1.10 version fixed my problem.  Apparently it was just a bug in
the short lived release of 2.1.9.

Anyway, that would be a good feature though.  I'm surprised it's not
already incorporated.


~adam






reply via email to

[Prev in Thread] Current Thread [Next in Thread]