[cl-smtp-devel] Problem with boundary html message sending (connection reset by peer before "." (dot))

Pavel G. Koukoushkin k.pavel.g at gmail.com
Tue Jun 1 09:17:30 UTC 2010


Hi!

Sorry for my first fuzzy report.

It is not a bug. It is feature request.

Older versions of cl-smtp have this behavior:
when I set "Content-Type" external header to "text/html" simply
changes text/plain to text/html in header.
but now it adds second Content-Type header.

Right usage is to use :html-message key. But in this case result
message would be splitted and Content-Type is set to
"multipart/boundary". Here i got a problem. Our server CommunigatePro
5.3 seems to incorrectly handle such messages (it resets connection
after cl-smtp sends last boundary). I cant explain why server do this.

I think that the broblem have some suggestions
1. Right merging of extra-headers to default headers
(setting of "Content-Type" must change default "Content-Type"
2. Dirty hack - it is my patch. If we pass T to  :html-message  it
simply change default content-type header to "text/html"

 diff -crB cl-smtp/cl-smtp.lisp cl-smtp1/cl-smtp.lisp
*** cl-smtp/cl-smtp.lisp        2010-05-31 19:07:12.663849408 +0400
--- cl-smtp1/cl-smtp.lisp       2010-05-31 19:07:35.304850068 +0400
***************
*** 210,218 ****
             (html-boundary (if (and attachments html-message)
                                (make-random-boundary)
                                boundary))
             (content-type
!             (format nil "text/plain; charset=~S"
!                     (string-upcase (symbol-name external-format)))))
        (send-mail-headers stream
                           :from from
                           :to to
--- 210,225 ----
             (html-boundary (if (and attachments html-message)
                                (make-random-boundary)
                                boundary))
+                                        (html-message? (and (not
(stringp html-message))
+
                                                  html-message))
+                                        (html-message (if (not
(stringp html-message))
+
                                          nil
+
                                          html-message))
+
             (content-type
!             (format nil "text/~:[plain~:;html~]; charset=~S"
!
         html-message?
!                                     (string-upcase (symbol-name
external-format)))))
        (send-mail-headers stream
                           :from from
                           :to to



2010/5/31 Jan Idzikowski <jan.idzikowski at knowledgetools.de>:
> Hello Pavel,
>
> your bugreport is realy nonspecific,
> have you try to set the cl-smtp::*debug* to T,
> to see in wich message your server resets the connection?
>
> and sorry i don't have an access to a CommunigatePro mailserver.
>
> another question: do you use the latest version of cl-smtp?
> i have checked in a lot of changes for about 3 weeks.
>
> greetings
> Jan Idzikowski
>
>



-- 
С уважением, Кукушкин Павел.
Программист ООО "Ехать"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: html-message-key.patch
Type: text/x-patch
Size: 1298 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-smtp-devel/attachments/20100601/74c1fa90/attachment.bin>


More information about the cl-smtp-devel mailing list