To configure exim4 to use O2’s SMTP server for outbound mail:
(As root) edit /etc/exim4/passwd.client and add your O2 portal authentication credentials.
See ‘man exim4_passwd_client’ for how exim4 parses this file.
Note that smtp.o2.co.uk resolves to the IP address 18.104.22.168, but the reverse DNS for that IP address resolves to mail.o2.co.uk, so you will need to use that name in passwd.client.
The line in passwd.client should look something like this:
O2’s mail servers don’t support TLS so you will need to add the following line to /etc/exim4/exim4.conf.localmacros (just create the file if it doesn’t exist already)
AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS = true
This allows passwords to be sent over an insecure connection. It’s far from ideal but nothing can be done until O2 supports TLS.
Finally run ‘dpkg-reconfigure exim4-config’ to update the mail server configuration.
Select ‘mail sent by smarthost; received via SMTP or fetchmail‘ and when it asks for the smarthost address use smtp.o2.co.uk.
You should now be sending email using O2’s smarthost.
Check /var/log/exim4/mainlog when sending mail to confirm that everything is OK.