Skip to content

Commit

Permalink
Properly enclose hmail when looping over them to deliver to multiple
Browse files Browse the repository at this point in the history
destinations.
Fixed temp failing to store the new filename after renaming.
  • Loading branch information
Matt Sergeant committed May 19, 2011
1 parent d6e8e36 commit 566c6de
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion plugins/queue/deliver.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@ exports.hook_queue = function (next, connection) {
else if (num_domains === 1) {
for (var i=0,l=hmails.length; i < l; i++) {
var hmail = hmails[i];
setTimeout(function () {self.send_email(hmail)}, 0);
setTimeout(function (h) {
return function () {
self.send_email(h)
}
}(hmail), 0);
}
next(code, msg);
}
Expand Down Expand Up @@ -666,6 +670,10 @@ exports.temp_fail = function (hmail) {
if (err) {
return plugin.bounce("Error re-queueing email: " + err, hmail);
}

hmail.path = path.join(this.queue_dir, new_filename);
hmail.filename = new_filename;

setTimeout(function () {plugin.send_email(hmail)}, delay);
});
}

0 comments on commit 566c6de

Please sign in to comment.