views:

19

answers:

1

I have had a NAnt/NAntContrib build running for a while on one machine:
(MS Windows Server 2003 Standard 32-bit SP2)

And I now need to run the same build script on a newer machine:
(Windows Server Standard 2008)

I have gotten NAnt and NAnt.Config installed and working on the new machine.
I am using NAnt.Core.Maillogger on the original machine, configured as such:

<property name="MailLogger.mailhost"        value="mail.server.com" />
<property name="MailLogger.from"            value="[email protected]" />
<property name="MailLogger.failure.notify"  value="true" />
<property name="MailLogger.success.notify"  value="true" />
<property name="MailLogger.failure.to"      value="[email protected]" />
<property name="MailLogger.success.to"      value="[email protected]" />
<property name="MailLogger.failure.subject" value="AUTOBUILD: Failure on TEST" />
<property name="MailLogger.success.subject" value="AUTOBUILD: Success on TEST" />
<property name="MailLogger.failure.attachments" value="MailLogger.failure.files" />
<property name="MailLogger.success.attachments" value="MailLogger.success.files" />

<fileset id="MailLogger.failure.files"> 
    <include name="build.log" /> 
</fileset>
<fileset id="MailLogger.success.files"> 
    <include name="build.log" /> 
</fileset>

I run a very simple test .build file, to test mail functionality:

<target name="test_mail_pass">
    <echo message="Test Success:
run by ${environment::get-user-name()}"/>
</target>

<target name="test_mail_fail">
    <echo message="Test Fail:
run by ${environment::get-user-name()}"/>
    <fail message="Some Failure occurred." />
</target>

The above works on the original machine, and seems to work on the new machine, except for the fact that no mail is sent. There is no message in the console that indicates that anything went wrong (ignoring the obvious use of the <fail> task).

I don't even know where to begin figuring out what is wrong here, or how to troubleshoot this problem.

Any assistance would be greatly appreciated.

A: 

I have solved this problem with much Google-ing.
One of two things solved my problem, and I don't know which it was, but my problem is now solved.

  1. My batch file needed to have the following command-line option:

    -logger:NAnt.Core.MailLogger
    
  2. The file that was referred to in the:

    <fileset id="MailLogger.failure.files">
        <include name="build.log" /> 
    </fileset>
    <fileset id="MailLogger.success.files"> 
        <include name="build.log" /> 
    </fileset>
    

Need to actually exist.
One post I read (lost the link) told of a problem where if the files to attach do not exist, the Mail will just not get sent.

funkymushroom