- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Error sending e-mails from Java - ehlo problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-14-2008 09:03 AM
тАО02-14-2008 09:03 AM
Error sending e-mails from Java - ehlo problem
Hello Everyone
So trying to send e-mail with Javamail 1.4ea I get the following on my prod server (this is in debug mode). I'm using HPUX 11.11
On Prod
DEBUG: setDebug: JavaMail version 1.4ea
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host "172.30.1.20", port 25, isSSL false
220 fandpmfg.com [ESMTP Server] service ready;ESMTP Server; 02/08/08 14:03:26
DEBUG SMTP: connected to host "172.30.1.20", port: 25
EHLO
501 Syntax error in parameters or arguments -
HELO
501 Syntax error in parameters or arguments -
javax.mail.MessagingException: 501 Syntax error in parameters or arguments -
On Demo my demo server
DEBUG: setDebug: JavaMail version 1.4ea
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host "172.30.1.20", port 25, isSSL false
220 fandpmfg.com [ESMTP Server] service ready;ESMTP Server; 02/08/08 14:05:16
DEBUG SMTP: connected to host "172.30.1.20", port: 25
EHLO demoglo
250-fandpmfg.com
250-SIZE 26214400
250-8BITMIME
250 STARTTLS
DEBUG SMTP: Found extension "SIZE", arg "26214400"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "STARTTLS", arg ""
DEBUG SMTP: use8bit false
The prod server is always doing my dns resolving... Any tips?
Thank you
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2008 12:09 AM
тАО02-15-2008 12:09 AM
Re: Error sending e-mails from Java - ehlo problem
Simple Mail Transfer Protocol RFCs stipulate use of HELO and EHLO.
Invalid usage of HELO/EHLO in the SMTP dialogue is your problem.
I used to own and run a Linix-based ISP,
so I dealt with these kind of issues
regularly :)
FQDN in the SMTP EHLO statement is enough to block close to 25% of incoming spam.
Most Mail Transfer Agents (MTAs)perform DNS
(A- and PTR- resource records) verification
on the domain name given on the SMTP HELO
and EHLO commands. This can violate RFC 2821,
so email is usually not rejected by default.
In other words, EHLO and HELO typically
require FQDN. Some examples for a properly
set MTA (same applies to HELO and EHLO):
Invalid HELO localhost
Invalid HELO 127.0.0.1
Valid HELO mydomain.dom
Valid HELO [127.0.0.1]
If you get an error message saying "Improper
HELO/EHLO", it is due to the connecting
computer or session not complying with the
SMTP standard. More specifically, it had an
invalid argument to the HELO-command. There
are several ways of getting this wrong.
RFC 2821, section 4.1.1.1 states:
A client MUST issue HELO or EHLO before
starting a mail transaction.
A mail transaction is started by the command
MAIL FROM.
I remember some Java applications at private hospital group that could not set the
EHLO/HELO properly. In the end, to help them, I devised a solution that used Procmail
filtering. Procmail was receiving email
from Java applications, then adding all appropriate headers and ensuring
SMTP standards, and finally forwarding
to external sites. I did it in 2002
and recently that company approached me
and said they still used the solution :)
I hope this helps,
VK2COT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2008 08:02 AM
тАО02-15-2008 08:02 AM
Re: Error sending e-mails from Java - ehlo problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2008 08:29 PM
тАО02-15-2008 08:29 PM
Re: Error sending e-mails from Java - ehlo problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2008 10:21 PM
тАО02-15-2008 10:21 PM
Re: Error sending e-mails from Java - ehlo problem
The problem is not on the HP-UX side. The
problem is your improperly set up Java
application.
Like everything in life, certain rules of
the engagement should be respected.
However, this is your private server and you
can by-pass all RFCs if you wish so :)
On internet, I can assure you that your
messages would be rejected on the spot.
Therefore, look at confPRIVACY_FLAGS in
sendmail.cf:
needmailhelo
needvrfyhelo
needexpnhelo
These three flags cause Sendmail to require a valid HELO/EHLO command from the client before accepting certain other commands.
Cheers,
VK2COT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2008 10:35 PM
тАО02-15-2008 10:35 PM
Re: Error sending e-mails from Java - ehlo problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-16-2008 12:30 AM
тАО02-16-2008 12:30 AM
Re: Error sending e-mails from Java - ehlo problem
When your JavaMail on the production server
is sending an email message, it tries to
connect to SMTP server at IP address
172.30.1.20 on port 25. It is duty of
JavaMail to introduce itself to the
SMTP gateway. In other words, in should
send "EHLO FQDN" firstly. The demo server
is doing it but the production one is not.
Cheers,
VK2COT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-16-2008 12:49 AM
тАО02-16-2008 12:49 AM
Re: Error sending e-mails from Java - ehlo problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-16-2008 10:47 PM
тАО02-16-2008 10:47 PM
Re: Error sending e-mails from Java - ehlo problem
Maybe check vendor's documentation and:
http://java.sun.com/products/javamail/FAQ.html
The FAQ says:
The SMTP provider uses the results of
InetAddress.getLocalHost().getHostName() in
the SMTP HELO command. If that call fails to
return any data, no name is sent in the
HELO/EHLO command. Check your JDK and name
server configuration to ensure that that
call returns the correct data. You may also
set the "mail.smtp.localhost" property to the
name you want to use for the HELO/EHLO
command.
In other words, something like:
Properties props = new Properties();
props.put("mail.smtp.host", args[0]);
props.put("mail.smtp.localhost", "mysrv.mydomain.dom");
mailSession = javax.mail.Session.getDefaultInstance(props, null);
...
Cheers,
VK2COT