You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Diwaker Gupta <di...@gmail.com> on 2004/07/27 02:49:15 UTC
forrestbot email notification fails
Alright, first thanks for adding that notification on success option.
However, notification still fails:
notify.email:
Failed to initialise MIME mail: org.apache.tools.ant.taskdefs.email.MimeMailer
Sending email: ForrestBot build for ${ant.project.name} succeeded
Failed to send email
On inspecting the ANT jar files (from the SVN repo), I get the
following Mail related classes:
7437 Fri Jul 16 09:38:30 PDT 2004 org/apache/tools/ant/listener/MailLogger.class
2800 Fri Jul 16 09:38:32 PDT 2004
org/apache/tools/ant/taskdefs/email/Mailer.class
3732 Fri Jul 16 09:38:32 PDT 2004
org/apache/tools/ant/taskdefs/email/PlainMailer.class
1487 Fri Jul 16 09:38:32 PDT 2004
org/apache/tools/ant/taskdefs/email/UUMailer.class
7764 Fri Jul 16 09:38:38 PDT 2004 org/apache/tools/mail/MailMessage.class
1176 Fri Jul 16 09:38:38 PDT 2004 org/apache/tools/mail/MailPrintStream.class
861 Fri Jul 16 09:38:36 PDT 2004
org/apache/tools/ant/taskdefs/optional/net/MimeMail.class
So basically the notification fails because it tries to use the
MimeMailer class, which is not present in the ANT tasks in the
repository.
Possible solutions:
o include MimeMailer in the jar files
o make fallback to PlainMailer if MimeMailer fails or allow user to
specify mailer to use (this is BAD -- it shud be perfectly transparent
to the user ideally)
--
Diwaker Gupta
http://resolute.ucsd.edu/diwaker
[patch] fix email notification failing due to bad sender problem
Posted by Diwaker Gupta <di...@gmail.com>.
This patch fixes the problem in sending email notifications. The from
address was being set to ForrestBot which is certainly not a valid
email address and most SMTP servers will reject this mail..
Re: forrestbot email notification fails
Posted by Dave Brondsema <da...@brondsema.net>.
Diwaker Gupta wrote:
>
>>Can you create an ant buildfile that just does a <mail> (with attachment)
>>and try running that with the ant that forrest includes? Run with -v and
>>-d parameters to give extra debugging output.
>
>
> Apparently this seems to work:
> <?xml version="1.0" encoding="UTF-8"?>
> <project basedir="." default="all" name="try">
> <target name="mail">
> <mail from="diwaker@ucsd.edu"
> tolist="dgupta@cs.ucsd.edu"
> subject="Results of nightly build"
> files="build.xml"/>
> </target>
> </project>
>
> mail:
> [mail] Failed to initialise MIME mail: javax/mail/MessagingException
> [mail] Using UU mail
> [mail] Sending email: Results of nightly build
> [mail] From diwaker@ucsd.edu
> [mail] ReplyTo []
> [mail] To [dgupta@cs.ucsd.edu]
> [mail] Cc []
> [mail] Bcc []
> [mail] Sent email with 1 attachment
>
> BUILD SUCCESSFUL
>
> After this, I ran forrestbot with -v and -d flags, and here's what I got:
> notify.email:
> Setting project property: NOW -> 27 July 01:57 PM
> Override ignored for property DSTAMP
> Override ignored for property TSTAMP
> Override ignored for property TODAY
> Property ${ant.project.name} has not been set
> Failed to initialise MIME mail: org.apache.tools.ant.taskdefs.email.MimeMailer
> Using UU mail
> Sending email: ForrestBot build for ${ant.project.name} succeeded
> From Forrestbot
> ReplyTo []
> To [dgupta@cs.ucsd.edu]
> Cc []
> Bcc []
> Failed to send email
>
> So it seems that it IS trying to use UU mail, however, it fails
> because of some other reason -- in this case, I think its because the
> From address is not set properly. It should be a well formed email
> address right?
Good thought! The mail daemon probably rejects the email because of a
bad 'from' address. Some mail daemons might even restrict based on
domain. Another thing to make configurable I guess.
--
Dave Brondsema : dave@brondsema.net
http://www.splike.com : programming
http://csx.calvin.edu : student org
http://www.brondsema.net : personal
Re: forrestbot email notification fails
Posted by Diwaker Gupta <di...@gmail.com>.
> Looks fine to me. What version OS and version of Java are you using?
$ uname -a
Linux resolute 2.6.7-1-686-smp #1 SMP Thu Jul 8 06:08:37 EDT 2004 i686 GNU/Linux
Running Debian unstable
$ java -version
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.4.1-beta)
Java HotSpot(TM) Client VM (build Blackdown-1.4.1-beta, mixed mode)
> Can you create an ant buildfile that just does a <mail> (with attachment)
> and try running that with the ant that forrest includes? Run with -v and
> -d parameters to give extra debugging output.
Apparently this seems to work:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="all" name="try">
<target name="mail">
<mail from="diwaker@ucsd.edu"
tolist="dgupta@cs.ucsd.edu"
subject="Results of nightly build"
files="build.xml"/>
</target>
</project>
mail:
[mail] Failed to initialise MIME mail: javax/mail/MessagingException
[mail] Using UU mail
[mail] Sending email: Results of nightly build
[mail] From diwaker@ucsd.edu
[mail] ReplyTo []
[mail] To [dgupta@cs.ucsd.edu]
[mail] Cc []
[mail] Bcc []
[mail] Sent email with 1 attachment
BUILD SUCCESSFUL
After this, I ran forrestbot with -v and -d flags, and here's what I got:
notify.email:
Setting project property: NOW -> 27 July 01:57 PM
Override ignored for property DSTAMP
Override ignored for property TSTAMP
Override ignored for property TODAY
Property ${ant.project.name} has not been set
Failed to initialise MIME mail: org.apache.tools.ant.taskdefs.email.MimeMailer
Using UU mail
Sending email: ForrestBot build for ${ant.project.name} succeeded
>From Forrestbot
ReplyTo []
To [dgupta@cs.ucsd.edu]
Cc []
Bcc []
Failed to send email
So it seems that it IS trying to use UU mail, however, it fails
because of some other reason -- in this case, I think its because the
>From address is not set properly. It should be a well formed email
address right?
--
Diwaker Gupta
http://resolute.ucsd.edu/diwaker
Re: forrestbot email notification fails
Posted by Dave Brondsema <da...@brondsema.net>.
On Mon, 26 Jul 2004, Diwaker Gupta wrote:
> > When I do it, it falls back to UUMailer. Are you running it with
> > `forrest -f buildfile.xml` or `ant -f buildfile.xml`?
>
> forrest -f buildfile.xml
>
> Here's what my file looks like:
Looks fine to me. What version OS and version of Java are you using?
Can you create an ant buildfile that just does a <mail> (with attachment)
and try running that with the ant that forrest includes? Run with -v and
-d parameters to give extra debugging output.
--
Dave Brondsema : dave@brondsema.net
http://www.brondsema.net : personal
http://www.splike.com : programming
http://csx.calvin.edu : student org
Re: forrestbot email notification fails
Posted by Diwaker Gupta <di...@gmail.com>.
> When I do it, it falls back to UUMailer. Are you running it with
> `forrest -f buildfile.xml` or `ant -f buildfile.xml`?
forrest -f buildfile.xml
Here's what my file looks like:
<project default="main">
<property name="notify.email.host" value="smtp.ucsd.edu"/>
<property name="notify.email.to" value="dgupta@cs.ucsd.edu"/>
<property name="notify.administrator"
value="Diwaker<dgupta@cs.ucsd.edu"/>
<property name="notify.on.success" value="true"/>
<property name="getsrc.local.root-dir"
value="/home/diwaker/projects/forrest/" />
<property name="deploy.local.dir" value="/home/diwaker/www/" />
<!-- here we specify to use two notification implementations -->
<target name="notify" depends="notify.email"/>
<!-- here we specify to deploy with the scp implementation -->
<target name="deploy" depends="deploy.local"/>
<!-- the default implementation for getsrc is getsrc.cvs, which is
NOT what we want -->
<target name="getsrc" depends="getsrc.local"/>
<!-- assumes FORREST_HOME has been set as an environment variable -->
<property environment="env"/>
<import file="${env.FORREST_HOME}/../forrestbot/core/forrestbot.xml"/>
</project>
--
Diwaker Gupta
http://resolute.ucsd.edu/diwaker
Re: forrestbot email notification fails
Posted by Dave Brondsema <da...@brondsema.net>.
Diwaker Gupta wrote:
> Alright, first thanks for adding that notification on success option.
> However, notification still fails:
>
> notify.email:
> Failed to initialise MIME mail: org.apache.tools.ant.taskdefs.email.MimeMailer
> Sending email: ForrestBot build for ${ant.project.name} succeeded
> Failed to send email
>
> On inspecting the ANT jar files (from the SVN repo), I get the
> following Mail related classes:
> 7437 Fri Jul 16 09:38:30 PDT 2004 org/apache/tools/ant/listener/MailLogger.class
> 2800 Fri Jul 16 09:38:32 PDT 2004
> org/apache/tools/ant/taskdefs/email/Mailer.class
> 3732 Fri Jul 16 09:38:32 PDT 2004
> org/apache/tools/ant/taskdefs/email/PlainMailer.class
> 1487 Fri Jul 16 09:38:32 PDT 2004
> org/apache/tools/ant/taskdefs/email/UUMailer.class
> 7764 Fri Jul 16 09:38:38 PDT 2004 org/apache/tools/mail/MailMessage.class
> 1176 Fri Jul 16 09:38:38 PDT 2004 org/apache/tools/mail/MailPrintStream.class
> 861 Fri Jul 16 09:38:36 PDT 2004
> org/apache/tools/ant/taskdefs/optional/net/MimeMail.class
>
> So basically the notification fails because it tries to use the
> MimeMailer class, which is not present in the ANT tasks in the
> repository.
>
> Possible solutions:
> o include MimeMailer in the jar files
> o make fallback to PlainMailer if MimeMailer fails or allow user to
> specify mailer to use (this is BAD -- it shud be perfectly transparent
> to the user ideally)
>
When I do it, it falls back to UUMailer. Are you running it with
`forrest -f buildfile.xml` or `ant -f buildfile.xml`?
--
Dave Brondsema : dave@brondsema.net
http://www.splike.com : programming
http://csx.calvin.edu : student org
http://www.brondsema.net : personal