Re: James 3 b4 HELO Override Not Working? [unsigned]

2014-10-28 Thread Robert Munn
Bernd,

Thanks for that link of the properties. I don’t know how faithfully that list 
is followed. Take for instance the note that if you are using SSL over smtp 
that all variables would be mail.smtps. instead of mail.smtp. I don’t see any 
advantage in having a separate variable name for hostname over smtps v. 
hostname over smtp, nor do I see it implemented this way in James for instance. 
Still, I agree that the list is from Sun and should be used as a reference 
point.

The multi-homed issue is one of the things discussed in the stack overflow 
link. Manually specifying the hostname is the only way I see to solve that 
problem.

You are welcome for the fix.

Robert


On Oct 28, 2014, at 3:21 AM, Bernd Waibel bwai...@intarsys.de wrote:

 Hello Robert,
 
 please keep in mind for mulithomed servers, or servers with more than one 
 network card.
 So I have some remarks:
 
 Remarks to mail.smtp.localhost:
 --
 As I could remember, the mail.smtp.localhost and other properties are 
 defined by SUN.
 https://javamail.java.net/nonav/docs/api/com/sun/mail/smtp/package-summary.html
 So they are implemented by the mail.jar or smpt.jar implementation (the 
 javax.mail packages).
 This mail.jar API is rather old, and seems not be active developed. Btw. it 
 is from SUN, so it is may be history.
 
 We are using james 2.3.2 in production, and we discovered some parsing errors 
 inside mail.jar.
 E.g. If the mail is some kind of non-standard format (like filename=xyz.pdf, 
 with missing quotes), the jar has parsing problems.
 This happens mostly by spam mails, so it may be ignored. But there seems to 
 be nobody to fix this at Oracle.
 So I am not sure if Geronimo implements these parameters, or should implement 
 this parameters.
 But, on the other side, it is defined and could be used as default.
 
 These smtp parameters could be set on startup as java vm parameters, and will 
 be interpreted by the mail.jar.
 So it worked in james 2.3.2, but this seems not to be comfortable. So 
 configuration should be possible.
 
 The problem with these parameters is, that it may be difficult to set 
 addresses for hosts with more than one network card.
 If you have a host, which listens to two hostnames, to which value would you 
 set the hostname?
 So it may always be a default implementation, which should be possible to 
 configure.
 
 Remarks to getLocalHost():
 -
 Also the call to InetAddress.getLocalHost() is not clear for hosts listening 
 on two network cards.
 Some implementations seem to deliver always 127.0.0.1 as localhost. So this 
 call does sometimes offer the address of a loopback adapter. I think this 
 depends on the OS/Linux system used.
 In my opinion, this is not a bug, because it is not clear which network card 
 to use on getLocalHost().
 But the same: it should be an option for default implementation, which should 
 always be possible to configure.
 
 Just my remarks.
 
 Many thanks for fixing that.
 
 
 
 Thanks,
 Bernd
 
 -Ursprüngliche Nachricht-
 Von: Robert Munn [mailto:cfmuns...@gmail.com] 
 Gesendet: Dienstag, 28. Oktober 2014 09:29
 An: James Users List
 Betreff: Re: James 3 b4 HELO Override Not Working?
 
 Last followup about this subject for now. I did some digging into Geronimo 
 Javamail. There is a newer version, but the implementation has not changed, 
 and I don't think it is regarded as a bug. I don't see in the docs where 
 mail.smtp.localhost is supposed to preempt the 
 InetAddress.getLocalHost().getHostName() method call. Jerry, if you could 
 point me in the right direction that would be great.
 
 I also did some digging about InetAddress.getLocalHost().getHostName()  and 
 found no clear answer that it is the accepted way to get the hostname, for 
 exactly the reason that we have encountered - too many ways for the 
 configuration (DNS, etc.) to foul up the works. There is also a discussion 
 that has me thinking getCanonicalHostName() should be the method called 
 because it will try to get the FQDN, where getHostName() is clearly just 
 grabbing the local server name. 
 
 http://stackoverflow.com/questions/7348711/recommended-way-to-get-hostname-in-java/788#788
 
 http://stackoverflow.com/questions/12669076/host-name-vs-canonical-host-name
 
 I agree with you that MailConnection.java should check for 
 mail.smtp.localhost in properties first, but it looks like the property 
 being used in Geronimo is localhost, so I don't know whether it is worth 
 pursing a fix at this time. I may run it by the Geronimo mailing list to see 
 if anyone has run into this issue.
 
 
 
 
 
 
 On Oct 27, 2014, at 7:50 PM, Robert Munn cfmuns...@gmail.com wrote:
 
 A couple of additional notes. This issue appeared on Ubuntu as well, 
 so it is not just a windows issue.
 
 On the  good side, the version of Geronimo java mail in the app is 
 fairly old, so this bug may be fixed already.
 On Oct 27, 2014 12:29 PM, Jerry 

AW: Re: James 3 b4 HELO Override Not Working? [unsigned]

2014-10-27 Thread Bernd Waibel
Hi Jerry

I am not using v3 but:

Could you try setting the parameter -Djava.mail.localhost=mail.jwmhosting.com 
in the java startup command line?

Most java.mail parameters are only parsed on startup by the vm.


Ciao.
Bernd



 Ursprüngliche Nachricht 
Von: Jerry Malcolm techst...@malcolms.com
Datum:
An: James Users List server-user@james.apache.org
Betreff: Re: James 3 b4 HELO Override Not Working?


More progress... But now I'm really stumped.  I dug into the
remoteDelivery mailet source.  I did confirm that James is NOT using the
smtpserver.xml 'hello' value at all for outbound HELO.  It is definitely
using the config parms for the remoteDelivery mailet.

In the mailet, the outbound HELO value is set by javax.mail.Transport
based on the 'mail.smtp.localhost' property passed in via the Properties
object.  According to the Transport javadoc, it says it'll use the
property value for HELO if it's set, and if it's not set, it'll use
InetAddress.getLocalHost().getHostName().  Fine.  So I cloned the mailet
so I could add log statements and do some debug.   I add two log
statements right above the 'transport.sendMessage()' call in the
RemoteDelivery mailet:

  log( JWMRemoteDelivery.deliver() mail.smtp.localhost -  +
props.getProperty( mail.smtp.localhost ));

  log( JWMRemoteDelivery.deliver()
InetAddress.getLocalHost().getHostName() -  +
InetAddress.getLocalHost().getHostName() );

   transport.sendMessage(message, addr);

In the log, I get

INFO  09:52:19,480 | james.mailetcontext | JWMRemoteDelivery.deliver()
mail.smtp.localhost - mail.jwmhosting.com

INFO  09:52:19,480 | james.mailetcontext | JWMRemoteDelivery.deliver()
InetAddress.getLocalHost().getHostName() - p2825577

This is precisely what I expected to get.  BUT when the mail is
sent, the p282 is sent in the HELO.

It appears that javax.mail.Transport is ignoring the property (or not
recognizing that it is set).  But I'm pretty certain that a bug that is
that blatant would not be hanging around unreported in a base java class
like Transport.  But, then again, that's what I appear to be seeing.

Where am I going wrong?

Secondarily, anybody know how I can change what java reports back on the
InetAddress call other than changing the machine name?  Is there a JVM
parameter I can pass in?  If I can force that, problem solved for me
(although it's still not working correctly).

Thanks again.

Jerry



-
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org



Re: James 3 b4 HELO Override Not Working? [unsigned]

2014-10-27 Thread Robert Munn
Bernd,

See my previous note, I think the java.mail.localhost parameter is being 
ignored in the source code. I tried your suggestion and it did not seem to make 
a difference. I added the parameter as an argument in wrapper.conf as:

wrapper.java.additional.15=-Dhostname

But that change was not picked up.

I am testing a temporary patch of AbstractConfigurableAsyncServer.java, trying 
to do a build, but repository.apache.org is throwing a 503 error Service 
Temporarily Unavailable. It took 14 minutes to do a build, and I’m not sure the 
build is good, although it reported success. I am going to test my patch and 
report back.

Robert




On Oct 27, 2014, at 9:09 AM, Bernd Waibel bwai...@intarsys.de wrote:

 Hi Jerry
 
 I am not using v3 but:
 
 Could you try setting the parameter 
 -Djava.mail.localhost=mail.jwmhosting.com in the java startup command line?
 
 Most java.mail parameters are only parsed on startup by the vm.
 
 
 Ciao.
 Bernd
 
 
 
  Ursprüngliche Nachricht 
 Von: Jerry Malcolm techst...@malcolms.com
 Datum:
 An: James Users List server-user@james.apache.org
 Betreff: Re: James 3 b4 HELO Override Not Working?
 
 
 More progress... But now I'm really stumped.  I dug into the
 remoteDelivery mailet source.  I did confirm that James is NOT using the
 smtpserver.xml 'hello' value at all for outbound HELO.  It is definitely
 using the config parms for the remoteDelivery mailet.
 
 In the mailet, the outbound HELO value is set by javax.mail.Transport
 based on the 'mail.smtp.localhost' property passed in via the Properties
 object.  According to the Transport javadoc, it says it'll use the
 property value for HELO if it's set, and if it's not set, it'll use
 InetAddress.getLocalHost().getHostName().  Fine.  So I cloned the mailet
 so I could add log statements and do some debug.   I add two log
 statements right above the 'transport.sendMessage()' call in the
 RemoteDelivery mailet:
 
  log( JWMRemoteDelivery.deliver() mail.smtp.localhost -  +
 props.getProperty( mail.smtp.localhost ));
 
  log( JWMRemoteDelivery.deliver()
 InetAddress.getLocalHost().getHostName() -  +
 InetAddress.getLocalHost().getHostName() );
 
   transport.sendMessage(message, addr);
 
 In the log, I get
 
 INFO  09:52:19,480 | james.mailetcontext | JWMRemoteDelivery.deliver()
 mail.smtp.localhost - mail.jwmhosting.com
 
 INFO  09:52:19,480 | james.mailetcontext | JWMRemoteDelivery.deliver()
 InetAddress.getLocalHost().getHostName() - p2825577
 
 This is precisely what I expected to get.  BUT when the mail is
 sent, the p282 is sent in the HELO.
 
 It appears that javax.mail.Transport is ignoring the property (or not
 recognizing that it is set).  But I'm pretty certain that a bug that is
 that blatant would not be hanging around unreported in a base java class
 like Transport.  But, then again, that's what I appear to be seeing.
 
 Where am I going wrong?
 
 Secondarily, anybody know how I can change what java reports back on the
 InetAddress call other than changing the machine name?  Is there a JVM
 parameter I can pass in?  If I can force that, problem solved for me
 (although it's still not working correctly).
 
 Thanks again.
 
 Jerry
 
 
 
 -
 To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
 For additional commands, e-mail: server-user-h...@james.apache.org
 



Re: James 3 b4 HELO Override Not Working? [unsigned]

2014-10-27 Thread Robert Munn
looking for the proper geronimo sources right now …

On Oct 27, 2014, at 10:31 AM, Jerry Malcolm techst...@malcolms.com wrote:

 Robert,
 
 Where does the abstract configurator enter the flow?  Unless it overrides the 
 InetAddress.getLocalHost().getHostname() call, I don't think it will help 
 since that is the ONLY thing the transport is looking at for HELO.  Details 
 in my previous post. I believe the actual error is in:
 
 org.apache.geronimo.javamail.transport.smtp.SMTPConnection.java
 
 I can make the fix to that class if you have the ability to rebuild the 
 geronimo.javamail.jar file.
 
 Thanks.
 
 Jerry
 
 
 
 
 On 10/27/2014 12:16 PM, Robert Munn wrote:
 Bernd,
 
 See my previous note, I think the java.mail.localhost parameter is being 
 ignored in the source code. I tried your suggestion and it did not seem to 
 make a difference. I added the parameter as an argument in wrapper.conf as:
 
 wrapper.java.additional.15=-Dhostname
 
 But that change was not picked up.
 
 I am testing a temporary patch of AbstractConfigurableAsyncServer.java, 
 trying to do a build, but repository.apache.org is throwing a 503 error 
 Service Temporarily Unavailable. It took 14 minutes to do a build, and I’m 
 not sure the build is good, although it reported success. I am going to test 
 my patch and report back.
 
 Robert
 
 
 
 
 On Oct 27, 2014, at 9:09 AM, Bernd Waibel bwai...@intarsys.de wrote:
 
 Hi Jerry
 
 I am not using v3 but:
 
 Could you try setting the parameter 
 -Djava.mail.localhost=mail.jwmhosting.com in the java startup command 
 line?
 
 Most java.mail parameters are only parsed on startup by the vm.
 
 
 Ciao.
 Bernd
 
 
 
  Ursprüngliche Nachricht 
 Von: Jerry Malcolm techst...@malcolms.com
 Datum:
 An: James Users List server-user@james.apache.org
 Betreff: Re: James 3 b4 HELO Override Not Working?
 
 
 More progress... But now I'm really stumped.  I dug into the
 remoteDelivery mailet source.  I did confirm that James is NOT using the
 smtpserver.xml 'hello' value at all for outbound HELO.  It is definitely
 using the config parms for the remoteDelivery mailet.
 
 In the mailet, the outbound HELO value is set by javax.mail.Transport
 based on the 'mail.smtp.localhost' property passed in via the Properties
 object.  According to the Transport javadoc, it says it'll use the
 property value for HELO if it's set, and if it's not set, it'll use
 InetAddress.getLocalHost().getHostName().  Fine.  So I cloned the mailet
 so I could add log statements and do some debug.   I add two log
 statements right above the 'transport.sendMessage()' call in the
 RemoteDelivery mailet:
 
  log( JWMRemoteDelivery.deliver() mail.smtp.localhost -  +
 props.getProperty( mail.smtp.localhost ));
 
  log( JWMRemoteDelivery.deliver()
 InetAddress.getLocalHost().getHostName() -  +
 InetAddress.getLocalHost().getHostName() );
 
   transport.sendMessage(message, addr);
 
 In the log, I get
 
 INFO  09:52:19,480 | james.mailetcontext | JWMRemoteDelivery.deliver()
 mail.smtp.localhost - mail.jwmhosting.com
 
 INFO  09:52:19,480 | james.mailetcontext | JWMRemoteDelivery.deliver()
 InetAddress.getLocalHost().getHostName() - p2825577
 
 This is precisely what I expected to get.  BUT when the mail is
 sent, the p282 is sent in the HELO.
 
 It appears that javax.mail.Transport is ignoring the property (or not
 recognizing that it is set).  But I'm pretty certain that a bug that is
 that blatant would not be hanging around unreported in a base java class
 like Transport.  But, then again, that's what I appear to be seeing.
 
 Where am I going wrong?
 
 Secondarily, anybody know how I can change what java reports back on the
 InetAddress call other than changing the machine name?  Is there a JVM
 parameter I can pass in?  If I can force that, problem solved for me
 (although it's still not working correctly).
 
 Thanks again.
 
 Jerry
 
 
 
 -
 To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
 For additional commands, e-mail: server-user-h...@james.apache.org
 
 
 
 
 -
 No virus found in this message.
 Checked by AVG - www.avg.com
 Version: 2015.0.5315 / Virus Database: 4189/8462 - Release Date: 10/27/14
 
 
 
 -
 To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
 For additional commands, e-mail: server-user-h...@james.apache.org
 


-
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org



Re: James 3 b4 HELO Override Not Working? [unsigned]

2014-10-27 Thread Robert Munn
ok, found the source, running a test build now. 

Here is the source repo for the version we need: 

http://svn.apache.org/repos/asf/geronimo/javamail/tags/geronimo-javamail_1.4-1.8.3/



On Oct 27, 2014, at 9:09 AM, Bernd Waibel bwai...@intarsys.de wrote:

 Hi Jerry
 
 I am not using v3 but:
 
 Could you try setting the parameter 
 -Djava.mail.localhost=mail.jwmhosting.com in the java startup command line?
 
 Most java.mail parameters are only parsed on startup by the vm.
 
 
 Ciao.
 Bernd
 
 
 
  Ursprüngliche Nachricht 
 Von: Jerry Malcolm techst...@malcolms.com
 Datum:
 An: James Users List server-user@james.apache.org
 Betreff: Re: James 3 b4 HELO Override Not Working?
 
 
 More progress... But now I'm really stumped.  I dug into the
 remoteDelivery mailet source.  I did confirm that James is NOT using the
 smtpserver.xml 'hello' value at all for outbound HELO.  It is definitely
 using the config parms for the remoteDelivery mailet.
 
 In the mailet, the outbound HELO value is set by javax.mail.Transport
 based on the 'mail.smtp.localhost' property passed in via the Properties
 object.  According to the Transport javadoc, it says it'll use the
 property value for HELO if it's set, and if it's not set, it'll use
 InetAddress.getLocalHost().getHostName().  Fine.  So I cloned the mailet
 so I could add log statements and do some debug.   I add two log
 statements right above the 'transport.sendMessage()' call in the
 RemoteDelivery mailet:
 
  log( JWMRemoteDelivery.deliver() mail.smtp.localhost -  +
 props.getProperty( mail.smtp.localhost ));
 
  log( JWMRemoteDelivery.deliver()
 InetAddress.getLocalHost().getHostName() -  +
 InetAddress.getLocalHost().getHostName() );
 
   transport.sendMessage(message, addr);
 
 In the log, I get
 
 INFO  09:52:19,480 | james.mailetcontext | JWMRemoteDelivery.deliver()
 mail.smtp.localhost - mail.jwmhosting.com
 
 INFO  09:52:19,480 | james.mailetcontext | JWMRemoteDelivery.deliver()
 InetAddress.getLocalHost().getHostName() - p2825577
 
 This is precisely what I expected to get.  BUT when the mail is
 sent, the p282 is sent in the HELO.
 
 It appears that javax.mail.Transport is ignoring the property (or not
 recognizing that it is set).  But I'm pretty certain that a bug that is
 that blatant would not be hanging around unreported in a base java class
 like Transport.  But, then again, that's what I appear to be seeing.
 
 Where am I going wrong?
 
 Secondarily, anybody know how I can change what java reports back on the
 InetAddress call other than changing the machine name?  Is there a JVM
 parameter I can pass in?  If I can force that, problem solved for me
 (although it's still not working correctly).
 
 Thanks again.
 
 Jerry
 
 
 
 -
 To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
 For additional commands, e-mail: server-user-h...@james.apache.org
 


-
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org



Re: James 3 b4 HELO Override Not Working? [unsigned]

2014-10-27 Thread Jerry Malcolm
The remoteDelivery mailet gets a session instance, and the session 
instance returns a geronimo 'transport' instance.  Not sure how it knows 
to find the class in the geronimo package.  But I did a 
transport.getClass().getPackage() in the mailet, and it returned the 
geronimo path.  So somehow it knows that geronimo is the provider.


Please email me the jar or post it where i can get it once you get it built.

Thank you so much!

Jerry


On 10/27/2014 12:56 PM, Robert Munn wrote:

Test build looks good. I have imported the geronimo code into Eclipse for 
editing.

I don’t see directly in the code where the geronimo javamail package is being 
called, but there are references to it in the file

james-karaf-features-3.0.0-beta5-SNAPSHOT-features.xml

 feature name=james-server-mailetcontainer-api 
version=3.0.0-beta5-SNAPSHOT
 
bundlemvn:org.apache.james/james-server-mailetcontainer-api/3.0.0-beta5-SNAPSHOT/bundle
 bundlemvn:org.apache.james/apache-mailet-api/2.5.1-SNAPSHOT/bundle
 
bundlemvn:org.apache.geronimo.javamail/geronimo-javamail_1.4_mail/1.8.3/bundle
 /feature


On Oct 27, 2014, at 9:09 AM, Bernd Waibel bwai...@intarsys.de wrote:


Hi Jerry

I am not using v3 but:

Could you try setting the parameter -Djava.mail.localhost=mail.jwmhosting.com 
in the java startup command line?

Most java.mail parameters are only parsed on startup by the vm.


Ciao.
Bernd



 Ursprüngliche Nachricht 
Von: Jerry Malcolm techst...@malcolms.com
Datum:
An: James Users List server-user@james.apache.org
Betreff: Re: James 3 b4 HELO Override Not Working?


More progress... But now I'm really stumped.  I dug into the
remoteDelivery mailet source.  I did confirm that James is NOT using the
smtpserver.xml 'hello' value at all for outbound HELO.  It is definitely
using the config parms for the remoteDelivery mailet.

In the mailet, the outbound HELO value is set by javax.mail.Transport
based on the 'mail.smtp.localhost' property passed in via the Properties
object.  According to the Transport javadoc, it says it'll use the
property value for HELO if it's set, and if it's not set, it'll use
InetAddress.getLocalHost().getHostName().  Fine.  So I cloned the mailet
so I could add log statements and do some debug.   I add two log
statements right above the 'transport.sendMessage()' call in the
RemoteDelivery mailet:

  log( JWMRemoteDelivery.deliver() mail.smtp.localhost -  +
props.getProperty( mail.smtp.localhost ));

  log( JWMRemoteDelivery.deliver()
InetAddress.getLocalHost().getHostName() -  +
InetAddress.getLocalHost().getHostName() );

   transport.sendMessage(message, addr);

In the log, I get

INFO  09:52:19,480 | james.mailetcontext | JWMRemoteDelivery.deliver()
mail.smtp.localhost - mail.jwmhosting.com

INFO  09:52:19,480 | james.mailetcontext | JWMRemoteDelivery.deliver()
InetAddress.getLocalHost().getHostName() - p2825577

This is precisely what I expected to get.  BUT when the mail is
sent, the p282 is sent in the HELO.

It appears that javax.mail.Transport is ignoring the property (or not
recognizing that it is set).  But I'm pretty certain that a bug that is
that blatant would not be hanging around unreported in a base java class
like Transport.  But, then again, that's what I appear to be seeing.

Where am I going wrong?

Secondarily, anybody know how I can change what java reports back on the
InetAddress call other than changing the machine name?  Is there a JVM
parameter I can pass in?  If I can force that, problem solved for me
(although it's still not working correctly).

Thanks again.

Jerry



-
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org





-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.5315 / Virus Database: 4189/8462 - Release Date: 10/27/14




-
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org