Skip to content

Instantly share code, notes, and snippets.

@vguerrerobosch
Last active October 24, 2022 16:39
Show Gist options
  • Save vguerrerobosch/b0fe1a89ea2887309436de53dfbc0da6 to your computer and use it in GitHub Desktop.
Save vguerrerobosch/b0fe1a89ea2887309436de53dfbc0da6 to your computer and use it in GitHub Desktop.
Configure Sendmail on Laravel Forge

Edit your hosts file

sudo nano /etc/hosts

and add your domain

127.0.0.1 domain.com www.domain.com
127.0.0.1 server.localdomain server
127.0.0.1 localhost

Then update the server hostname

sudo hostname domain.com

Add forge to the trusted users file

sudo nano /etc/mail/trusted-users

Edit submit.mc file

sudo nano /etc/mail/submit.mc

and add the following line

FEATURE(`use_ct_file')dnl

Please note, the first one is a backtick and the second one a single quote.

Finnally run

sudo sendmailconfig

and say Yes to everyting.

Send a test email with the following command:

echo -e "To: [email protected]\nSubject: Test\nHello World\n" | sendmail -bm -t -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment