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??