Create a Mailgun account.
When in dashboard, go to Send / SENDING / Domains menu and click Add new domain
:
Fill Domain name
and choose EU
, then click Add domain
.
Mailgun will then provide a serie of DNS entries to add to the domain name registrar; example below is OVH manager:
Back to the Mailgun domain settings, click Verify
to check status of the new records. Every entry should be Active
or Verified
:
Switch to the Sending keys
tab, click Add sending key
, type a name and click Create sending key
:
A mailgun private-api-key will be displayed only once and must be kept securely.
Edit Pixelfed settings in the terminal:
sudo nano /usr/share/webapps/pixelfed/.env
And change the underlined settings:
## Mail Configuration (Post-Installer) MAIL_DRIVER=mailgun MAIL_HOST=smtp.mailgun.org MAIL_PORT=587 MAIL_USERNAME=mg.fediverse.ovh MAIL_PASSWORD=private-api-key MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS="no-reply@mg.fediverse.ovh" MAIL_FROM_NAME="Pixelfed Demo"
Save and exit Nano.
Edit the file related to the E.U. localization:
sudo nano /usr/share/webapps/pixelfed/config/services.php
/* |-------------------------------------------------------------------------- | Third Party Services |-------------------------------------------------------------------------- | | This file is for storing the credentials for third party services such | as Stripe, Mailgun, SparkPost and others. This file provides a sane | default location for this type of information, allowing packages | to have a conventional place to find your various credentials. | */ 'mailgun' => [ 'domain' => env('mg.fediverse.ovh'), 'secret' => env('private-api-key'), 'endpoint' => 'api.eu.mailgun.net', 'scheme' => 'https', ],
Save and exit Nano.
Flush the cache:
sudo php /usr/share/webapps/pixelfed/artisan config:cache