smtp.1und1.com gives a double response to EHLO: (below wireshark
capture: look at No. 8, 10 and 11 !)
No. Time Source Destination
Protocol Info
4 0.027146 212.227.15.145 192.168.0.211
SMTP S: 220 smtp.1und1.com (mrbap2) Welcome to Nemesis ESMTP
server
No. Time Source Destination
Protocol Info
6 0.030640 192.168.0.211 212.227.15.145
SMTP C: ehlo mac.local
No. Time Source Destination
Protocol Info
8 0.047280 212.227.15.145 192.168.0.211
SMTP S: 250-smtp.1und1.com
No. Time Source Destination
Protocol Info
10 0.047687 192.168.0.211 212.227.15.145
SMTP C: mail from:v...@xyz.org
No. Time Source Destination
Protocol Info
11 0.061382 212.227.15.145 192.168.0.211
SMTP S: 250-STARTTLS | 250-AUTH LOGIN PLAIN | 250-AUTH=LOGIN PLAIN
| 250-PIPELINING | 250-SIZE 120000000 | 250 HELP
No. Time Source Destination
Protocol Info
13 0.079297 212.227.15.145 192.168.0.211
SMTP S: 250 OK
No. Time Source Destination
Protocol Info
14 0.079344 192.168.0.211 212.227.15.145
SMTP C: rcpt to:v...@xyz.org
No. Time Source Destination
Protocol Info
16 0.133750 192.168.0.211 212.227.15.145
SMTP C: Data
No. Time Source Destination
Protocol Info
18 2.091425 212.227.15.145 192.168.0.211
SMTP S: 550 must be authenticated
No. Time Source Destination
Protocol Info
20 2.091877 192.168.0.211 212.227.15.145
SMTP C: DATA fragment, 6 bytes
No. Time Source Destination
Protocol Info
21 2.103540 212.227.15.145 192.168.0.211
SMTP S: 554 No valid recipients
No. Time Source Destination
Protocol Info
24 2.115444 212.227.15.145 192.168.0.211
SMTP S: 250 OK
possible fast fix in the smtp_fsm module:
...
smtp_start({ehlo, Name}, _Pid, Info) ->
Msg = ["ehlo ", Name, "\r\n"],
ok = gen_tcp:send(Info#info.socket, Msg),
case get_response(Info#info.socket) of
{"250", Resp} ->
Tokens = string:tokens(Resp, "\r\n"),
Strs = [string:sub_string(X,5) || X <- Tokens],
NewInfo = Info#info{features = tl(Strs)},
case NewInfo#info.features of
[] -> get_info_reply(Info);
_ -> {reply, {ok, Resp}, smtp_conn, NewInfo}
end;
{_Code, Resp} ->
{reply, {ehlo_error, Resp}, smtp_start, Info};
Error ->
{stop, conn_error, {conn_error, Error}, []}
end.
%% added 15.04.2010 ===========================================
%% because smtp_fsm failed with smtp server smpt.1und1.com
get_info_reply(Info)->
case get_response(Info#info.socket) of
{"250", Resp} ->
Tokens = string:tokens(Resp, "\r\n"),
Strs = [string:sub_string(X,5) || X <- Tokens],
NewInfo = Info#info{features = tl(Strs)},
{reply, {ok, Resp}, smtp_conn, NewInfo};
{_Code, Resp} ->
{reply, {ehlo_error, Resp}, smtp_start, Info};
Error ->
{stop, conn_error, {conn_error, Error}, []}
end.
...