docker-library / drupal

Docker Official Image packaging for Drupal
278 stars 204 forks source link

Do we want to support Email/Contact? #15

Closed skyred closed 2 years ago

skyred commented 9 years ago

Both D7 and D8 ship with Contact Module, which generates a web form and send the inquiry to Emails. With this image, this function doesn't work, because there is no email server included in the image.

So, I am wondering if we want to support this Core function in this image?

tianon commented 9 years ago

See https://github.com/docker-library/wordpress/issues/30 for a very closely related discussion. The TL;DR is that it's hard to configure this in such a way that it's sane-by-default for most use cases, so I think documenting how to configure it might be a safer solution overall.

juliencarnot commented 8 years ago

Documenting a good way to get around the issue would be great, as this function is also needed for password recovery for example...

kn4a-com commented 8 years ago

Or documenting on how to link your Drupal container to an mail container.

sitarane commented 6 years ago

After failing to link the sendmail to this one, I went with the smtp auth drupal module to be able to send email from another server. Uneleguant solution that I would roll back as soon as someone can document how to send mail from a linked container (or adds the functionality to this one).

mstenta commented 6 years ago

Simple solution - extend the Drupal image with a custom Dockerfile and add SSMTP:

Dockerfile:

# Inherit from the Drupal 8 image.
FROM drupal:8

# Install SSMTP.
RUN apt-get install -y ssmtp

I also add configuration to SSMTP to relay through AWS SES or Mandrill, but I think the above works without anything extra.

tianon commented 2 years ago

I don't think there's a good generic solution we can apply here, but https://www.drupal.org/docs/develop/local-server-setup/managing-mail-handling-for-development-or-testing does have some good ideas, including pointers to https://www.drupal.org/project/smtp and https://www.drupal.org/project/phpmailer_smtp, one of which is definitely what I'd be using to solve this if I were running Drupal in my environment (either should be able to SMTP to a sidecar exim4 or otherwise container just as well as it can SMTP to an external provider).

Another option is something like ssmtp (as mentioned), but as ssmtp is technically deprecated I'd probably suggest msmtp instead.

skyred commented 2 years ago

Agreed. I am closing this issue.

For reference, if you want mailhog to intercept all emails, you can install mhsendmail