[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    PATCH: Couple smtp kioslave problems
From:       Don Sanders <sanders () kde ! org>
Date:       2001-10-06 16:32:15
[Download RAW message or body]

I couldn't send mail with head using the smtp kioslave for
two reasons. Firstly the smtp slaved crashed because a 
memcpy was peformed with dest being a null pointer.

It seems the response from our mail server confused 
the slave.

220-lupinella.troll.no Zmailer ESMTP at Troll Tech.  No spam welcome.
220 Local time in Oslo, Norway is Sat, 6 Oct 2001 18:28:10 +0200.

I fixed that in the attached patch.

Secondly the FROM and RCPT lines sent to the server by the 
kioslave aren't delimited by < and >, my server doesn't like that much.

MAIL FROM: sanders@trolltech.com
501 5.1.7 where is <...> in that?

I fixed that locally in the patch applied but I'm not sure if that change is right (ie. 
I don't know if it will break things for other people). Have to check that before 
applying the patch. I think delimited with < and > complies with (and is
necessary according to?) RFC821.

Don.

["smtp.diff" (text/x-diff)]

Index: smtp.cc
===================================================================
RCS file: /home/kde/kdebase/kioslave/smtp/smtp.cc,v
retrieving revision 1.77
diff -u -u -b -r1.77 smtp.cc
--- smtp.cc	2001/10/04 18:59:35	1.77
+++ smtp.cc	2001/10/06 16:26:11
@@ -253,7 +253,8 @@
 			return;
 		}
 	}
-	from.prepend(ASCII("MAIL FROM: "));
+	from.prepend(ASCII("MAIL FROM: <"));
+	from.append(ASCII(">"));
 
 	if (!smtp_open())
 	        error(ERR_SERVICE_NOT_AVAILABLE, i18n("SMTPProtocol::smtp_open failed \
(%1)").arg(open_url.path())); @@ -345,7 +346,7 @@
 
 bool SMTPProtocol::PutRecipients (QStringList &list, const KURL &url)
 {
-	QString formatted_recip = ASCII("RCPT TO: %1");
+	QString formatted_recip = ASCII("RCPT TO: <%1>");
 	for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
 		if (!command(formatted_recip.arg(*it)))
 		{
@@ -413,8 +414,10 @@
 				buf[0] = buf[1] = buf[2] = buf[3] = ' ';
 		}
 		buf = origbuf;
+		if (r_len) {
 		memcpy(r_buf, buf, strlen(buf));
 		r_buf[r_len-1] = 0;
+		}
 		lastError = QCString(buf + 4, recv_len - 4);
 		return GetVal(buf);
 	} else {


_______________________________________________
Kmail Developers mailing list
Kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic