On Fri, 10 Feb 2006, Allan Joergensen wrote:

On 10-Feb-2006, Charlie Brady wrote:

  $smtp->data();
  $rc = $smtp->code;
  #$message = $smtp->message;
  chomp($message);

Do you remember why you commented it out?

I have absolutely no idea :)

OK, I've worked out what's going on here. And I've found a number of problems.

The first problem is that $smtp->message is only emptied when Net::Cmd::command() is called, which is done during data(), but not during datasend() or dataend(). So when we call message() after dataend, we get the response to the 'data' command, as well as the response to the '.' which causes queueing. I guess what we can do here is to do a subtraction before sending back the response from the queuing of the message. That's what Allan was doing (crudely) previously.

The second problem is that Qpsmtpd::SMTP doesn't do the right thing with multiline responses from plugins. If a response has any embedded newlines, it should do a split on newlines before calling response().

run_hooks() allows plugins to return an array, but Qpsmtpd::SMTP discards all but the first item on the list, and therefore doesn't pass the array to response().

---
Charlie

Reply via email to