diff --git a/calexium_lib/mail/send_mail.anubis b/calexium_lib/mail/send_mail.anubis index 619e1b3..112e404 100644 --- a/calexium_lib/mail/send_mail.anubis +++ b/calexium_lib/mail/send_mail.anubis @@ -361,8 +361,8 @@ public define SendContentResult timeout then if read_bytes(source, 65536) is { - failure then copy_error(so_far), - time_out then copy_error(so_far), + failure then logError(send_mail_log, "send_content: failed to read input data_io"); copy_error(so_far), + time_out then logError(send_mail_log, "send_content: timeout reading input data_io"); copy_error(so_far), success(buffer) then if sm_flush( buffer, weaken(target) ) is { @@ -412,22 +412,27 @@ define Reply_Result RWStream conn, List(Data_IO) mail_part ) = - //open the message file from the drive + with start_time = now, if sm_copy_Data_IO_List_to_Stream(mail_part, conn, 0) is { smtp_reply(reply) then reply copy_error(written) then + with finish_time = now, logError(send_mail_log, "send_content: error sending data"); + logTrace(send_mail_log, send_mail_mask, "send_content: "+written+" bytes sent in "+finish_time - start_time+" second(s)"); if written > 1024000 then logInfo(send_mail_log, "send_content: may be due to over sized mail. Convert it to 452 error."); reply(452, ["Error sending big email (more than 1 Mb)"]) else error, - copy_ok(_) then + copy_ok(size) then if reliable_write(tcp(conn), [crlf_dot_crlf]) is { failure then logError(send_mail_log, "send_content: error writing CRLF.CRLF"); error, - success(_) then receive_reply(conn) + success(_) then + with finish_time = (Int)now, + logTrace(send_mail_log, send_mail_mask, "mail sent "+size+" bytes in "+finish_time - start_time+" second(s)"); + receive_reply(conn) } }. -- libgit2 0.21.4