Skip to content

Implemented: Add DKIM signing for outgoing SMTP mail (OFBIZ-13488) - #1612

Open
mridulpathak wants to merge 1 commit into
apache:trunkfrom
mridulpathak:OFBIZ-13488
Open

Implemented: Add DKIM signing for outgoing SMTP mail (OFBIZ-13488)#1612
mridulpathak wants to merge 1 commit into
apache:trunkfrom
mridulpathak:OFBIZ-13488

Conversation

@mridulpathak

Copy link
Copy Markdown
Contributor

OFBiz's outgoing mail (EmailServices.sendMail) was never cryptographically signed, so receiving mail servers had no way to verify a message actually came from the sending domain. This adds DKIM (RFC 6376) signing via org.simplejavamail:utils-mail-dkim, hooked in right before the transport's sendMessage call. Signing config lives in a new MailDkimConfig entity (domain, selector, PKCS#8 PEM private key, enabled flag), encrypted at rest. Signing fails open on config/key errors -- a missing or invalid config sends the message unsigned rather than blocking mail. A companion getDkimDnsRecord service derives the DNS TXT record value an admin needs to publish, from the same stored key.

OFBiz's outgoing mail (EmailServices.sendMail) was never cryptographically signed, so receiving mail servers had no way to verify a message actually came from the sending domain. This adds DKIM (RFC 6376) signing via org.simplejavamail:utils-mail-dkim, hooked in right before the transport's sendMessage call -- the one place a message is finalized and handed to the wire.

Signing config (domain, selector, PKCS#8 PEM private key, enabled flag) lives in a new MailDkimConfig entity, encrypted at rest, resolved inline in EmailServices (no separate resolver class, matching its existing style). Signing fails open for config/key errors -- a missing or invalid MailDkimConfig logs an error and sends the message unsigned rather than blocking mail -- though a write-time signing failure inside the transport's own send call still blocks the send, now with an accurate log message instead of a misleading connection-error one. A companion getDkimDnsRecord service derives the DNS TXT record value an admin needs to publish, from the same stored key, to avoid hand-computing the DKIM public key.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant