Description
In C1, we define $platform_email['SMTP_UNIQUE_SENDER'] = 0;
by default in app/config/mail.conf.php.
This very old setting, or rather the fact it is disabled by default, has led us to confusing situations, as using one single e-mail to send from the Chamilo portal is the standard way today.
Initially, we tried to send e-mails in the name of the user triggering a notification, but this is definitely not the way things have worked out (with good reasons).
So for a new installation of C2, this "SMTP_UNIQUE_SENDER" setting can be removed and ignored (assumed to always be "on"). A new setting page during installation will ask for e-mail details:
- from_email (from $platform_email['SMTP_FROM_EMAIL'])
- from_name ($platform_email['SMTP_FROM_NAME'])
- mailer (mail/sendmail/smtp/others) ($platform_email['SMTP_MAILER'])
- host ($platform_email['SMTP_HOST'])
- port ($platform_email['SMTP_PORT'])
- authentication (yes or no) ($platform_email['SMTP_AUTH'])
- encryption (tls, ssl) (only used if authentication is yes) ($platform_email['SMTP_SECURE'])
- unique_reply_to (yes or no) ($platform_email['SMTP_UNIQUE_REPLY_TO'])
- charset (default = UTF-8) ($platform_email['SMTP_CHARSET'])
- debug (yes or no) ($platform_email['SMTP_DEBUG'])
This should come with a "test send" button (only if smtp was chosen) that will try to send an e-mail to you with the settings just entered on the form. If the mail
or sendmail
methods of mailer
have been chosen, don't offer the possibility to "test send", as this would be using the local server without any type of authentication (bad for SPAM).
For a migration, the "SMTP_UNIQUE_SENDER" setting should be ignored while migrating, and we should always consider the sending of e-mails to be done from a common e-mail account (a unique sender). The rest should be read from app/config/mail.conf.php if it exists before migration, and is should be injected into the corresponding variables for the configuration of e-mails in .env
(MAILER_DSN
or any .env setting, always starting with MAILER_
).
Hopefully this description is understandable.