Exim with gmail as smarthost

I’ve been using exim with my google account to send email quite
successfully. I essentially followed the arch
It allows me to send mail from any of my machine on my local area
network through my server. This is quite convenient because a lot of
them run cron jobs, and it’s useful to a have an email relay server
running on the network. Comcast, my ISP, blocks smtp ports and so I
cannot run my own email server at home. So I setup an exim based relay
that accepts email from within my local area network and sends it using
my gmail address.

However, it stopped working without warning one day. My log
/var/log/exim/mainlog started being populated with messages like

    535-5.7.8 Username and Password not accepted. Learn more at
    535 5.7.8  https://support.google.com/mail/?p=BadCredentials v9sm11944329pfg.133 - gsmtp

This was apparently because I did not have two-factor authentication
enabled, and gmail had started flagging my application. So I enabled
two-factor authentication, and gave my it an app password. It started
working again.