Revision: 218
http://svn.sourceforge.net/nmailserver/?rev=218&view=rev
Author: tmyroadctfig
Date: 2007-06-10 21:41:38 -0700 (Sun, 10 Jun 2007)
Log Message:
-----------
Fixed a minor defect in the SMTP client.
Modified Paths:
--------------
NMail/trunk/NMail.SmtpClient/SmtpClient.cs
Modified: NMail/trunk/NMail.SmtpClient/SmtpClient.cs
===================================================================
--- NMail/trunk/NMail.SmtpClient/SmtpClient.cs 2007-06-10 14:34:21 UTC (rev 217)
+++ NMail/trunk/NMail.SmtpClient/SmtpClient.cs 2007-06-11 04:41:38 UTC (rev 218)
@@ -294,10 +294,17 @@
return false;
}
+ bool acceptedRecipient = false;
+
foreach (SmtpMessageRecipient recipient in currentMessage.Recipients) {
this.connection.RcptTo(recipient.Address);
this.response = this.connection.GetResponse(this.config.TimeoutRcptTo);
+ // Send data if any single recipient is accepted
+ if (this.response.Type == DeliveryResultType.Success) {
+ acceptedRecipient = true;
+ }
+
RecipientDeliveryResult recipientResult = new RecipientDeliveryResult(
recipient,
this.response.Type,
@@ -306,10 +313,15 @@
currentResult.AddRecipientResult(recipientResult);
}
+ if (!acceptedRecipient) {
+ // Remote end rejected all our recipients!
+ return false;
+ }
+
// commence data
this.connection.Data();
-
- return true;
+ this.response = this.connection.GetResponse(this.config.TimeoutData);
+ return (this.response.Continue);
}
/// <summary>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|