stupid sendmail question (did not issue MAIL/EXPN/VRFY/ETRN)

Duane Winner duanewinner at
Mon Apr 26 08:38:07 PDT 2004


Thanks for the reply.

You helped me in finding the problem is in my servlets (as opposed to 
sendmail). Sendmail is doing just what it should be doing, and as you 
oulined, if I connect via telnet and issue commands manually, I can get 
the expected output and send mail just as I should.
So the dim bulb over my head went off and thought maybe I should look at 
my Tomcat logs (duh)...and found this:

2004-04-26 10:16:04 StandardWrapperValve[invoker]: Servlet.service() for 
servlet invoker threw exception
java.lang.NoClassDefFoundError: javax/activation/DataSource
         at libraryServlet.sendEmail(
         at libraryServlet.do_replace_file(
         at libraryServlet.doPost(
         at javax.servlet.http.HttpServlet.service(
         at javax.servlet.http.HttpServlet.service(

I forgot to mention in my original post that I'm migrating from JRun to 
Tomcat (in addition to RedHat to FreeBSD), so apparantly that has 
something to with it as well.

I don't know if I'm missing a shared library or what -- I just copied 
over the jar files (including mail.jar) from the JRun server to Tomcat, 
hoping that would work. Apparantly I've got more work to do.

Thanks again,

Matthew Seaman wrote:

> On Fri, Apr 23, 2004 at 04:40:42PM -0400, Duane Winner wrote:
>>I am getting this in my /var/log/maillog:
>>Apr 23 15:23:39 library sm-mta[169]: i3NJNd8g000169: localhost 
>>[] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
> Which means that the Java side did not issue any SMTP commands after
> connecting and issuing an EHLO or HELO.  Which perhaps indicates that
> the sendmail side didn't respond with the expected
> ' Hello ...' and following list of capabilities in
> response.
> What do you see if you telnet to localhost port 25 and then type in an
> EHLO command? It should look something like this, although you
> probably won't have the AUTH or STARTTLS parts unless you've modified
> your sendmail:
>     % telnet localhost 25
>     Trying
>     Connected to localhost.
>     Escape character is '^]'.
>     220 ESMTP Sendmail 8.12.11/8.12.11; Sat, 24 Apr 2004 08:59:29 +0100 (BST)
>     EHLO localhost
> Hello localhost [], pleased to meet you
>     250-PIPELINING
>     250-8BITMIME
>     250-SIZE
>     250-DSN
>     250-ETRN
>     250-STARTTLS
>     250-DELIVERBY
>     250 HELP
>     quit
>     221 2.0.0 closing connection
>     Connection closed by foreign host.
> Nb. That sequence generates precisely the sort of log message you saw:
>     Apr 24 08:59:41 happy-idiot-talk sm-mta[8543]: i3O7xTra008543: localhost [] did not issue MAIL/EXPN/VRFY/ETRN during connection to IPv4
>>when my Tomcat serlvets attempt to send an email from my web app.
>>I only want sendmail listing on, and the web app is 
>>configured to use as it's mail server. It works fine on my Red 
>>Hat implementation, but I'm guessing FreeBSD sendmail is tightened up 
>>even more.
>>I know that sendmail is working, because I can use the 'mail' MUA and 
>>send myself a quick email.
>>I'm guessing this is a little different that just going #mail blahblah, 
>>because I'm doing mail relaying? But why would sendmail be denying mail 
>>relaying from itself (localhost).
>>Is this fairly simple to address? I know its probably stupid, but I 
>>haven't played with sendmail in about 3 years, and never completely 
>>understood then either.
> Hmmm... in server.xml I have:
>             <Resource name="mail/Session" auth="Container"
>                       type="javax.mail.Session"/>
>             <ResourceParams name="mail/Session">
>               <parameter>
>                 <name></name>
>                 <value></value>
>               </parameter>
>               <parameter>
>                 <name>mail.smtp.port</name>
>                 <value>587</value>
>               </parameter>
>             </ResourceParams>
> and in the per-application web.xml there is:
>     <resource-ref>
>         <res-ref-name>mail/Session</res-ref-name>
>         <res-type>javax.mail.Session</res-type>
>         <res-auth>Container</res-auth>
>     </resource-ref>
> and that seems to work very well.  This is from within a jail, and
> speaking to sendmail in the host environment, which is why it can't
> use a connection via localhost.  Port 587 is 'submission' -- the port
> designated for local submission on new messages by the MUA,
> distinguishing it from port 25 intended now for MTA to MTA transfer of
> messages.  However, that's a new standard that has not yet reached
> universal acceptance, so speaking on port 25 should work as well.
> 	Cheers,
> 	Matthew

More information about the freebsd-questions mailing list