Permalink
Browse files

Merge pull request #243 from smfreegard/master

Reject commands containing non-ASCII characters
  • Loading branch information...
2 parents 9d3e430 + d00af8c commit 18206452d5d9f68e0fe0b9ae9424ffc21f99bb9c @baudehlo committed Sep 4, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 connection.js
View
@@ -167,6 +167,10 @@ Connection.prototype.process_line = function (line) {
var self = this;
if (this.state !== STATE_DATA) {
this.logprotocol("C: " + line + ' state=' + this.state);
+ // Check for non-ASCII characters
+ if (/[^\x00-\x7F]/.test(line)) {
+ return this.respond(501, 'Syntax error');
+ }
}
if (this.state === STATE_CMD) {
this.state = STATE_PAUSE_SMTP;

0 comments on commit 1820645

Please sign in to comment.