File tree Expand file tree Collapse file tree 6 files changed +7
-17
lines changed
Expand file tree Collapse file tree 6 files changed +7
-17
lines changed Original file line number Diff line number Diff line change 11NODE_ENV=development
2- SECURE=false
32IS_SILENT=false
43SMTP_PORT=25
54SMTP_SSL_KEY_PATH=
Original file line number Diff line number Diff line change 11NODE_ENV=
2- SECURE=
32IS_SILENT=
43SMTP_PORT=
54SMTP_SSL_KEY_PATH=
Original file line number Diff line number Diff line change 88 "instances" : " max" ,
99 "env_production" : {
1010 "NODE_ENV" : " production" ,
11- "IS_SILENT" : true ,
1211 "SMTP_PORT" : " 3025"
1312 }
1413 },
2019 "instances" : " max" ,
2120 "env_production" : {
2221 "NODE_ENV" : " production" ,
23- "IS_SILENT" : true ,
2422 "SMTP_PORT" : " 3465"
2523 }
2624 },
3230 "instances" : " max" ,
3331 "env_production" : {
3432 "NODE_ENV" : " production" ,
35- "IS_SILENT" : true ,
3633 "SMTP_PORT" : " 3587"
3734 }
3835 }
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const _ = require('lodash');
1111const addressParser = require ( 'nodemailer/lib/addressparser' ) ;
1212const arrayJoinConjunction = require ( 'array-join-conjunction' ) ;
1313const bytes = require ( 'bytes' ) ;
14- const dkimVerify = require ( 'python- dkim-verify ' ) ;
14+ const NodeDKIM = require ( 'dkim' ) ;
1515const dmarcParse = require ( 'dmarc-parse' ) ;
1616const dnsbl = require ( 'dnsbl' ) ;
1717const domains = require ( 'disposable-email-domains' ) ;
@@ -31,6 +31,8 @@ const { oneLine } = require('common-tags');
3131
3232let mailUtilities = require ( 'mailin/lib/mailUtilities.js' ) ;
3333
34+ const verifyDKIM = util . promisify ( NodeDKIM . verify ) . bind ( NodeDKIM ) ;
35+
3436const {
3537 CustomError,
3638 MessageSplitter,
@@ -811,8 +813,10 @@ class ForwardEmail {
811813
812814 async validateDKIM ( raw ) {
813815 try {
814- const result = await dkimVerify ( raw ) ;
815- return result ;
816+ const result = await verifyDKIM ( raw ) ;
817+ return (
818+ result && result . length > 0 && result . every ( record => record . verified )
819+ ) ;
816820 } catch ( err ) {
817821 logger . error ( err ) ;
818822 err . responseCode = 421 ;
Original file line number Diff line number Diff line change 4949 "parse-domain" : " ^2.3.4" ,
5050 "pino" : " ^5.14.0" ,
5151 "punycode" : " ^2.1.1" ,
52- "python-dkim-verify" : " ^0.0.3" ,
5352 "python-spfcheck2" : " ^0.0.4" ,
5453 "ratelimiter" : " ^3.4.0" ,
5554 "signale" : " ^1.4.0" ,
Original file line number Diff line number Diff line change @@ -7421,14 +7421,6 @@ punycode@^2.1.0, punycode@^2.1.1:
74217421 resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
74227422 integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
74237423
7424- python-dkim-verify@^0.0.3 :
7425- version "0.0.3"
7426- resolved "https://registry.yarnpkg.com/python-dkim-verify/-/python-dkim-verify-0.0.3.tgz#f4be4838e37ca68f57c85916eabbcc30e408ca8e"
7427- integrity sha512-CO7wHtQ4tztZ9qfR40NyRUqGwlHbyV4Pj9iYVKTeHz32zijZQDp3ZmM5f+Xx9KO8nv6qTEcP81kBqU1VoH3d6w==
7428- dependencies :
7429- semver "^6.3.0"
7430- shelljs "^0.8.3"
7431-
74327424python-spfcheck2@^0.0.4 :
74337425 version "0.0.4"
74347426 resolved "https://registry.yarnpkg.com/python-spfcheck2/-/python-spfcheck2-0.0.4.tgz#06b33c1105eb744ab955b63fee1927924c475f00"
You can’t perform that action at this time.
0 commit comments