How to effectively read the Email Notifier settings

Hello,

I've developed a custom plugin that, among the other stuff, sends also an email periodically every week about a build status to a group of users. Unfortunately, I couldn't use the MessageSender interface because I needed to send HTML email (not just a plain text one), so I implemented a bit more powerful email sender on my own but here comes the problem. The problem is that for the email sending I would ideally like to use the email settings from the Email Notifier administration page. I've found out that the configuration is stored in ...\config\_notifications\email\email-config.xml file. That wouldn't really be a problem to read the XML file myself except the fact that the "email-password" attribute holds its value in a hashed format, so I cannot use it like that. Is there any chance how to get the real value from somewhere?

Thank you in advance for any help!
Cheers,
- Jan

3 comments
Comment actions Permalink

Hi Jan,

> I've developed a custom plugin that, among the other stuff, sends also an email periodically every week about a build status to a group of users.
Cool! Do you have any plans to open source it, or somehow make it available for other TeamCity users?

> Unfortunately, I couldn't use the MessageSender interface because I needed to send HTML email (not just a plain text one)
Yes, that's true. We could extend it to support more email options. Will it help?

> Is there any chance how to get the real value from somewhere?
Yes, use the jetbrains.buildServer.serverSide.crypt.EncryptUtil.unscramble() method.
In case of error, the password is the raw value.


--
Maxim

0
Comment actions Permalink

Hi Maxim,

> Cool! Do you have any plans to open source it, or somehow make it available for other TeamCity users?
I haven't thought about it but why not, there is nothing secret in my code.

> Yes, that's true. We could extend it to support more email options. Will it help?
It would definitely be useful at least for other users that may end up in the same situation.

And finally, thanks for the hint with the EncryptUtil class!

- Jan

0
Comment actions Permalink

Jan,

> I haven't thought about it but why not, there is nothing secret in my code.
Very good. If you send us the link to the plugin, we'll add it to the page:
http://confluence.jetbrains.com/display/TW/TeamCity+Plugins

> It would definitely be useful at least for other users that may end up in the same situation.
Got you.


--
Maxim

0

Please sign in to leave a comment.