giocomai / omeka-s-docker

A docker image for Omeka S - does not include either modules or themes, just Omeka itself
https://hub.docker.com/r/giocomai/omeka-s-docker
GNU General Public License v3.0
12 stars 4 forks source link

Unable to send mail #4

Closed MaxiReglisse closed 1 year ago

MaxiReglisse commented 1 year ago

Hi Giorgio,

I couldn't find where to configure the SMTP server for the Omeka-S application in the Docker composition. So I'm not surprised that sending the message fails... This is particularly the case when creating a new user.

Laminas\Mail\Transport\Exception\RuntimeException
Unable to send mail: Unknown error
Details:
Laminas\Mail\Transport\Exception\RuntimeException: Unable to send mail: Unknown error in /var/www/html/vendor/laminas/laminas-mail/src/Transport/Sendmail.php:298

Thank you in advance for any help.

Ernest.

MaxiReglisse commented 1 year ago

I assume that the error comes from the Omeks-S application and not from the virtual machine on which the Docker composition is running.

The proof is that the following message was delivered.

$ echo "ceci est un essai" | mail -s "essai from omekas-docker" ernest.chiarello@univ-fcomte.fr

I hope that you will be able to help me find the answer to this issue...

giocomai commented 1 year ago

You can add smtp settings in the local.config.php file, in the relevant section:

    'mail' => [
        'transport' => [
            'type' => 'smtp',
            'options' => [
                'name' => 'mail.example.com',
                'host' => 'mail.example.com',
                'port' => 25, // 465 for 'ssl', and 587 for 'tls'
                'connection_class' => 'login', // 'plain', 'login', or 'crammd5'
                'connection_config' => [
                    'username' => 'user@example.com',
                    'password' => 'secretpassword',
                    'ssl' => null, // 'ssl' or 'tls'
                    'use_complete_quit' => true,
                ],
            ],
        ],
    ],
MaxiReglisse commented 1 year ago

Thanks for the tip, it worked the first time, or almost. it didn't work with the host's Exim server, although it was listening on port 25. But it did work with my university's SMTP server.

'mail' => [
    'transport' => [
        'type' => 'smtp',
        'options' => [
            'name' => 'smtp.univ-fcomte.fr',
            'host' => '172.20.194.204',
            'port' => 25, // 465 for 'ssl', and 587 for 'tls'
            'connection_class' => 'smtp', // 'plain', 'login', or 'crammd5'
            'connection_config' => [
                'username' => null,
                'password' => null,
                'ssl' => null, // 'ssl' or 'tls'
                'use_complete_quit' => true,
            ],
        ],
    ],
],

sincerely,

Ernest.