Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/linux-china/dkim-spring-boot-starter
DKIM for spring-boot-starter-mail
https://github.com/linux-china/dkim-spring-boot-starter
dkim spring-boot
Last synced: 11 days ago
JSON representation
DKIM for spring-boot-starter-mail
- Host: GitHub
- URL: https://github.com/linux-china/dkim-spring-boot-starter
- Owner: linux-china
- Created: 2018-02-12T08:36:41.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-28T01:39:24.000Z (over 3 years ago)
- Last Synced: 2023-03-10T21:34:12.789Z (over 1 year ago)
- Topics: dkim, spring-boot
- Language: Java
- Size: 39.1 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
dkim-spring-boot-starter
========================
DKIM support for spring-boot-starter-mail.# Why DKIM?
Avoid your sent email in spam folder.
# How it works
* DKIMSigner to sign MimeMessage
* AOP @Before to interceptor JavaMailSender.send and sign MimeMessage before sending### How to use
* Add following dependency in your pom.xml:
````xml
org.mvnsearch.boot
dkim-spring-boot-starter
1.0.0-SNAPSHOT````
* in application.properties, add following configuration
```
dkim.signing-domain=demo.com
dkim.selector=default
dkim.privateKey=classpath:/rsa/demo.private.key.der
```
* User JavamailSender as usual because of AOP# How to generate DKIM key
a DKIM key setup:
There are test keys in the src/test/resources/rsa/ directory but be aware to use those only for your tests.
You need:
* a private key on your hard disc (e.g. in keys/); you can generate a new key by
```
openssl genrsa -out private.key.pem
```* DKIM for JavaMail needs the private key in DER format, you can transform a PEM key with openssl:
```
openssl pkcs8 -topk8 -nocrypt -in private.key.pem -out private.key.der -outform der
```
* a public key in your DNS; here is a sample resource record with selector "default": default._domainkey IN TXT "v=DKIM1; g=*; k=rsa; p=MIG...the_public_key_here...AQAB" (see http://www.ietf.org/rfc/rfc4871.txt for details)
You can use openssl to get a public key from the private key:
```
openssl rsa -inform PEM -in private.key.pem -pubout
```# References
* Mail Tester: https://www.mail-tester.com/
* DKIM: http://www.dkim.org/
* 28 Tips To Avoid Spam Filters When Doing Email Marketing: https://monk.webengage.com/how-to-avoid-spam-filters-when-sending-emails/
* DKIM for Java: https://github.com/globalbus/dkim
* Configuring and Managing SPF, DKIM, and DMARC: https://app.pluralsight.com/library/courses/configuring-managing-spf-dkim-dmarc/table-of-contents