acharkizakaria / haraka-plugin-accounting-files

Haraka plugin that "Retrieve/Store/Archive" custom information of outbound traffic
MIT License
7 stars 7 forks source link

Plugin accounting-files failed: TypeError [ERR_INVALID_ARG_TYPE] #71

Open sebasanta opened 2 months ago

sebasanta commented 2 months ago

When starting Haraka with haraka-plugin-accounting-files installed I get this error: [CRIT] [-] [server] Plugin accounting-files failed: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined at Object.writeFileSync (node:fs:2350:5) at createFileIfNotExist (node_modules/haraka-plugin-accounting-files/index.js:393:12) at GenerateNewFile (node_modules/haraka-plugin-accounting-files/index.js:360:9) at exports.init_plugin (node_modules/haraka-plugin-accounting-files/index.js:75:5) at plugins.run_next_hook (node_modules/Haraka/plugins.js:518:28) at plugins.run_hooks (node_modules/Haraka/plugins.js:429:13) at Server.setup_smtp_listeners (node_modules/Haraka/server.js:459:14) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

I fixed this by changing line 393 of index.js from fs.writeFileSync(filename); to fs.writeFileSync(filename,'');