Permalink
Browse files

Merge pull request #73 from garbetjie/master

Allowed persistence of custom properties when resetting envelope state.
  • Loading branch information...
2 parents 4bb8383 + b49b7ea commit 219b7854338ece49716a16657d2ee102b37b4286 @andris9 committed Feb 19, 2014
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/server.js
View
@@ -158,7 +158,13 @@ function SMTPServerConnection(server, client){
* @param {Boolean} [keepAuthData=false] If set to true keep authentication data
*/
SMTPServerConnection.prototype.init = function(keepAuthData){
- this.envelope = {from: "", to:[], date: new Date()};
+ if (this.envelope === undefined) {
+ this.envelope = {};
+ }
+
+ this.envelope.from = "";
+ this.envelope.to = [];
+ this.envelope.date = new Date();
if(this.hostNameAppearsAs){
this.envelope.host = this.hostNameAppearsAs;

0 comments on commit 219b785

Please sign in to comment.