Permalink
Browse files

Add the message id in log

There is no message id in logfile so it's difficult to debug a message sent through qpsmtpd.
  • Loading branch information...
1 parent 0c41c01 commit 9f404f52bf11bb08c44160f2bb9a9fc9feb3e8c2 @tpoindessous tpoindessous committed Jan 24, 2014
Showing with 5 additions and 1 deletion.
  1. +5 −1 plugins/queue/smtp-forward
@@ -73,7 +73,11 @@ sub hook_queue {
or return (DECLINED, "Unable to queue message ($!)");
}
$smtp->dataend() or return (DECLINED, "Unable to queue message ($!)");
+ my $qid = $smtp->message();
+ my @list = split(' ', $qid);
+ $qid = pop(@list);
+
$smtp->quit() or return (DECLINED, "Unable to queue message ($!)");
$self->log(LOGINFO, "finished queueing");
- return (OK, "Queued!");
+ return (OK, "queued as $qid");
}

0 comments on commit 9f404f5

Please sign in to comment.