mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-08 17:07:44 +08:00
Updated logger
This commit is contained in:
parent
ba2a57e670
commit
5532071fc5
1 changed files with 17 additions and 4 deletions
|
@ -101,7 +101,10 @@ class IMAPCommand {
|
||||||
// Deny all literals bigger than maxMessage
|
// Deny all literals bigger than maxMessage
|
||||||
command.expecting > maxAllowed) {
|
command.expecting > maxAllowed) {
|
||||||
|
|
||||||
this.connection._server.logger.debug('[%s] C:', this.connection.id, this.payload);
|
this.connection._server.logger.debug({
|
||||||
|
tnx: 'client',
|
||||||
|
cid: this.connection.id
|
||||||
|
}, '[%s] C:', this.connection.id, this.payload);
|
||||||
|
|
||||||
this.payload = ''; // reset payload
|
this.payload = ''; // reset payload
|
||||||
|
|
||||||
|
@ -150,14 +153,21 @@ class IMAPCommand {
|
||||||
|
|
||||||
// check if the payload needs to be directod to a preset handler
|
// check if the payload needs to be directod to a preset handler
|
||||||
if (typeof this.connection._nextHandler === 'function') {
|
if (typeof this.connection._nextHandler === 'function') {
|
||||||
this.connection._server.logger.debug('[%s] C: <%s bytes of data>', this.connection.id, this.payload && this.payload.length || 0);
|
this.connection._server.logger.debug({
|
||||||
|
tnx: 'client',
|
||||||
|
cid: this.connection.id
|
||||||
|
}, '[%s] C: <%s bytes of data>', this.connection.id, this.payload && this.payload.length || 0);
|
||||||
return this.connection._nextHandler(this.payload, next);
|
return this.connection._nextHandler(this.payload, next);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.parsed = imapHandler.parser(this.payload);
|
this.parsed = imapHandler.parser(this.payload);
|
||||||
} catch (E) {
|
} catch (E) {
|
||||||
this.connection._server.logger.debug('[%s] C:', this.connection.id, this.payload);
|
this.connection._server.logger.debug({
|
||||||
|
err: E,
|
||||||
|
tnx: 'client',
|
||||||
|
cid: this.connection.id
|
||||||
|
}, '[%s] C:', this.connection.id, this.payload);
|
||||||
this.connection.send(this.tag + ' BAD ' + E.message);
|
this.connection.send(this.tag + ' BAD ' + E.message);
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
@ -172,7 +182,10 @@ class IMAPCommand {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.connection._server.logger.debug('[%s] C:', this.connection.id, imapHandler.compiler(this.parsed, false, true));
|
this.connection._server.logger.debug({
|
||||||
|
tnx: 'client',
|
||||||
|
cid: this.connection.id
|
||||||
|
}, '[%s] C:', this.connection.id, imapHandler.compiler(this.parsed, false, true));
|
||||||
|
|
||||||
this.validateCommand(this.parsed, handler, err => {
|
this.validateCommand(this.parsed, handler, err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
Loading…
Reference in a new issue