Mornin, i will review the stuff again. Thx for reporting ;-)
bye Norman Stefano Bagnara schrieb: > -1 for 2 reasons: > > 1) I explained in reply to r487278 that in trunk we already had a > solution that required no code changes, so I think we should backport > that one and not r487278. > > 2) The previous commit to v2.3 received a veto from me. I think we > should at least resolve a veto before backporting something else > there, otherwise we'll end up with an unmanageable branch. > > Stefano > > PS: In both cases I will retire my veto if a majority of committers > will be +1 to apply the patches. I at least want to be sure this stuff > has been reviewed and that people agree on this and the veto is the > only way I have to ensure it, now. > > [EMAIL PROTECTED] wrote: >> Author: norman >> Date: Fri Dec 15 05:09:39 2006 >> New Revision: 487546 >> >> URL: http://svn.apache.org/viewvc?view=rev&rev=487546 >> Log: >> Backport fix for JAMES-735. >> >> Modified: >> james/server/branches/v2.3/src/conf/james-config.xml >> >> james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/RemoteDelivery.java >> >> >> Modified: james/server/branches/v2.3/src/conf/james-config.xml >> URL: >> http://svn.apache.org/viewvc/james/server/branches/v2.3/src/conf/james-config.xml?view=diff&rev=487546&r1=487545&r2=487546 >> >> ============================================================================== >> >> --- james/server/branches/v2.3/src/conf/james-config.xml (original) >> +++ james/server/branches/v2.3/src/conf/james-config.xml Fri Dec 15 >> 05:09:39 2006 >> @@ -590,6 +590,12 @@ >> <gateway> otherserver.mydomain.com </gateway> >> <gatewayPort>25</gatewayPort> >> --> >> + + <!-- The name which will be used as HELO. >> If not set the heloName configured in James block --> >> + <!-- will be used. --> >> + <!-- >> + <helloName> myMailServer </helloName> + --> >> </mailet> >> >> </processor> >> >> Modified: >> james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/RemoteDelivery.java >> >> URL: >> http://svn.apache.org/viewvc/james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/RemoteDelivery.java?view=diff&rev=487546&r1=487545&r2=487546 >> >> ============================================================================== >> >> --- >> james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/RemoteDelivery.java >> (original) >> +++ >> james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/RemoteDelivery.java >> Fri Dec 15 05:09:39 2006 >> @@ -223,6 +223,8 @@ >> private MultipleDelayFilter delayFilter = new >> MultipleDelayFilter ();//used by accept to selcet the next mail ready >> for processing >> >> + private String helloName = null; >> + /** >> * Initialize the mailet >> */ >> @@ -357,6 +359,9 @@ >> } catch (UnknownHostException e) { >> log("Invalid bind setting (" + bindAddress + "): " + >> e.toString()); >> } >> + + helloName = getInitParameter("helloName"); >> + } >> >> /* >> @@ -1033,26 +1038,40 @@ >> * there are any >> */ >> public void run() { >> - >> - /* TODO: CHANGE ME!!! The problem is that we need to wait >> for James to >> - * finish initializing. We expect the HELLO_NAME to be put >> into >> - * the MailetContext, but in the current configuration we get >> - * started before the SMTP Server, which establishes the value. >> - * Since there is no contractual guarantee that there will be a >> - * HELLO_NAME value, we can't just wait for it. As a temporary >> - * measure, I'm inserting this philosophically unsatisfactory >> - * fix. >> - */ >> - long stop = System.currentTimeMillis() + 60000; >> - while >> ((getMailetContext().getAttribute(Constants.HELLO_NAME) == null) >> - && stop > System.currentTimeMillis()) { >> - try { >> - Thread.sleep(1000); >> - } catch (Exception ignored) {} // wait for James to >> finish initializing >> - } >> - >> //Checks the pool and delivers a mail message >> Properties props = new Properties(); >> + + if (helloName == null) { >> + /* TODO: CHANGE ME!!! The problem is that we need to >> wait for James to >> + * finish initializing. We expect the HELLO_NAME to be >> put into >> + * the MailetContext, but in the current configuration >> we get >> + * started before the SMTP Server, which establishes the >> value. >> + * Since there is no contractual guarantee that there >> will be a >> + * HELLO_NAME value, we can't just wait for it. As a >> temporary >> + * measure, I'm inserting this philosophically >> unsatisfactory >> + * fix. >> + */ >> + long stop = System.currentTimeMillis() + 60000; >> + while >> ((getMailetContext().getAttribute(Constants.HELLO_NAME) == null) >> + && stop > System.currentTimeMillis()) { >> + try { >> + Thread.sleep(1000); >> + } catch (Exception ignored) {} // wait for James to >> finish initializing >> + } >> + + String defaultDomain = (String) >> getMailetContext().getAttribute(Constants.HELLO_NAME); >> + if (defaultDomain != null) { >> + props.put("mail.smtp.localhost", defaultDomain); >> + } else { >> + defaultDomain = (String) >> getMailetContext().getAttribute(Constants.DEFAULT_DOMAIN); >> + if (defaultDomain != null) { >> + props.put("mail.smtp.localhost", defaultDomain); >> + } >> + } >> + } else { >> + props.put("mail.smtp.localhost", helloName); >> + } >> + //Not needed for production environment >> props.put("mail.debug", "false"); >> // Reactivated: javamail 1.3.2 should no more have problems >> with "250 OK" >> @@ -1068,17 +1087,6 @@ >> >> props.put("mail.smtp.connectiontimeout", connectionTimeout + >> ""); >> props.put("mail.smtp.sendpartial",String.valueOf(sendPartial)); >> - >> - //Set the hostname we'll use as this server >> - if (getMailetContext().getAttribute(Constants.HELLO_NAME) != >> null) { >> - props.put("mail.smtp.localhost", >> getMailetContext().getAttribute(Constants.HELLO_NAME)); >> - } >> - else { >> - String defaultDomain = (String) >> getMailetContext().getAttribute(Constants.DEFAULT_DOMAIN); >> - if (defaultDomain != null) { >> - props.put("mail.smtp.localhost", defaultDomain); >> - } >> - } >> >> if (isBindUsed) { >> // undocumented JavaMail 1.2 feature, smtp transport >> will use >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
