gotthardp/rabbitmq-email

error happens when client send an attache file to SMTP server

hungkoala opened this issue · 3 comments

error log :

Connection (<0.1432.0>) closing: internal error in channel (<0.1438.0>): {badarg,
[{erlang,
iolist_size,
[[{<<"text">>,
<<"plain">>,
[{<<"Content-Type">>,
<<"text/plain; charset=utf-8">>},
{<<"Content-Transfer-Encoding">>,
<<"quoted-printable">>}],
[{<<"content-type-params">>,
[{<<"charset">>,
<<"utf-8">>}]},
{<<"disposition">>,
<<"inline">>},
{<<"disposition-params">>,
[]}],
<<"hung gui email cho ban kia.">>},
{<<"application">>,
<<"vnd.ms-excel">>,
[{<<"Content-Type">>,
<<"application/vnd.ms-excel; name=attached1.csv">>},
{<<"Content-Transfer-Encoding">>,
<<"base64">>},
{<<"Content-Disposition">>,
<<"attachment; filename=attached1.csv">>}],
[{<<"content-type-params">>,
[{<<"name">>,
<<"attached1.csv">>}]},
{<<"disposition">>,
<<"attachment">>},
{<<"disposition-params">>,
[{<<"filename">>,
<<"attached1.csv">>}]}],
<<"col1,col2,col3\r1,name 1,des 1\r2,name 2,des 2\r3,name 3,des 3">>}]],
[]},
{rabbit_basic,
msg_size,
1,
[]},
{rabbit_basic,
maybe_gc_large_msg,
1,
[]},
{rabbit_channel,
check_msg_size,
1,
[]},
{rabbit_channel,
handle_method,
3,
[]},
{rabbit_channel,
handle_cast,
2,
[]},
{gen_server2,
handle_msg,
2,
[]},
{proc_lib,
init_p_do_apply,
3,
[{file,
"proc_lib.erl"},
{line,
239}]}]}

=ERROR REPORT==== 10-Mar-2015::03:33:18 ===
** Generic server <0.1429.0> terminating
** Last message in was {'$gen_cast',stop}
** When Server state == {state,<0.1432.0>,<0.1438.0>,<<"reply-email-in">>}
** Reason for termination ==
** {noproc,{gen_server,call,[<0.1438.0>,{close,200,<<"Goodbye">>},infinity]}}

The multipart messages were not handled correctly. I fixed this crash, but I still doubt how multipart/mixed should be transferred to AMQP. Right now it's converted to application/mime and left as is.

I enhanced the body filtering functions. Would you be able to check the master branch?

Fixed by commit 4efc2b1.