This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.hook_data = function (next, connection) { | |
| var me = this | |
| var txn = connection.transaction; | |
| connection.transaction.parse_body = 1; // enable mail body parsing | |
| txn.notes.attachment_count = 0; | |
| function start_attachment(connection, ctype, filename, body, stream) { | |
| var txn = connection.transaction; | |
| txn.notes.attachment_count++; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server.notes.getdomain = function(domain, callback){ | |
| callback(null) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async.waterfall([server.notes.getdomain(dest_domain)], function (err, domain) { | |
| if(err){ | |
| next(SOFTDENY ,'Error geting domain settings, please try again later') | |
| }else{ | |
| if(domain.receiving===1){ | |
| me.loginfo("ACCEPTING DOMAIN: "+dest_domain); | |
| next() | |
| }else{ | |
| me.loginfo("DENYING DOMAIN: "+dest_domain); | |
| next(DENY ,'Denied, not accepting mail here. fresh') |