From k.pavel.g at gmail.com Tue Jun 1 09:17:30 2010 From: k.pavel.g at gmail.com (Pavel G. Koukoushkin) Date: Tue, 1 Jun 2010 13:17:30 +0400 Subject: [cl-smtp-devel] Problem with boundary html message sending (connection reset by peer before "." (dot)) In-Reply-To: <87r5ksc93y.wl%jan.idzikowski@knowledgetools.de> References: <87r5ksc93y.wl%jan.idzikowski@knowledgetools.de> Message-ID: 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 : > 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: From jan.idzikowski at knowledgetools.de Wed Jun 2 07:52:45 2010 From: jan.idzikowski at knowledgetools.de (Jan Idzikowski) Date: Wed, 02 Jun 2010 09:52:45 +0200 Subject: [cl-smtp-devel] Problem with boundary html message sending (connection reset by peer before "." (dot)) In-Reply-To: References: <87r5ksc93y.wl%jan.idzikowski@knowledgetools.de> Message-ID: <87pr09dg6q.wl%jan.idzikowski@knowledgetools.de> Hallo Pavel, if i understand you correctly, you want send emails only with html as body, is this right? i don't understand why you want to do this. have you ever test your smtp-server with receive mails from google mail? when you compose message in the google mail account you have the choice to use rich formatting, if you use the rich formatting, maybe make some words bold, then google mail would generate a multipart alternative message, with the plain/text part first and then the plain/html part, just like cl-smtp would do this. greetings Jan Idzikowski -- jan.idzikowski at knowledgetools.de From k.pavel.g at gmail.com Wed Jun 2 08:07:10 2010 From: k.pavel.g at gmail.com (Pavel G. Koukoushkin) Date: Wed, 2 Jun 2010 12:07:10 +0400 Subject: [cl-smtp-devel] Problem with boundary html message sending (connection reset by peer before "." (dot)) In-Reply-To: <87pr09dg6q.wl%jan.idzikowski@knowledgetools.de> References: <87r5ksc93y.wl%jan.idzikowski@knowledgetools.de> <87pr09dg6q.wl%jan.idzikowski@knowledgetools.de> Message-ID: Hi Jan! You are completely right. It is problem of a server application. But cl-stmp still has non-obvious behavior when we pass '(("Content-type" "text/html")) as a :extra-header. To my mind in this case "Content-Type" of the message must be changed. It solves my problem and it is right from the standpoint of evidence behavior. 2010/6/2 Jan Idzikowski : > Hallo Pavel, > > if i understand you correctly, you want send emails only with html as body, > is this right? > i don't understand why you want to do this. > have you ever test your smtp-server with receive mails from google mail? > when you compose message in the google mail account you have the choice > to use rich formatting, if you use the rich formatting, maybe make some > words bold, then google mail would generate a multipart alternative message, > with the plain/text part first and then the plain/html part, > just like cl-smtp would do this. > > greetings > Jan Idzikowski > > -- > jan.idzikowski at knowledgetools.de > -- ? ?????????, ???????? ?????. ??????????? ??? "?????" From jan.idzikowski at knowledgetools.de Mon Jun 21 09:13:44 2010 From: jan.idzikowski at knowledgetools.de (Jan Idzikowski) Date: Mon, 21 Jun 2010 11:13:44 +0200 Subject: [cl-smtp-devel] Problem with boundary html message sending (connection reset by peer before "." (dot)) In-Reply-To: References: <87r5ksc93y.wl%jan.idzikowski@knowledgetools.de> <87pr09dg6q.wl%jan.idzikowski@knowledgetools.de> Message-ID: <87k4ps929j.wl%jan.idzikowski@knowledgetools.de> Hello Pavel, i have corrected some errors in cl-smtp and i suspect that they have caused the error to your problems, too. It would be good if you could test the current code of cl-smtp. greetings Jan Idzikowski -- jan.idzikowski at knowledgetools.de