Question

How to forward email from my wordpress droplet

Posted December 11, 2021 150 views
WordPressEmailDigitalOcean Droplets

Initially when I created my wordpress droplet, I could click on reset password and I would receive an email within my gmail account which is configured as admin, this was without any email configuration on my part.

At some point I started strangely receiving emails that someone is triggering reset password to my wordpress account and when I subsequently would try and login I would find my password no longer worked so I would need to reset it. This is somewhat suspicious hence I’m thinking of adding 2 factor authentication to make my wordpress account more secure.

Unfortunately on the latest automatic triggered change of my password, I can no longer receive emails to my gmail account hence I can no longer login to my wordpress account. I’ve tried setting up postfix and configuring sendmail via /etc/hosts with my domain though no luck, within /var/log/mail.log I can see Service Unavailable errors which is a generic error.

I’m trying to avoid having to set up an email server, I just want to utilise the default functionality of the droplet as it had initially forwarded email though at some point regressed, maybe when I rebooted the droplet from the dashboard.

Does anyone have any thoughts on my email issues?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi @AbdulH,

My guess would be that you are still sending messages out successfully but e-mail provider is rejecting them.

I know you mentioned you followed a tutorial, I’ll suggest this one :

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-20-04

Additionally, another good suggestion would be to use a third-party e-mail provider which can be configured on your website to be used as SMTP host which is quite good. There are a lot of free ones which are good.

As for the password, I’ll recommend you to check out the wp-cli tool. It can help you with managing your WordPress installation from your Command-Line. You can check it out here :

https://wp-cli.org/

Hope this helps.

by finid
by Savic
Postfix is a mail transfer agent (MTA), an application used to send and receive email. It can be configured so that it can be used to send emails by local application only. In this tutorial, you'll install and configure Postfix on Ubuntu 20.04 as a send-only SMTP server. You'll also request free TLS certificates from Let's Encrypt for your domain and encrypt the outbound emails using them.
  • Thank you so much for recommending the WP Cli, seems like it would help me a lot in future if I come across this issue again.

    Strangely I just tried sending the reset password email and it worked this time without any changes since the last failure, after trying various options for a week seems like sendmail just seemed to work in the end.

    My /etc/hosts is configured as:

    127.0.0.1 localhost localhost.localdomain my_domain_and_hostname
    
    • Hi @AbdulH,

      I’m glad to hear you found wp-cli useful and you got to receive the messages.

      Having said that, I do strongly recommend trying and using SMTP rather than just sendmail with port 25 or using a third-party service. Using sendmail and port 25 tends to be unreliable as you’ve noticed.