bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
9.03k stars 9.22k forks source link

Wordpress wp_mail relies on non-existing sendmail #14068

Closed dploeger closed 1 year ago

dploeger commented 1 year ago

Name and Version

bitnami/wordpress 15.2.21

What steps will reproduce the bug?

When deploying the chart with the smtp-parameters, Wordpress still can't send mails because the wp_mail function (or PHPMailer in turn) relies on an installed sendmail binary, which is missing from the container.

Are you using any custom parameters or values?

    smtpHost: ...
    smtpPort: 587
    smtpUsername: ...
    smtpPassword: ...
    smtpProtocol: tls

What is the expected behavior?

Wordpress can directly send out mails without any more configuration

What do you see instead?

When using the wp-test-email plugin to send out a test mail I get the following error in the log:

sh: 1: /usr/sbin/sendmail: not found

Additional information

No response

fmulero commented 1 year ago

Sorry @dploeger but I am not able to reproduce exactly the issue you reported. How did you get that message in the log? Are you setting any additional value?

dploeger commented 1 year ago

I don't think so. These are my complete values:

    wordpressUsername: <redacted>
    wordpressEmail: <redacted>
    wordpressFirstName: <redacted>
    wordpressLastName: <redacted>
    wordpressBlogName: <redacted>
    # Settings here don't work. See https://github.com/bitnami/charts/issues/14068
    # In the meantime, we're using wpmailSMTP plugin
    smtpHost: <redacted>
    smtpPort: 587
    smtpUsername: <redacted>
    smtpPassword: <redacted>
    smtpProtocol: tls
    ## @param wordpressSkipInstall Skip wizard installation
    ## NOTE: useful if you use an external database that already contains WordPress data
    ## ref: https://github.com/bitnami/containers/tree/main/bitnami/wordpress#connect-wordpress-docker-container-to-an-existing-database
    ##
    wordpressSkipInstall: false
    ## @param wordpressExtraConfigContent Add extra content to the default wp-config.php file
    ## e.g:
    ## wordpressExtraConfigContent: |
    ##   @ini_set( 'post_max_size', '128M');
    ##   @ini_set( 'memory_limit', '256M' );
    ##
    wordpressExtraConfigContent: ""
    ## @param wordpressConfiguration The content for your custom wp-config.php file (advanced feature)
    ## NOTE: This will override configuring WordPress based on environment variables (including those set by the chart)
    ## NOTE: Currently only supported when `wordpressSkipInstall=true`
    ##
    wordpressConfiguration: ""
    ## @param existingWordPressConfigurationSecret The name of an existing secret with your custom wp-config.php file (advanced feature)
    ## NOTE: When it's set the `wordpressConfiguration` parameter is ignored
    ##
    existingWordPressConfigurationSecret: ""
    ## @param wordpressConfigureCache Enable W3 Total Cache plugin and configure cache settings
    ## NOTE: useful if you deploy Memcached for caching database queries or you use an external cache server
    ##
    wordpressConfigureCache: false
    ## @param wordpressPlugins Array of plugins to install and activate. Can be specified as `all` or `none`.
    ## NOTE: If set to all, only plugins that are already installed will be activated, and if set to none, no plugins will be activated
    ##
    wordpressPlugins: none
    service:
      type: ClusterIP
    resources:
      limits: {}
      requests:
        memory: 512Mi
        cpu: 300m
    persistence:
      storageClass: default
      size: 10Gi
    mariadb:
      primary:
        persistence:
          storageClass: default
          size: 8Gi

Could it be that it doesn't work because I added the SMTP values after the release was installed?

fmulero commented 1 year ago

Hi Dennis

I've been taking a look into the configuration and the root cause seems a missconfiguration in the WP Mail SMTP plugin. The plugin is not configured with the variables/values provided and it is not able to send any email. If you configure the WP Mail SMTP plugin manually, you will be able to send emails without installing sendmail in the container.

I've just opened an internal task to review these settings.

dploeger commented 1 year ago

Thanks a lot!

andresbono commented 1 year ago

Hi @dploeger, https://github.com/bitnami/containers/pull/24149 changes the SMTP configuration logic to adapt it to the latest versions of the WP Mail SMTP plugin, starting with container bitnami/wordpress:6.1.1-debian-11-r48.

Please, give a try to the bitnami/wordpress 15.2.43 chart! https://github.com/bitnami/charts/pull/14927