-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdkim_instructions.txt
37 lines (27 loc) · 1.44 KB
/
dkim_instructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
These are the instructions I followed to ensure the DKIM (for preventing emails being flagged as SPAM) setup worked for this system.
First, install the relevant module: "npm install nodemailer-dkim -save"
Doco: https://github.com/andris9/nodemailer-dkim
Generating the public and private keys
======================================
using openSSH I then generated a private key:
openssl genrsa -out default.squareevents.org.pem 1024 -outform PEM
I then generated a public key:
openssl rsa -in default.squareevents.org.pem -out dkim-public.pem -pubout -outform PEM
I then placed default.squareevents.org.pem into the chromis project folder.
The data in the dkim-public.pem file looked a bit like this:
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCj9m6YIyEcdrC4iH86xRWnKyRl
Q/TrK737UKDpbcVQOflYUpsLTaiWjxCNzM//DliX4s3pLBf84QuLXD/n/l6hVeAx
Wr32Ba9Ib+xmmK+S0rgqMdwev35+Ei3ImYccADLxkO1IRA1MrwjU++jRkL85ofW7
K0IkWniV3Z4H3S5UXwIDAQAB
-----END PUBLIC KEY-----
So I pasted the relevant bit into a TXT record in the DNS like this:
v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCj9m6YIyEcdrC4iH86xRWnKyRl
Q/TrK737UKDpbcVQOflYUpsLTaiWjxCNzM//DliX4s3pLBf84QuLXD/n/l6hVeAx
Wr32Ba9Ib+xmmK+S0rgqMdwev35+Ei3ImYccADLxkO1IRA1MrwjU++jRkL85ofW7
K0IkWniV3Z4H3S5UXwIDAQAB
for default._domainkey.squareevents.org
The code itself
===============
I then create my own transporter to use the DKIM plug-in:
See api/services/Email.js for code