#haraka

/

      • _smf_ joined the channel
      • _smf_ has quit
      • busybox42 has quit
      • busybox42 joined the channel
      • lnb has quit
      • donspaulding joined the channel
      • busybox42 has quit
      • busybox42 joined the channel
      • busybox42 has quit
      • busybox42 joined the channel
      • busybox42 has quit
      • busybox42 joined the channel
      • dopesong joined the channel
      • lakki joined the channel
      • lakki has quit
      • _smf_ joined the channel
      • _smf_
        Morning
      • lakki joined the channel
      • _smf_ has quit
      • DoubleMalt joined the channel
      • dopesong joined the channel
      • dopesong joined the channel
      • _smf_ joined the channel
      • SynchroM joined the channel
      • vivek779 joined the channel
      • vivek779
        morning smfreegard
      • hello haraka team i have read the docs bt the plugins not doing anyhing i have created folder fro qmailqueue please have a look at a file tell me does it really send mail to qmail directory
      • dopesong has quit
      • dopesong joined the channel
      • dopesong joined the channel
      • vivek779 has quit
      • lakki has quit
      • dopesong joined the channel
      • donspaulding joined the channel
      • maerwald
        what's the easiest way to access the whole raw mail data (as string)? Do I have to fiddle with messagestream?
      • or just do header.toString and body.bodytext and then concatenate?
      • EyePulp joined the channel
      • dopesong joined the channel
      • baudehlo
        You don't have to "fiddle" with messagestream. It can give you the entire thing as a string.
      • messagestream.get_data(function (data) { ...
      • SynchroM has quit
      • SynchroM joined the channel
      • dopesong joined the channel
      • dopesong joined the channel
      • donspaulding joined the channel
      • maerwald
        baudehlo: "cannot pipe while currently piping"
      • if I do anything else than console.log, it just errors out
      • baudehlo
        It's currently piping. You can't do that.
      • maerwald
        so how is it useful then?
      • baudehlo
        It's useful if you do it in the right place.
      • Just don't do it there.
      • maerwald
        I need it as a string, as I said
      • not parts of it
      • baudehlo
        The problem is where you're trying to do it.
      • It's probably trying to deliver somewhere at the same time.
      • maerwald
        so it is fiddling...
      • baudehlo
        What hook are you doing it in?
      • maerwald
        data_post
      • baudehlo
        So maybe two things are trying to access it at once?
      • maerwald
        I don't think so
      • console.log works fine
      • but if I do anything else, then it errors out
      • baudehlo
        can we see the code?
      • maerwald
        well, I get the error regardless it seems
      • transaction.message_stream.get_data(function (data) { console.log(data); });
      • baudehlo
        Yeah you can't do that if there's a next() after it. The next() has to be INSIDE the callback.
      • maerwald
        that doesn't work for my use case, since that is a utility function
      • it doesn't happen in the haraka callback function
      • baudehlo
        It has to.
      • Otherwise it's going to try and pipe twice.
      • maerwald
        then it's not suitable for my use case
      • baudehlo
        Then there's no other way.
      • maerwald
        return body.header.header_list.join("") + "\n" + body.bodytext
      • works fine
      • baudehlo
        Because your transaction could have finished and messagestream emptied by the time you get to it.
      • bodytext isn't the contents of the mail though.
      • maerwald
        close enough
      • baudehlo
        It's likely to be "This is a multipart MIME message". If that's close enough for you, then you have weird requirements :)
      • ultimatt joined the channel
      • ultimatt has quit
      • dopesong joined the channel
      • dopesong joined the channel
      • ultimatt joined the channel
      • maerwald
        there's nothing weird about proof of concept
      • don't want to deal with too many details and if accessing the raw mail is made difficult in haraka, I'll just use that hack
      • DoubleMalt has quit
      • _smf_ has quit
      • _smf_1 joined the channel
      • _smf_1 is now known as _smf_
      • godsflaw_ joined the channel
      • baudehlo
        It's not made difficult, you just can't expect to read from disk blocking in node.
      • DoubleMalt joined the channel
      • godsflaw has quit
      • maerwald
        I don't want to read from disk. I want the raw mail body.
      • if that forces me to deal with the side effects of message_stream, then I'd say it is difficult
      • notkoos joined the channel
      • baudehlo
        the raw mail body may be on disk depending on whether it has been spooled or not.
      • That's the point.
      • If you *really* wanted a hacky way of doing it, in hook_data do: connection.client.on('data', function (data) { }) and just keep reading until data_post.
      • then use Buffer.concat() to create one big buffer.
      • maerwald
        Yeah, could be worth a try.
      • I wonder what's the best way to "transform" the current mail into another one. I currently manipulate the transaction object, which works, but I thought maybe it's cleaner to use outbound.send_email from within data_post hooks. If the outnext function passed to send_email does next(OK), then I assume the original mail will not get sent?
      • SynchroM has quit
      • _smf_ has quit
      • _smf_ joined the channel
      • davidj has quit
      • davidj joined the channel
      • dopesong joined the channel
      • DoubleMalt has quit
      • terbolous joined the channel
      • terbolous has quit
      • terbolous joined the channel
      • piklu joined the channel
      • piklu has quit
      • donspaulding has quit
      • ultimatt has quit