Robust way to determine forum URL in a mail?

Have you tried looking at the List-ID: header?

It should look like this

List-ID: Discourse Meta <meta.discourse.org>