You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Stefano Bagnara (JIRA)" <se...@james.apache.org> on 2006/03/01 11:00:47 UTC
[jira] Commented: (JAMES-445) Enforcement for HELO/EHLO commands
before MAIL
[ http://issues.apache.org/jira/browse/JAMES-445?page=comments#action_12368244 ]
Stefano Bagnara commented on JAMES-445:
---------------------------------------
The provided patch does not work.
If you try to send multiple mails in the same connection the second "MAIL FROM" fails because there is no HELO/EHLO.
I'm adding tests for this scenario and an hopefully complete patch.
> Enforcement for HELO/EHLO commands before MAIL
> ----------------------------------------------
>
> Key: JAMES-445
> URL: http://issues.apache.org/jira/browse/JAMES-445
> Project: James
> Type: Improvement
> Components: SMTPServer
> Versions: 2.3.0a1, 2.2.0
> Reporter: Stefano Bagnara
> Assignee: Stefano Bagnara
> Priority: Minor
>
> 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 <>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org