Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-445

Enforcement for HELO/EHLO commands before MAIL

    XMLWordPrintableJSON

Details

  • Improvement
  • Status: Closed
  • Minor
  • Resolution: Fixed
  • 2.2.0, 2.3.0
  • 2.3.0
  • SMTPServer
  • None

Description

From Norman Maurer:

Hi,

this is my first Patch so i hope its correct posted and made.. It patch
the MailCmdHandler to check if a HELO was provided..

So HELO should be provided as first command.. this is wrote down in the
RFC. So before accept MAIL FROM the HELO must provided..

Comments are welcome

bye
Norman

-----------------------------------------------

— MailCmdHandlerOLD.java 2006年02月17日 12:23:26.000000000 +0100
+++ MailCmdHandler.java 2006年02月17日 12:25:34.000000000 +0100
@@ -29,6 +29,8 @@
public class MailCmdHandler
extends AbstractLogEnabled
implements CommandHandler {
+
+ private final static String CURRENT_HELO_MODE = "CURRENT_HELO_MODE"; // HELO or EHLO

private final static String MAIL_OPTION_SIZE = "SIZE";

@@ -70,6 +72,9 @@

sender == null) { responseString = "501 "+DSNStatus.getStatus(DSNStatus.PERMANENT,DSNStatus.DELIVERY_INVALID_ARG)+" Usage: MAIL FROM:<sender>"; session.writeResponse(responseString); + }

else if (session.getState().containsKey(CURRENT_HELO_MODE) == false )

{ + responseString = "501 "+DSNStatus.getStatus(DSNStatus.PERMANENT,DSNStatus.DELIVERY_INVALID_ARG)+" HELO needed first"; + session.writeResponse(responseString); }

else {
sender = sender.trim();
// the next gt after the first lt ... AUTH may add more <>

Attachments

Activity

People

bago Stefano Bagnara
bago Stefano Bagnara
Votes:
0 Vote for this issue
Watchers:
0 Start watching this issue

Dates

Created:
Updated:
Resolved: