Skip to content

Commit

Permalink
passing test for sequence messages
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Dec 16, 2011
1 parent 08dda46 commit db92b3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/client/proto.js
Expand Up @@ -82,11 +82,11 @@ module.exports = function (domain, stream) {
});
}
else if (cmd.name === 'data') {
if (!req.to) {
if (!req.from) {
write(503, 'Bad sequence: MAIL expected');
next();
}
else if (!req.from) {
else if (!req.to) {
write(503, 'Bad sequence: RCPT expected');
next();
}
Expand Down
5 changes: 3 additions & 2 deletions test/sequence.js
Expand Up @@ -87,11 +87,12 @@ function sendData (t, mail) {
.seq(function () {
mail.from('beep@localhost', this);
})
.seq(function (next) {
.seq_(function (next) {
mail.data(function (err, code, lines) {
t.ok(err);
t.ok(!err);
t.equal(code, 503);
t.equal(lines.join(''), 'Bad sequence: RCPT expected');
next();
})
})
.seq(function () {
Expand Down

0 comments on commit db92b3a

Please sign in to comment.