danny       01/10/04 11:22:17

  Modified:    src/java/org/apache/james/transport/mailets
                        RemoteDelivery.java
  Log:
  Patched so server identifies itself by hostname in returned undeliverables.
  
  Revision  Changes    Path
  1.8       +10 -3     
jakarta-james/src/java/org/apache/james/transport/mailets/RemoteDelivery.java
  
  Index: RemoteDelivery.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/RemoteDelivery.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RemoteDelivery.java       2001/09/27 21:14:37     1.7
  +++ RemoteDelivery.java       2001/10/04 18:22:17     1.8
  @@ -44,8 +44,8 @@
    * @author Serge Knystautas <[EMAIL PROTECTED]>
    * @author Federico Barbieri <[EMAIL PROTECTED]>
    *
  - * This is $Revision: 1.7 $
  - * Committed on $Date: 2001/09/27 21:14:37 $ by: $Author: serge $
  + * This is $Revision: 1.8 $
  + * Committed on $Date: 2001/10/04 18:22:17 $ by: $Author: danny $
    */
   public class RemoteDelivery extends GenericMailet implements Runnable {
   
  @@ -267,7 +267,14 @@
       private void bounce(MailImpl mail, MessagingException ex) {
           StringWriter sout = new StringWriter();
           PrintWriter pout = new PrintWriter(sout, true);
  -        pout.println("Hi. This is the James mail server (we don't know where)."); 
// at " + InetAddress.getLocalHost() + ".");
  +        String machine ="[unknown]";
  +        try{
  +             InetAddress me = InetAddress.getLocalHost();
  +             machine = me.getHostName();
  +        }catch(Exception e){
  +             machine = "[address unknown]";
  +        }
  +        pout.println("Hi. This is the James mail server at " + machine + ".");
           pout.println("I'm afraid I wasn't able to deliver your message to the 
following addresses.");
           pout.println("This is a permanent error; I've given up. Sorry it didn't 
work out.");
           pout.println();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to