ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Lévy-Lambert <anto...@antbuild.com>
Subject AW: MIME/connection errors with MailLogger and <mail>
Date Tue, 02 Dec 2003 22:39:01 GMT
Hi Whitney,

1) the message saying "Failed to initialise MIME email" actually means that
ant did not find mail.jar+activation.jar in its classpath
you may want to download these files from sun and install them under
$ANT_HOME/lib.
Otherwise, ant is able to send email with its own code (so called plain
mail)

2) is your mail server working under the default SMTP port ?
   did you enter its fully qualified name in the mailhost attribute ?
   maybe you have a problem of DNS resolution, you might want to try with
the IP address of your mailhost instead of its name
   if your SMTP server requires password authentification or SSL, then you
would need ant1.6

   you might want to do :
   telnet the_mail_server 25

if you get a prompt, then it should work for ant too.

it looks like that for me :

$ telnet mymailserver 25
Trying 40.39.38.37...
Connected to mymailserver. Escape character is '^]'.
220 mymailserver ESMTP SMTPSVC(1.0.0.1)
quit
221 Closing connection. Good bye.
Connection closed by foreign host.

(I have replaced the real name and IP address of my mail server)

Antoine

-----Ursprüngliche Nachricht-----
Von: Kew, Whitney CLE 2645 [mailto:WKew@RainBird.com]
Gesendet: Dienstag, 2. Dezember 2003 23:27
An: 'user@ant.apache.org'
Betreff: MIME/connection errors with MailLogger and <mail>


Hi there,

I'm somewhat of an Ant newbie.  I'm trying to get an email sent once a build
occurs on my machine, which is running Win2K SP4.  I'm using Ant 1.5.4.

The first thing I tried was the <mail> task, but I received the following
errors:

   make_test1:
        [mail] Failed to initialise MIME mail
        [mail] Sending email: Test build
        [mail] Failed to send email

   BUILD FAILED
   file: build.xml:28: IO error sending mail

The relevant .XML code that resulted in these errors is as follows:

   <target name="make_test1"
           depends="init">
      <property name="PROJECT" value="test1"/>
      <property name="LOGFILE" value="${PROJECT}.log"/>
      <property name="MYEMAIL" value="wkew@rainbird.com"/>
      <exec executable="${VSNET_EXE}" failonerror="true">
         <arg line="/REBUILD RELEASE /OUT ${LOGFILE} ${PROJECT}.sln"/>
      </exec>
      <mail mailhost="the_mail_server"
            subject="Test build">
         <from address="${MYEMAIL}"/>
         <to address="${MYEMAIL}"/>
         <message>The build completed.</message>
      </mail>
   </target>

Then, I tried using the MailLogger, but then I got a Java ConnectException:

MailLogger failed to send e-mail!
java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at org.apache.tools.mail.MailMessage.connect(MailMessage.java:375)
        at org.apache.tools.mail.MailMessage.<init>(MailMessage.java:197)
        at org.apache.tools.mail.MailMessage.<init>(MailMessage.java:179)
        at
org.apache.tools.ant.listener.MailLogger.sendMail(MailLogger.java:220)
        at
org.apache.tools.ant.listener.MailLogger.buildFinished(MailLogger.java:161)
        at org.apache.tools.ant.Project.fireBuildFinished(Project.java:1913)
        at org.apache.tools.ant.Main.runBuild(Main.java:628)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

The relevant portion of my .XML file looks like this:

<target name="make_test1"
        depends="init">
   <property name="PROJECT" value="test1"/>
   <property name="LOGFILE" value="${PROJECT}.log"/>
   <property name="MYEMAIL" value="wkew@rainbird.com"/>
   <property name="MailLogger.mailhost" value="the_mail_server"/>
   <property name="MailLogger.from" value="${MYEMAIL}"/>
   <property name="MailLogger.success.to" value="${MYEMAIL}"/>
   <property name="MailLogger.failure.to" value="${MYEMAIL}"/>
   <exec executable="${VSNET_EXE}" failonerror="true">
      <arg line="/REBUILD RELEASE /OUT ${LOGFILE} ${PROJECT}.sln"/>
   </exec>
</target>

Essentially, I'm trying to determine if I'm doing something wrong in Ant, or
if our company's mail server simply isn't playing nicely with me.  Does
anyone have any suggestions?

Thanks very much!

Whitney Kew
Software Engineer
Rain Bird Corporation
wkew@rainbird.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message