Trying to validate with mailjet, needs txt file or DNS entry

OK, so i am using mailjet for the smtp and am runnign into a problem with validation. Firstly i can’t validate the individual email noreply@discourse.example.com easily.

I’d rather validate the domain discourse.example.com instead, but here I run into two problems. I can do this with a special name text file but it appears that discourse does not allow this (though at this point I’m quite tempted to set up the nginx conf file to return something for that url). Fine, maybe the DNS TXT file? And here I run into trouble because I manage the domain example.com DNS and it’s trying to have me put in an entry for essentially mailjet.discourse.example.com which is a subdomain and I’m not clear on how to enter that. I am running bind 9.3 ish on ubuntu 16.04 and some pointers would be helpful? I can find info on how to add a TXT entry for discourse.example.com but mailjet says screw that crap it’s got to be mailjet_xxxxx.discourse.example.com, ie a subnet, which I think means extra zones. I am NOT a dns wizard tho i’m a fair hand at installing complex stuff.

But right now I’m so turned around from trying all kinds of things, so … help? I mean, the best news possible wd be for someone to say of course you can put a text file in discourse’s root directory like so… :frowning:

1 Like

Are you aware of your domain registrar or DNS manager?

You’ll have to create the DNS entry in the registrar provided DNS manager or if You use something like cloudflare, you’ll have to create DNS records there.

1 Like

Recently had this issue. Here’s what fixed it:

2 Likes

OK, I JUST GOT THE TXT VALIDATION METHOD TO WORK, even with Discourse’s “restrictions”. So, if you want to do that to avoid tinkering with DNS stuff (which, eeeeeeeeee… for me is much scarier than tinkering with a webserver, tho of course your mileage may vary).

You’ll need to be able to edit your nginx configuration file for your discourse install. Where exactly that is depends on where (and with what) you’ve installed your discourse. In my case, I did a baremetal install without docker. I can find it at /etc/nginx/conf.d/discourse.conf – your mileage may vary.

In that file will be a location block like so:

 location / {
     ....
 }

where there will be a number of internally nested location directives as well

create a new one, nested in here as well (but not nested in any other location!)

location /stupidfilename.txt {
   alias /var/www/stupidfilename.txt;
}

where stupidfilename.txt is whatever special name file they want you to add, and where the PATH
(/var/www ) is outside of the discourse stuff but accessible for urls in general on the server. What makes this work is that / is root for discourse so the url will look like it is under your discourse at http:/ /discourse.example.com/stupidfilename.txt (spaces added to disable bogus link)

so… place the file outside discourse, set up the location to alias to it and restart your nginx.

tada…

(I went back and edited this answer for readability etc since I marked it as my solution)

2 Likes

Creating a TXT record is a piece of cake compared to creating a file in Docker that’s publicly accessible.

1 Like