Triplea: Email server migration

Created on 26 Aug 2019  路  16Comments  路  Source: triplea-game/triplea

Topic and Overview
Email server migration

Desired Outcome
I remebered that we still need to migrate the mail server for MARTI to the triplea-game.org domain, before tripleawarclub.org runs out again.
The only problem is figuring out what exactly needs to be changed: Maybe it's sufficient to change this line, but maybe there is another config file somewhere on the lobby server that needs to be changed too.

Tasks

  • [ ] Backport this feature to 1.9 to ensure people can still finish their PbEM/PbF games on 1.9, changing the hostname in the config file should be enough.
  • [x] Change this line and this line, so that the from email is [email protected] or something similar
  • [x] Change /etc/mailname and /etc/postfix/main.cf to use the triplea-game.org hostname, make sure to restart the server afterwards
  • [x] Deploy the changes to the warclub server
  • [ ] Once the domain runs out, remove /etc/nginx/sites-available/dice.tripleawarclub.org, /etc/nginx/sites-available/dice-staging.tripleawarclub.org, /etc/nginx/sites-available/tripleawarclub.org and the symlinks to those files in /etc/nginx/sites-enabled/. Then remove the tripleawarclub.org certificate used by all of those subdomain using the certbot tool. I don't know the exact procedure, but the tool has excellent documentation.

Most helpful comment

Ok, I did some digging and here's what I found:
I logged into the warclub server and tried using the sendmail commandline tool to send a message from "[email protected]" to my own email.
I got an email, however gmail showed this sort-of information tag:
Doesn't work, which indicates something isn't configured correctly.
This doesn't happen if the domain of the from address is tripleawarclub.org, so I tried searching for a config file where this hostname is being set.
I found out that sendmail (which is invoked by PHP) is actually just an interface for a local instance of a postfix SMTP server (after I found nothing searching through the sendmail configs).
So looking at the postfix config files I found 2 files with "tripleawarclub.org" mentioned in their config files:

  • /etc/mailname
  • /etc/postfix/main.cf

The first file contains nothing but the string tripleawarclub.org, changed that to triplea-game.org, restarted the server with sudo service postfix restart, and nothing changed.
The 2nd file looks more like a .properties file, and contained the following:

myhostname = tripleawarclub.org
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = tripleawarclub.org, localhost

Once I replaced those 2 strings with triplea-game.org and restarted the server again, I could send emails as [email protected] no problem, without the "warning" shown above.

So here's the list of tasks that need to be done to migrate away from the tripleawarclub.org domain:

  • [ ] Backport this feature to 1.9 to ensure people can still finish their PbEM/PbF games on 1.9, changing the hostname in the config file should be enough.
  • [x] Change this line and this line, so that the from email is [email protected] or something similar
  • [x] Change /etc/mailname and /etc/postfix/main.cf to use the triplea-game.org hostname, make sure to restart the server afterwards
  • [x] Deploy the changes to the warclub server
  • [ ] Once the domain runs out, remove /etc/nginx/sites-available/dice.tripleawarclub.org, /etc/nginx/sites-available/dice-staging.tripleawarclub.org, /etc/nginx/sites-available/tripleawarclub.org and the symlinks to those files in /etc/nginx/sites-enabled/. Then remove the tripleawarclub.org certificate used by all of those subdomain using the certbot tool. I don't know the exact procedure, but the tool has excellent documentation.

I don't have much time in the following days, so I'd appreciate if @DanVanAtta or @ron-murhammer could do some of the simpler steps (when it comes to PRs etc.) for me, I'll try to do the rest afterwards.

All 16 comments

Ok, I did some digging and here's what I found:
I logged into the warclub server and tried using the sendmail commandline tool to send a message from "[email protected]" to my own email.
I got an email, however gmail showed this sort-of information tag:
Doesn't work, which indicates something isn't configured correctly.
This doesn't happen if the domain of the from address is tripleawarclub.org, so I tried searching for a config file where this hostname is being set.
I found out that sendmail (which is invoked by PHP) is actually just an interface for a local instance of a postfix SMTP server (after I found nothing searching through the sendmail configs).
So looking at the postfix config files I found 2 files with "tripleawarclub.org" mentioned in their config files:

  • /etc/mailname
  • /etc/postfix/main.cf

