/go/forwardemail: forwardemail from the Command Line

Forward Email is an email service with an SMTP server for sending mail. /go/forwardemail connects one of your hosted domains to it, so that the domain's outgoing mail is sent through smtp.forwardemail.net and not directly from your server. This can help mail reach the inbox. In one run it: Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

/go/forwardemail example.com

Write down the SMTP Password it prints. It is shown only in the output of this command.

Arguments

Position Argument Required Notes
1 <domain> Yes A domain that is hosted on this server and has a zone in your Cloudflare account.

There is no all option. Run the command once for each domain. The domain is not checked before use, so always pass one.

What you need first

  • A Forward Email API token, saved in GoAdmio’s settings.
  • Your Cloudflare account ID and API token, saved in GoAdmio’s settings.
  • The domain added to Cloudflare. See dns.
  • curl and jq installed on the server.

Examples

# Connect a domain to Forward Email
/go/forwardemail example.com

# Check the DNS records that were added
dig +short TXT example.com
dig +short CNAME fe-bounces.example.com

# Review recent calls
tail /var/log/go/forwardemail.log

Output

SMTP Password: <the new password>

and the output of the cloudflare commands that add the DNS records.

Message Meaning
There is no Forward Email API Key No Forward Email token is saved. The command stops with status 1.
Cannot Get Cloudflare Zone ID for <domain>... The domain was not found in your Cloudflare account. The command stops with status 1.

The answers from Forward Email and Cloudflare are not shown, so a failed step does not print an error.

See the full reference at /go/forwardemail and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *