You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by eh...@apache.org on 2002/08/08 16:35:23 UTC

cvs commit: jakarta-ant/src/main/org/apache/tools/ant/listener MailLogger.java

ehatcher    2002/08/08 07:35:23

  Modified:    src/main/org/apache/tools/ant/listener MailLogger.java
  Log:
  Applied patch from Romin Irani, thanks
  
  Revision  Changes    Path
  1.12      +6 -4      jakarta-ant/src/main/org/apache/tools/ant/listener/MailLogger.java
  
  Index: MailLogger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/listener/MailLogger.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- MailLogger.java	25 Jul 2002 15:21:03 -0000	1.11
  +++ MailLogger.java	8 Aug 2002 14:35:23 -0000	1.12
  @@ -72,7 +72,7 @@
    *  results. The following Project properties are used to send the mail.
    *  <ul>
    *    <li> MailLogger.mailhost [default: localhost] - Mail server to use</li>
  - *
  + *    <li> MailLogger.port [default: 25] - Default port for SMTP </li>
    *    <li> MailLogger.from [required] - Mail "from" address</li>
    *    <li> MailLogger.failure.notify [default: true] - Send build failure
    *    e-mails?</li>
  @@ -150,13 +150,14 @@
               }
   
               String mailhost = getValue(properties, "mailhost", "localhost");
  +            int port = Integer.parseInt(getValue(properties,"port",String.valueOf(MailMessage.DEFAULT_PORT)));
               String from = getValue(properties, "from", null);
   
               String toList = getValue(properties, prefix + ".to", null);
               String subject = getValue(properties, prefix + ".subject",
                       (success) ? "Build Success" : "Build Failure");
   
  -            sendMail(mailhost, from, toList, subject, buffer.toString());
  +            sendMail(mailhost, port, from, toList, subject, buffer.toString());
           } catch (Exception e) {
               System.out.println("MailLogger failed to send e-mail!");
               e.printStackTrace(System.err);
  @@ -207,15 +208,16 @@
        *  Send the mail
        *
        * @param  mailhost         mail server
  +     * @param  port             mail server port number
        * @param  from             from address
        * @param  toList           comma-separated recipient list
        * @param  subject          mail subject
        * @param  message          mail body
        * @exception  IOException  thrown if sending message fails
        */
  -    private void sendMail(String mailhost, String from, String toList,
  +    private void sendMail(String mailhost, int port, String from, String toList,
                             String subject, String message) throws IOException {
  -        MailMessage mailMessage = new MailMessage(mailhost);
  +        MailMessage mailMessage = new MailMessage(mailhost, port);
   
           mailMessage.from(from);
   
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>