The first file contains nothing but the string tripleawarclub.org, changed that to triplea-game.org, restarted the server with sudo service postfix restart, and nothing changed.
The 2nd file looks more like a .properties file, and contained the following:

myhostname = tripleawarclub.org
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = tripleawarclub.org, localhost

Once I replaced those 2 strings with triplea-game.org and restarted the server again, I could send emails as [email protected] no problem, without the "warning" shown above.

So here's the list of tasks that need to be done to migrate away from the tripleawarclub.org domain:

  • [ ] Backport this feature to 1.9 to ensure people can still finish their PbEM/PbF games on 1.9, changing the hostname in the config file should be enough.
  • [x] Change this line and this line, so that the from email is [email protected] or something similar
  • [x] Change /etc/mailname and /etc/postfix/main.cf to use the triplea-game.org hostname, make sure to restart the server afterwards
  • [x] Deploy the changes to the warclub server
  • [ ] Once the domain runs out, remove /etc/nginx/sites-available/dice.tripleawarclub.org, /etc/nginx/sites-available/dice-staging.tripleawarclub.org, /etc/nginx/sites-available/tripleawarclub.org and the symlinks to those files in /etc/nginx/sites-enabled/. Then remove the tripleawarclub.org certificate used by all of those subdomain using the certbot tool. I don't know the exact procedure, but the tool has excellent documentation.

I don't have much time in the following days, so I'd appreciate if @DanVanAtta or @ron-murhammer could do some of the simpler steps (when it comes to PRs etc.) for me, I'll try to do the rest afterwards.

FYI, the "new domains" are dice.marti.triplea-game.org and dice-staging.marti.triplea-game.org

Cool, @RoiEXLab , thanks.

What will players/users have to do once the change will have been implemented?

@panther2 If using 1.9, upgrade to the latest version of 1.9.
Otherwise nothing

@RoiEXLab Not 100% clear on if/how this would impact current 1.9 users. So right now we have these options in the dice server dropdown:
image

Are you saying we can just make changes to the dice server, so that the first option (dice.tripleawarclub.org) no longer uses the tripleawarclub.org domain?

@ron-murhammer Exactly, it's all just a properties file where we can change the hostname

@RoiEXLab Ok, how about the registering of your dice email? I believe right now the help text points people to "https://dice.tripleawarclub.org" to register their email address.

Good point, that would need updating.
Currently both domains are pointing to the same nginx instance, so all existing registrations will continue to work

@RoiEXLab Ok. In theory, I'd think we need to look at all the places where "tripleawarclub.org" exists so something like this: https://github.com/triplea-game/dice-server/search?q=%22tripleawarclub.org%22&unscoped_q=%22tripleawarclub.org%22

Ok everyone, I migrated the server.
We should be good to gow now.

We agreed to not backport this to 1.9 right? This means this ticket can be closed.

We need some sort of way to track the cleanup task once the domain really runs out. Not sure on how to achieve that though.

Bump @DanVanAtta @ron-murhammer
This issue is mostly done, only the question on how to track a follow-up in roughly a year remains

@RoiEXLab we only need to wait for the hard 2.0 cut-over? (Perhaps plus 3 or 4 weeks)

If so, a card on the 2.0 release train project could serve this purpose: https://github.com/triplea-game/triplea/projects/14

Good work @RoiEXLab getting these tasks knocked out.

we only need to wait for the hard 2.0 cut-over? (Perhaps plus 3 or 4 weeks)

I'd actually wait until the domain runs out. In order to give people that started a game in 1.9 can still finish it until then

@RoiEXLab would you mind creating a project to track the remaining steps of this initiative?

Was this page helpful?
0 / 5 - 0 ratings