Skip to content

Commit

Permalink
fix: update imap composer for compiled types
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Nov 27, 2023
1 parent 55611b2 commit a8fbe83
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions imap-core/lib/imap-composer.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,17 @@ class IMAPComposer extends Transform {
);
}

this.push(compiled);
this.push('\r\n');
// <https://github.com/nodemailer/wildduck/issues/563>
// <https://github.com/nodemailer/wildduck/pull/564
if (typeof compiled === 'object') {
this.push(compiled);
this.push('\r\n');
} else if (typeof compiled === 'string') {
this.push(Buffer.from(compiled + '\r\n', 'binary'));
} else {
return done(new TypeError('"compiled" was not an object or string'));
}

done();
}

Expand Down

0 comments on commit a8fbe83

Please sign in to comment.