Skip to content

Commit

Permalink
add: support EHLO command and reply with enabled extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
TomFreudenberg committed Aug 1, 2015
1 parent 8c96d05 commit 082595f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/midi-smtp-server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,16 @@ def process_line(line)
Thread.current[:ctx][:server][:helo] = @cmd_data
# set sequence state as RSET
Thread.current[:cmd_sequence] = :CMD_RSET
# reply ok
return "250 OK"
# check whether to answer as HELO or EHLO
if line =~ /^EHLO/i
# reply supported extensions
return "250-8BITMIME\r\n" +
(@auth_mode != :AUTH_FORBIDDEN ? "250-AUTH LOGIN PLAIN\r\n" : "") +
"250 OK"
else
# reply ok only
return "250 OK"
end

when (/^AUTH(\s+)((LOGIN|PLAIN)(\s+[A-Z0-9=]+)?|CRAM-MD5)\s*$/i)
# AUTH
Expand Down

0 comments on commit 082595f

Please sign in to comment.