haraka / Haraka

A fast, highly extensible, and event driven SMTP server
https://haraka.github.io
MIT License
5.09k stars 661 forks source link

Invalid Characters in header #1389

Closed MLaudren closed 8 years ago

MLaudren commented 8 years ago

Haraka version

Haraka version 2.8.0-alpha.7 Haraka version 2.7.3

System setup

Latest Docker PEPS build

Expected behavior

Handle all characters inside header without error

Observed behavior

Error while receiving mail sent using gmail.

Error section : [CRIT] [-] [core] TypeError: The header content contains invalid characters [CRIT] [-] [core] at ClientRequest.OutgoingMessage.setHeader (http.js:733:13) [CRIT] [-] [core] at new ClientRequest (http.js:1429:14) [CRIT] [-] [core] at Object.exports.request (http.js:1899:10) [CRIT] [-] [core] at Request.start (/usr/local/haraka/node_modules/request/index.js:603:30) [CRIT] [-] [core] at Request.write (/usr/local/haraka/node_modules/request/index.js:1226:28) [CRIT] [-] [core] at MessageStream.ondata (stream.js:51:26) [CRIT] [-] [core] at MessageStream.emit (events.js:95:17) [CRIT] [-] [core] at ChunkEmitter. (/usr/lib/node_modules/Haraka/messagestream.js:352:18) [CRIT] [-] [core] at ChunkEmitter.emit (events.js:95:17) [CRIT] [-] [core] at ChunkEmitter.end (/usr/lib/node_modules/Haraka/chunkemitter.js:92:14)

Steps to reproduce

Start PEPS dockers : https://github.com/MLstate/PEPS Send a mail using gmail to an account inside PEPS

baudehlo commented 8 years ago

What plugins are you using? This is an error from the request module, which none of our core code use.

On Mon, Mar 21, 2016 at 6:29 PM, MLaudren notifications@github.com wrote:

Haraka version

Haraka version 2.8.0-alpha.7 Haraka version 2.7.3 System setup

Latest Docker PEPS build Expected behavior

Handle all characters inside header without error Observed behavior

Error while receiving mail sent using gmail.

Error section : [CRIT] [-] [core] TypeError: The header content contains invalid characters [CRIT] [-] [core] at ClientRequest.OutgoingMessage.setHeader (http.js:733:13) [CRIT] [-] [core] at new ClientRequest (http.js:1429:14) [CRIT] [-] [core] at Object.exports.request (http.js:1899:10) [CRIT] [-] [core] at Request.start (/usr/local/haraka/node_modules/request/index.js:603:30) [CRIT] [-] [core] at Request.write (/usr/local/haraka/node_modules/request/index.js:1226:28) [CRIT] [-] [core] at MessageStream.ondata (stream.js:51:26) [CRIT] [-] [core] at MessageStream.emit (events.js:95:17) [CRIT] [-] [core] at ChunkEmitter. (/usr/lib/node_modules/Haraka/messagestream.js:352:18) [CRIT] [-] [core] at ChunkEmitter.emit (events.js:95:17) [CRIT] [-] [core] at ChunkEmitter.end (/usr/lib/node_modules/Haraka/chunkemitter.js:92:14) Steps to reproduce

Start PEPS dockers : https://github.com/MLstate/PEPS Send a mail using gmail to an account inside PEPS

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/haraka/Haraka/issues/1389

MLaudren commented 8 years ago

Hi, Thanks for you help.

The setup was all done inside PEPS.

Don't know which are standard or not. Here is all plugin I have (haraka -l)

*global plugins/ access aliases attachment avg backscatterer block_me bounce clamd connect.asn connect.fcrdns connect.geoip connect.p0f connect.rdns_access daemonize data.headers data.nomsgid data.noreceived data.rfc5322_header_checks data.signatures data.uribl dcc delay_deny dkim_sign dkim_verify dns_list_base dnsbl dnswl early_talker esets graph greylist helo.checks karma limit log.elasticsearch log.syslog lookup_rdns.strict mail_from.access mail_from.blocklist mail_from.is_resolvable mail_from.nobounces max_unrecognized_commands messagesniffer prevent_credential_leaks process_title profile rate_limit rcpt_to.access rcpt_to.blocklist rcpt_to.host_list_base rcpt_to.in_host_list rcpt_to.ldap rcpt_to.max_count rcpt_to.qmail_deliverable rcpt_to.routes rdns.regexp record_envelope_addresses redis relay relay_acl relay_all relay_force_routing reseed_rng rspamd spamassassin spf tarpit test_queue tls toobusy xclient

plugins/auth/ auth_base auth_ldap auth_proxy auth_vpopmaild flat_file

plugins/queue/ deliver discard lmtp qmail-queue quarantine rabbitmq rabbitmq_amqplib smtp_forward smtp_proxy

plugins/watch/ index

plugins/watch/html/ client jquery.tipsy

baudehlo commented 8 years ago

Can you show the output from haraka -o instead? It's much more informative.

MLaudren commented 8 years ago

You'll find it in the file attach. I also extract the full log so maybe you'll find useful data in it.

haraka -o.txt

line: 262: [DEBUG] [12CDBE09-7037-4F52-8B0E-B39BF0E1652B.1] [core] running data_post hooks [DEBUG] [12CDBE09-7037-4F52-8B0E-B39BF0E1652B.1] [core] running data_post hook in access plugin line 284 (just before the error): [DEBUG] [12CDBE09-7037-4F52-8B0E-B39BF0E1652B.1] [core] running data_post hook in smtpin plugin haraka-full.txt

Look like the error is from smtpin plugin during the post_data processing?

baudehlo commented 8 years ago

Right. That's not one of our core plugins, so we can't fix it.

MLaudren commented 8 years ago

Thanks for you support. I'll try to find the good place to report it than.