Skip to content

Commit

Permalink
Update mailer configurations for Symfony mailer
Browse files Browse the repository at this point in the history
Newer Laravel uses Symfony mailer instead of SwiftMailer, and that means
that some configs and functionality have changed

In this change, we update config/mail.php with the new config layout and
name/functionality changes

of note:

* New configuration layout supporting lots of new/different mailers
* MAIL_DRIVER has become MAIL_MAILER, though we'll support both
* MAIL_ENCRYPTION is mostly useless, and we mark it as such -- symfony
  mailer detects which type of encryption to use automagically.
* MAIL_TLS_VERIFY_PEER is now available in case of self-signed
  certificates on the mail server, of if you want to access it by a
  different name, or by IP

Accordingly, we also update the .env examples, docker configs, and
the .env builder in the snipeit.sh installation script with the above
changes
  • Loading branch information
Jeremy Price committed Feb 29, 2024
1 parent 8f2843b commit 8ace30e
Show file tree
Hide file tree
Showing 12 changed files with 213 additions and 82 deletions.
4 changes: 2 additions & 2 deletions .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ DB_SSL_CIPHER=null
# --------------------------------------------
# REQUIRED: OUTGOING MAIL SERVER SETTINGS
# --------------------------------------------
MAIL_DRIVER=smtp
MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_TLS_VERIFY_PEER=true
[email protected]
MAIL_FROM_NAME='Snipe-IT'
[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .env.dusk.example
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ DB_SSL_CIPHER=null
# --------------------------------------------
# REQUIRED: OUTGOING MAIL SERVER SETTINGS
# --------------------------------------------
MAIL_DRIVER="log"
MAIL_MAILER="log"


# --------------------------------------------
Expand Down
10 changes: 7 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,21 @@ DB_SSL_CIPHER=null
# --------------------------------------------
# REQUIRED: OUTGOING MAIL SERVER SETTINGS
# --------------------------------------------
MAIL_DRIVER=smtp
MAIL_MAILER=smtp
MAIL_HOST=email-smtp.us-west-2.amazonaws.com
MAIL_PORT=587
MAIL_USERNAME=YOURUSERNAME
MAIL_PASSWORD=YOURPASSWORD
MAIL_ENCRYPTION=null
MAIL_FROM_ADDR=[email protected]
MAIL_FROM_NAME='Snipe-IT'
MAIL_REPLYTO_ADDR=[email protected]
MAIL_REPLYTO_NAME='Snipe-IT'
MAIL_AUTO_EMBED_METHOD='attachment'
MAIL_TLS_VERIFY_PEER=true

# MAIL_ENCRYPTION is no longer supported. SymfonyMailer will use tls if it's
# advertised, and won't if it's not. If you want to use your mail server's IP but it's failing
# because of certificate errors, set MAIL_TLS_VERIFY_PEER-true

# --------------------------------------------
# REQUIRED: IMAGE LIBRARY
Expand Down Expand Up @@ -190,4 +194,4 @@ ARGON_TIME=2
# OPTIONAL: SCIM
# --------------------------------------------
SCIM_TRACE=false
SCIM_STANDARDS_COMPLIANCE=false
SCIM_STANDARDS_COMPLIANCE=false
2 changes: 1 addition & 1 deletion .env.testing-ci
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DB_PASSWORD=null
# --------------------------------------------
# REQUIRED: OUTGOING MAIL SERVER SETTINGS
# --------------------------------------------
MAIL_DRIVER=log
MAIL_MAILER=log


# --------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion .env.tests
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ APP_KEY=base64:tu9NRh/a6+dCXBDGvg0Gv/0TcABnFsbT4AKxrr8mwQo=
LOGIN_MAX_ATTEMPTS=1000000
LOGIN_LOCKOUT_DURATION=100000000

MAIL_DRIVER=log
MAIL_MAILER=log
[email protected]
MAIL_FROM_NAME=Snipe-IT
2 changes: 1 addition & 1 deletion .env.unit-tests
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ APP_KEY=base64:tu9NRh/a6+dCXBDGvg0Gv/0TcABnFsbT4AKxrr8mwQo=
LOGIN_MAX_ATTEMPTS=1000000
LOGIN_LOCKOUT_DURATION=100000000

MAIL_DRIVER=log
MAIL_MAILER=log
[email protected]
MAIL_FROM_NAME=Snipe-IT
8 changes: 4 additions & 4 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"description": "The maximum number of search results that can be returned at one time.",
"value": "500"
},
"MAIL_DRIVER": {
"MAIL_MAILER": {
"description": "Mail driver - Generally SMTP on Heroku - https://snipe-it.readme.io/docs/configuration#required-outgoing-mail-settings",
"value": "smtp"
},
Expand All @@ -58,9 +58,9 @@
"description": "SMTP Server Password",
"value": "YOURPASSWORD"
},
"MAIL_ENCRYPTION": {
"description": "Encryption protocol for email sending.",
"value": "null"
"MAIL_TLS_VERIFY_PEER": {
"description": "Ensure validity of TLS certificate on remote mail server",
"value": true
},
"MAIL_FROM_ADDR": {
"description": "Email from address",
Expand Down
Loading

0 comments on commit 8ace30e

Please sign in to comment.