nightcode/jmilter

Two Questions (BodyChunk and jmilter.netty Options)

Closed this issue · 5 comments

Hi,

i have two questions:

How can i set the different jmilter.netty options? Could you kindly provide a little example?


In the BodyCommandProcessor you are converting the bodychunk byte[] payload in a String with charset utf-8. Is it assured that the payload coming from the mail server is always utf-8 compatible?

Hi,

How can i set the different jmilter.netty options? Could you kindly provide a little example?

You can modify 'jmilter.netty.*' parameters in many ways: use the System.setProperty(key, value) method in your java code or set it on the command line using -Dkey=value syntax.

In the BodyCommandProcessor you are converting the bodychunk byte[] payload in a String with charset utf-8. Is it assured that the payload coming from the mail server is always utf-8 compatible?

No, you're right. This does not cover all cases. For better flexibility, method signature has been changed in the 0.5 release.

Thank you!

Thanks for your fast commit!

I have two additional questions:

Is the assumption right that every message has it own context in jmilter?

My other assumption was that you get one MilterHandler per Message, but apparently that's not the case. I tried to save the accumulated headers in a variable in my MilterHandler but got also headers from other received messages in it. Is there an easy way to extend the MilterContext so it can store for example all headers in it?

How does netty work with parallel connection? Does every connection get a own MilterHandler?

Thank you in advance!

Hi,

Is the assumption right that every message has it own context in jmilter?

If I understand your question correctly, yes, each message has its own context with a unique ID.

My other assumption was that you get one MilterHandler per Message, but apparently that's not the case. I tried to save the accumulated headers in a variable in my MilterHandler but got also headers from other received messages in it. Is there an easy way to extend the MilterContext so it can store for example all headers in it?

By design you only need one handler that can process all messages. For example, you can use any concurrent Map in your handler, where the "key" will be the ID from the MilterContext and the "value" will be your message holder, where you can accumulate all the necessary data from the MilterPackets.

Hi,

me again with one question:

How to stop processing the actual message without rejecting it. Is there a something like context.handler.abort or something?

@nightcode
As per your previous comment.

By design you only need one handler that can process all messages. For example, you can use any concurrent Map in your handler, where the "key" will be the ID from the MilterContext and the "value" will be your message holder, where you can accumulate all the necessary data from the MilterPackets.

Is there by chance, do we have complete email body stored in context/ packets ?
How can i fetch it ?