sbrewin     2004/02/15 06:36:08

  Modified:    src/xdocs Tag: branch_2_1_fcs
                        fetchmail_configuration_2_2.xml
               src/java/org/apache/james/fetchmail Tag: branch_2_1_fcs
                        MessageProcessor.java
  Log:
  Ensure mail is always created with a remote address and remote hostname.

  

  See http://nagoya.apache.org/jira/secure/ViewIssue.jspa?key=JAMES-152
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.6   +2 -1      james-server/src/xdocs/fetchmail_configuration_2_2.xml
  
  Index: fetchmail_configuration_2_2.xml
  ===================================================================
  RCS file: /home/cvs/james-server/src/xdocs/fetchmail_configuration_2_2.xml,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- fetchmail_configuration_2_2.xml   13 Feb 2004 18:25:30 -0000      1.1.2.5
  +++ fetchmail_configuration_2_2.xml   15 Feb 2004 14:36:08 -0000      1.1.2.6
  @@ -506,7 +506,8 @@
   will not be injected into the James input spool. If "false", mail whose 
   specified recieved header is invalid will be injected into the James input spool 
with 
   the Mail Attribute <code>org.apache.james.fetchmail.isInvalidReceivedHeader</code>
  -added to the mail.
  +added to the mail, the remote address set to <code>127.0.0.1</code> and the remote 
  +host name set to <code>localhost</code>.
   </dd>
   <dt><strong>leaveonserver</strong></dt>
   <dd>A boolean. If &quot;true&quot;, mail whose specified recieved header is invalid
  
  
  
  No                   revision
  No                   revision
  1.1.2.7   +12 -2     
james-server/src/java/org/apache/james/fetchmail/MessageProcessor.java
  
  Index: MessageProcessor.java
  ===================================================================
  RCS file: 
/home/cvs/james-server/src/java/org/apache/james/fetchmail/MessageProcessor.java,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- MessageProcessor.java     13 Feb 2004 18:25:30 -0000      1.1.2.6
  +++ MessageProcessor.java     15 Feb 2004 14:36:08 -0000      1.1.2.7
  @@ -596,8 +596,18 @@
           recipients.add(recipient);
           MailImpl mail =
               new MailImpl(getServer().getId(), getSender(), recipients, message);
  -        mail.setRemoteAddr(getRemoteAddress());
  -        mail.setRemoteHost(getRemoteHostName());
  +        // Ensure the mail is created with non-null remote host name and address,
  +        // otherwise the Mailet chain may go splat!
  +        if (getRemoteAddress() == null || getRemoteHostName() == null)
  +        {
  +            mail.setRemoteAddr("127.0.0.1");
  +            mail.setRemoteHost("localhost");
  +        }
  +        else
  +        {
  +            mail.setRemoteAddr(getRemoteAddress());
  +            mail.setRemoteHost(getRemoteHostName());
  +        }
   
           if (getLogger().isDebugEnabled())
           {
  
  
  

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

Reply via email to