0

Exception email sent by Monolog at a shared host are not received when using a cloud host. Host is an Azure Ubuntu 16 VM. sendmail is installed on the VM and test emails are received. parameters.yml at the VM contain the same mailer_... parameters as at the shared host.

There are no entries related to email in the prod log when a CRITICAL: Uncaught PHP Exception Exception exception is forced. The custom exception page is displayed on the error.

config_prod.yml includes:

monolog:
    handlers:
        mail:
            type:         fingers_crossed
            action_level: critical
            handler:      deduplicated
        deduplicated:
            type:    deduplication
            handler: swift
        swift:
            type:       swift_mailer
            from_email: 'azure-mana@projectmana.org'
            to_email:   %mailer_user%
            subject:    'An Error Occurred!'
            level:      debug
            formatter:  monolog.formatter.html
            content_type: text/html

Edit: Using the FOSUserBundle password reset mechanism to generate emails I get prod log entries that may be significant. With the username & password in parameters.yml for mailer_..., the reset process yields:

CRITICAL: Uncaught PHP Exception Swift_TransportException: "Failed to authenticate on SMTP server with username...

If there are no entries for mailer... the error is:

Expected response code 250 but got code "530", with message "530 5.7.0 Must issue a STARTTLS command first

yet I've found no mention of sendmail configuration of TLS, or requiring authentication. If I did, I say it's not required.

geoB
  • 4,578
  • 5
  • 37
  • 70
  • any difference in prod vs dev symfony environment that e.g. could send emails directly in dev but spool them in prod (which would require some cron to send mails from spool)? – LBA Dec 12 '16 at 16:05
  • @LBA The dev environment is not enabled (in `app_dev.php`) on either the shared or cloud host. Emails are sent on my development system in both prod & dev, but it's Windows so that doesn't count. – geoB Dec 12 '16 at 16:29
  • @LBA Even with dev environment enabled at the cloud there is no useful information in the dev log. Further, in the dev environment I get the same log entry as in the prod log when I try to reset a password. – geoB Dec 13 '16 at 00:12
  • so it looks like a connection issue to your mailer - what kind of mailer are you using? starttls is kind of unofficially supported by swiftmailer - look for these issues on SO. – LBA Dec 13 '16 at 09:29
  • @LBA As mentioned above, [sendmail](https://www.google.com/search?q=ubuntu+sendmail&ie=utf-8&oe=utf-8#q=ubuntu+16.04+sendmail) – geoB Dec 13 '16 at 13:11
  • sorry, i mean your swiftmailer config - sorry about the misunderstanding – LBA Dec 13 '16 at 14:05

1 Answers1

1

The best I can figure is that sendmail by itself was insufficient, or my ability to work with it was even more insufficient. So I installed postfix on top, added no configuration to postfix, rebooted, and now exception emails are sent. (And received, once my email 'learned' that they weren't spam!)

geoB
  • 4,578
  • 5
  • 37
  • 70