Skip to content

Instantly share code, notes, and snippets.

View baudehlo's full-sized avatar

Matt Sergeant baudehlo

View GitHub Profile
diff --git a/plugins/queue/smtp_proxy.js b/plugins/queue/smtp_proxy.js
index d79b8e8..cb7217e 100644
--- a/plugins/queue/smtp_proxy.js
+++ b/plugins/queue/smtp_proxy.js
@@ -140,6 +140,7 @@ exports.hook_mail = function (next, connection, params) {
var mail_from = params[0];
var data_marker = 0;
var smtp_proxy = _get_smtp_proxy(self, next, connection);
+ var dot_sent = false;
[PROTOCOL] [queue/smtp_proxy] Error: Drained at pluggableStream.<anonymous> (queue/smtp_proxy:311:26)
at pluggableStream.emit (events.js:81:20)
at CleartextStream.<anonymous> (/Users/matt/Perl/Haraka/tls_socket.js:59:14)
at CleartextStream.emit (events.js:61:17)
at CleartextStream._pull (tls.js:374:10)
at SecurePair._cycle (tls.js:558:20)
at CleartextStream.write (tls.js:97:13)
at pluggableStream.write (/Users/matt/Perl/Haraka/tls_socket.js:95:34)
at Object.send_data (queue/smtp_proxy:150:47)
at Plugin.hook_queue (queue/smtp_proxy:349:16)
@baudehlo
baudehlo / flow_control.js
Created October 19, 2011 19:16
flow control idea from MAAWG
var VERB = 'FLOW-CONTROL';
exports.hook_capabilities = function (next, connection) {
connection.capabilities.push(VERB);
next();
}
exports.hook_mail = function (next, connection) {
var delay = this.config.get('flow_control.delay_until');
if (delay) {
var fs = require('fs');
var log = fs.createWriteStream("/tmp/log.txt");
for (var i=0; i<15000; i++) {
var result = log.write(i + "\n", "utf8");
if (!result) {
console.log("buffer full...");
}
}
var ld = new (require('languagedetect'));
exports.hook_data = function (next, connection) {
// enable mail body parsing
connection.transaction.parse_body = true;
next();
}
exports.hook_data_post = function (next, connection) {
check_language(this, connection.transaction, connection.transaction.body);
dnsbl
data.nomsgid
data.noreceived
data.signatures
data.uribl
early_talker
graph
helo.checks
block_me
#mail_from.is_resolvable
var bodyText = "Test for chinese\n人民网10月20日电 (安国章) 据来自利比亚的消息,\n利比亚执政当局部队今天已经完全控制了卡扎菲的老家苏尔特,卡扎菲两腿受伤后被逮捕,已被送往医院。 据利比亚电视台报道,利比亚执政当局的部队今天清晨对卡 ...";
console.log("Char: " + bodyText[45] + ", charcode: " + bodyText.charCodeAt(45));
@baudehlo
baudehlo / charset.js
Created November 4, 2011 21:40
Cannot figure out why this isn't working.
var http = require('http');
var Iconv = require('iconv').Iconv;
var bt = require('buffertools');
var google = http.createClient(80, 'www.google.it');
var assert = require('assert');
var request = google.request('GET', '/',
{
'host': 'www.google.it',
'Accept-Charset': 'UTF-8',
tion(t) {
var transaction = createTransaction(postfixText);
var body = transaction.body;
t.equal(body.header.get_decoded("subject"), subjectText, "Check subject");
t.ok(body.bodytext, "Should have bodytext");
t.ok(body.bodytext.indexOf(wordForCheck) != -1, "Check word in body");
t.end();
});
matt@Valour ~/Perl/Haraka$ host yxxraoftpb.dyn.jazinga.net ns1.jazinga.net
Using domain server:
Name: ns1.jazinga.net
Address: 76.74.139.53#53
Aliases:
yxxraoftpb.dyn.jazinga.net has address 69.171.149.21
matt@Valour ~/Perl/Haraka$ host yxxraoftpb.dyn.jazinga.net ns2.rollernet.us
Using domain server:
Name: ns2.rollernet.us