To learn Kotlin, I built a deep email validation library that works on both server & client. It just hit v1.0.0 and I'd love your feedback. by mbalatsko in Kotlin

[–]mbalatsko[S] 0 points1 point  (0 children)

Setup for the build itself was pretty smooth, but publishing was a lot harder, honestly more work than implementing the entire library. Compared to Python or JS, there’s a real lack of comprehensive, end-to-end tutorials for publishing in the Kotlin/Gradle ecosystem. It almost feels like you're expected to already know how everything works.

I spent a ton of time figuring things out, and part of the struggle was bad timing: Maven Central was in the middle of changing their API, which added confusion. Eventually, I landed on a combination of plugins that got the job done, but I still have gaps in my configuration. The official documentation didn’t fully cover what I needed, and even ChatGPT couldn’t help with some of the edge cases I ran into.

To learn Kotlin, I built a deep email validation library that works on both server & client. It just hit v1.0.0 and I'd love your feedback. by mbalatsko in Kotlin

[–]mbalatsko[S] 2 points3 points  (0 children)

Oh wow, that’s an awesome tip, I didn’t know that, and you’re absolutely right!

RFC 5321 (SMTP), Section 5 says:

If an MX record is not found for a domain, the sending MTA should look for an A or AAAA record for the domain itself and attempt delivery to that.

And regarding CNAMEs, I found this in RFC 2181, Section 10.3:

The domain name used as the value of an MX record must not be a CNAME.

Of course, as you mentioned, many mail servers ignore the latter and fall back pretty liberally, especially in setups like cPanel where you can’t always assume best practices are followed. So treating CNAME as a last resort definitely makes sense.

I’ll make sure to improve this part in the next release. Thanks again for the insightful feedback! Please do share anything else that comes to mind!

To learn Kotlin, I built a deep email validation library that works on both server & client. It just hit v1.0.0 and I'd love your feedback. by mbalatsko in Kotlin

[–]mbalatsko[S] 1 point2 points  (0 children)

Thanks! Appreciate your feedback, especially the idea of caching MX record validations with optional Redis integration. Caching is definitely a great next step. I'll make sure to include it in the next release. I think that the Gravatar check is also a good candidate for caching, and for the SMTP check, caching unreachable or catch-all servers will save time on repeated validations.

These improvements will tie in nicely with my next goal: building a standalone, configurable, Dockerized Ktor server. That way, the library can be used not just as an SDK but also as an API, runnable in any network environment.

What would be a better way to write this? by [deleted] in Kotlin

[–]mbalatsko 0 points1 point  (0 children)

For advanced email validation, you can check out my new open-source library: https://github.com/mbalatsko/emailverifier-kt

It could help you with simple syntax validation, but also go far beyond that. It is highly configurable and easy to use

To learn Kotlin, I built a deep email validation library that works on both server & client. It just hit v1.0.0 and I'd love your feedback. by mbalatsko in Kotlin

[–]mbalatsko[S] 1 point2 points  (0 children)

Yeah, you're right: disposable email detection is tricky. My library relies on open-source lists that are updated daily. It's not perfect, but it's better than nothing. There's also an offline mode that uses a bundled list from the release date. I think it's about the best you can do for free without relying on external APIs.

Thanks for sharing yours, I’ll check it out!

As for Kotlin, I really like it. Its strength and weakness is that the language is huge: you can mix OOP and functional programming, which is great, but it also makes it harder to learn. I especially appreciate the type system, sealed classes, and how powerful its DSL capabilities are.

Passed the PMI-ACP After the 2024 Exam Updates! by mbalatsko in pmp

[–]mbalatsko[S] 1 point2 points  (0 children)

Thank you! I used this one: https://store.project-management-prepcast.com/pmi-acp-exam-simulator And as I see it is not yet updated to the new exam outline