Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-30490

In some cases sending e-mail would fail without any exception

    Details

      Description

      In some cases sending e-mail would not be successful and no exception will be logged, as sender_from configuration is required in some swiftmailer configuration, but not provided by default and must be set explicitly:

      config.yml

      swiftmailer:
          sender_address: 'no-reply@example.com'
      

      Steps to reproduce
      1. Clean installation of eZ Platform 2.x
      2. Configure Swiftmailer with Mailjet (or any other provider which requires the sender to be set)
      3. Create a new form with e-mail notification.
      4. Fill the form.

      Result
      No mail is sent.

        Issue Links

          Activity

          Hide
          Vidar Langseid added a comment -

          I stumbled on this problem yesterday, ref https://jira.ez.no/browse/EZP-30719 ( now closed as dupe )

          just to add some info from EZP-30719 :
          swiftmailer's send_address sets the Return-Path: header which is used for bounce management
          When you say sender_from, I assume you really mean the From: header ( set using Swift_Message::setFrom ). And as S├ębastien has discovered, this one needs to be set too...

          Not sure where we should store the From: email address.
          This could possible be set via GUI in form creator as I easily can see the need for having it differently per form?

          or we could use the existing 'app.contact_form.sender_email' parameter, create a new parameter or use the swiftmail setting 'sender_address'

          Show
          Vidar Langseid added a comment - I stumbled on this problem yesterday, ref https://jira.ez.no/browse/EZP-30719 ( now closed as dupe ) just to add some info from EZP-30719 : swiftmailer's send_address sets the Return-Path: header which is used for bounce management When you say sender_from , I assume you really mean the From: header ( set using Swift_Message::setFrom ). And as S├ębastien has discovered, this one needs to be set too... Not sure where we should store the From: email address. This could possible be set via GUI in form creator as I easily can see the need for having it differently per form? or we could use the existing 'app.contact_form.sender_email' parameter, create a new parameter or use the swiftmail setting 'sender_address'
          Hide
          Vidar Langseid added a comment -

          As for default sender_address, I think we should at least list the setting in app/config/config.yml by default, and add a parameter for it:

          swiftmailer:
              transport: '%mailer_transport%'
              host: '%mailer_host%'
              username: '%mailer_user%'
              password: '%mailer_password%'
              spool: { type: memory }
          +    # The sender address *must* be set if you want the application to send any emails
          +    sender_address: '%mailer_sender_address%'
          

          Whatever we set should default value for mailer_sender_address to null or 'nospam@ez.no' can be discussed.
          The setting must anyway be customized per installation. The question is if email sending should work or not before user configures it correctly...

          Show
          Vidar Langseid added a comment - As for default sender_address , I think we should at least list the setting in app/config/config.yml by default, and add a parameter for it: swiftmailer: transport: '%mailer_transport%' host: '%mailer_host%' username: '%mailer_user%' password: '%mailer_password%' spool: { type: memory } + # The sender address *must* be set if you want the application to send any emails + sender_address: '%mailer_sender_address%' Whatever we set should default value for mailer_sender_address to null or 'nospam@ez.no' can be discussed. The setting must anyway be customized per installation. The question is if email sending should work or not before user configures it correctly...
          Hide
          Sylvain Guittard added a comment -

          the form creator should warn the user if sender_address is not set

          Maciej Kobus Dariusz Szut: I think it makes sense. We can maybe display this message where we display the message for the required field. What do you think?

          Show
          Sylvain Guittard added a comment - the form creator should warn the user if sender_address is not set Maciej Kobus Dariusz Szut : I think it makes sense. We can maybe display this message where we display the message for the required field. What do you think?

            People

            • Assignee:
              Unassigned
              Reporter:
              Marcin Czech
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: