MODX 2.8.4: Systememail with cert sign?


is it possible to sign all emails generated from modx with a email sign cert?


Thank you in advance.


Hi there, having that you can basically code anything you need, the short answer its yes, and it’ll depend on how are you sending the mail, if its from formIt, you coul use a prehook, but again, it basically depends on how are you implementing the mail sending, here you can find some info on signing mails from PHP Sending signed emails using PHP - Stack Overflow

prehooks run when rendering the form, so that’s not quite right. A normal hook that runs before the email hook is probably what you meant.

I’ve not personally seen people do this with MODX. Usually it’s just recommended to setup SPF, DKIM and DMARC headers to authorize the server, but email-level signing is something very different from that.

1 Like

oh, thank you for answers.

For own mailing I can sign my emails.

I want it for all systemmails for the login extra:
register, forgot_password, activation etc.
Send pw from manager.

I would be nice to implement this feature in the core.

any idea?

You could extend the modPhpMailer class, add the feature, and use your derived class to send the mail.

Or, you could fork the MODX Revolution project at GitHub, add the feature to the existing modPhpMailer class and submit a pull request to add it to the core code.

Thank you Bob.

I guess, if I extend modPhpMailer class, my system isn’t updateable?

or how could I use extended modPhpMailer class in Login Extra?

Good point. You could duplicate the Login package, rename the classes and snippet, and have them use your mail class, but that could be a pretty heavy lift.

Upgrading MODX wouldn’t affect you, and upgrading Login would have no affect, but you wouldn’t get any new Login features.

thank you Bob.

so, I think that is not the right way for me.

And my experience for fork MODX Rev at GitHub is too less.
So, I hope it would be a good idea for good extenting MODX for another people too.

I don’t know much about the process, but is there any chance you could do it in your email Tpl chunk? The Login and Registration extras allow you to use a custom Tpl chunk.

thank you Bob.

Oh, I think this wouldn’t be possible.

I want to digital sign the emails with certificate. I don’t know how it could be run with chunks?

Without modifieing the core I think it couldn’t be solved.