Hiya Tellier,

So lately I’ve tried some things to apply DKIM and I finally making some 
progress.

First of all I apologize for the confusion, mainly because I still trying to 
figure things out how everything works (James , Mailet and Matcher and etc).

I just discovered that you just need to download the zip files from :  
https://james.apache.org/download.cgi#Apache_jDKIM and then extract the jar 
file inside the lib directory to james/lib to use ConvertTo7Bit and DKIMSign 
class. So that;s one problem solved.

Im guessing that since the tutorial ( 
https://james.apache.org/jdkim/mailets/index.html ) said that you must convert 
it to 7 bit and sign the DKIM right before the mail is sended, I need to find 
which mailet has the function to send the mail to put the DKIM and 7Bit Mailet 
before that sending mailet. To my surprise when you explain a bit about the 
matcher, I didn’t know that matcher has anything to do with the DKIM, so 
definitely gonna try to mess and read it when I had the time.
(After checking out the thread, I found this 
https://www.mail-archive.com/server-user@james.apache.org/msg11597.html to help 
me understand where to put it)

What I try for the mailet last time is putting these lines after the 
“RemoteDelivery” class mailet in processor state = “transport”, I will try to 
put it before the “RemoteDelivery” and post the result in reply.

<mailet match="All" class="org.apache.james.jdkim.mailets.ConvertTo7Bit">
</mailet>

<mailet match="All" class="org.apache.james.jdkim.mailets.DKIMSign">
    <signatureTemplate>v=1; s=selector; d=pc.107.jp; 
h=from:to:subject:received; a=rsa-sha256; bh=; b=; </signatureTemplate>
    <privateKey>
    -----BEGIN RSA PRIVATE KEY-----
        [Private Key Here in PEM Format]
    -----END RSA PRIVATE KEY-----
    </privateKey>
    <privateKeyPassword>
        testpassword
    </privateKeyPassword>
</mailet>

But when I try to run it, it produces some error Saying the cannot create the 
RSA Private key because bad decryption password : 
https://www.dropbox.com/s/b3gnc3894zn57fb/JamesError-CannotCreateRSAKey.txt?dl=0

I created the private key using Letsencrypt and the file type is pem. I copy 
paste the content into the <privateKey> just as the tutorial did, but maybe 
something wrong with my private key (I think? It works for my SMTP and IMAP 
server so I doubt that) can you/anyone tell me what causing this error?

Just a little more and I’ll be able to implement DKIM and SPF to my mail so 
finally google don’t take it as spam.

Last time I try to build with the mvn clean install ( Following this 
https://nozaki.me/roller/kyle/entry/configuring-james-to-sign-dkim ), the 
james-jdkim yield a lot of error since I never used maven myself, so I guess im 
gonna skip that one and try it some other time.

Lastly, thank you for the help and response, it give me some answer to the 
problem I had right now, I will probably reply to my own mail if I did found 
the solution or someone else.

Again, thank you for the help and sorry for any wrong word.

Sincerely, Jason

Sent from Mail for Windows 10

From: Tellier Benoit
Sent: 09 July 2019 21:54
To: server-user@james.apache.org
Subject: Re: Applying JDKIM and SPF to the Mailets

Hi Jason,

I will try to answer your questions:

1. I don't really understand the question.

You can use matcher to apply actions to emails matching certain
conditions. For instance, upon signing a mail for DKIM, you want to sign
it when the sender is local and authenticated, just before
RemoteDelivery. Combining `SenderIsLocal` with `SmtpAuthSuccessFull` and
the like will do the trick - while all incoming traffic from a non
trusted source needs to be DKIM validated. Again playing with matchers
within mailetcontainer.xml will be needed to do what you want.

2. I don't know the state of the DKIM status in JAMES Spring packaging.
Probably not working (version clashes).

No additional jar is required with Guice packaging.

3. What makes you believe this?

4. mvn clean install + look in target directories

Hope it helps.

Benoit

On 08/07/2019 05:30, Jason Tjankilisan wrote:
> Hi,
>  
> Sorry for the frequent asking but I just hit dead end with the DKIM config.
> https://james.apache.org/jdkim/mailets/index.html -> so I just read this as 
> my tutorial guidelines to apply DKIM to my mail. From what I understand, that 
> the mail needed to be converted to 7 bit before being Sign by DKIM and the 
> DKIM mailet has to be the last one. I guess I need to do DKIM so my mail has 
> less chance of getting into SPAM + request.
>  
> So I downloaded the James JDKIM from this one : 
> https://github.com/apache/james-jdkim
> And take the DKIMSign.java and ConvertTo7Bit.java and my 
> CustomMeiletTest.java (I need to use ANT cause request) and build those 3 
> using ANT so they become 1 jar file. But as expected, the file wont compile 
> because some missing files from james/lib (probably didn’t have JDKIM Library 
> from the start)
>
> So I download the library from here : 
> https://james.apache.org/download.cgi#Apache_jDKIM and I extract the 
> apache-jdkim-library-0.2.jar and apache-jdkim-mailets-0.2.jar from the /lib 
> and put it on james/lib/ and try to compile it. But it still missing some 
> library.
> I also downloaded this jar files http://www.badpenguin.co.uk/dkim/ and put it 
> on james/lib and nothing works also.
>
> For the SPF I there;s already one inside james/lib folder named : 
> apache-jspf-resolver-1.0.1.jar so I guess I don’t need to find for SPF 
> library and just use it in the mailetcontainer.xml as you mentioned it in the 
> last mail (haven’t tried since it since I didn’t found anything related how 
> to use the SPF, but will search more)
>
> So my question is :
> 1. How do I know what is the sending mailet and receiveing mailet? So I can 
> put the DKIMSign Mailet before the sending mailet. (Im guessing the
> 2. From the  https://james.apache.org/download.cgi#Apache_jDKIM, should I 
> also put the Javadoc, source sources also in james/lib?
> 3. Am I adding the wrong library or misunderstood the procedure of adding 
> DKIM and SPF mailets? I really need to know this so I can document this and 
> make a tutorial full from setting apache James to adding DKIM and SPF.
> 4. Should I really needed the https://github.com/apache/james-jdkim ? all of 
> it was a java files, and I don’t know how to turn all of them into 1 jar so I 
> can use as library I think?
>
> Im sorry for the lack of understanding and any wrong work, I hope it wasn’t 
> too much.
>
> thank you for the help.
>
> Sincerely, Jason
>
> Sent from Mail for Windows 10
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org




---
This email has been checked for viruses by AVG.
https://www.avg.com

Reply via email to