Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honeypot field triggers Sendgrid errors in the logs: emails not sent #22

Closed
jeromecoupe opened this issue Oct 3, 2023 · 2 comments
Closed
Labels

Comments

@jeromecoupe
Copy link

jeromecoupe commented Oct 3, 2023

Description

I have a contact form (using the first party plugin) that is also using the Contact Form Honeypot.
That particular install is using Sendgrid to send the emails (SMTP config and Verified Send Identity per individual email addresses).

Contact form emails were not getting sent and, upon checking the logs, I saw Sendgrid related errors in the logs

2023-10-02 20:19:13 [web.ERROR] [yii\symfonymailer\Mailer::sendMessage] Expected response code "250" but got code "550", with message "550 The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit https://sendgrid.com/docs/for-developers/sending-email/sender-identity/ to see the Sender Identity requirements". {"memory":2314648}

The Sendgrid config was working because Craft could send test emails from the CP when on the email settings screen. Those made it to the specified inbox. However, mails from the contact form did not get sent 95% of the time.

After much testing, I figured that one of the big differences was that the Contact Form was using the Honeypot plugin. Maybe that was why those emails were not sent / triggered an error.

  • checked matching id and name for the form and the parameters in the settings: everything fine
  • disabled the Honeypot plugin
  • commented out the hidden field

Contact Form Emails were sent again and I could not see such errors in the logs.

Is there something in the way that plugin works that prevents Sendgrid (and possibly similar systems) to identify the System Email as Verified ?

Additional info

  • Craft CMS 4.5.6.1
  • Contact Form 3.0.1
  • Contact Form Honeypot: 2.0.0
  • PHP: 8.1.21

Originally posted as a Github issue on the Contact Form repository.

@jeromecoupe
Copy link
Author

Well errors are back ... and some email are not delivering despite getting rid of the honeypot. Currently investigating email server on the client's side ...

@jeromecoupe
Copy link
Author

Maybe I am going to look like an idiot here but the solution was quite simple and had nothing to do with the contact form plugin or the honeypot one.

I switched from using a simple SMTP config with Sendgrid to using the Sendgrid adapter, those errors disappeared and my emails started to get delivered.

In the hope it will help someone, here is the TLDR;

  • Use adapters, not an SMTP config with transactional email services. They seem to play nicer with the contact form.
  • With Sendgrid at least, it seems to be worth it to validate your domain(s) to improve email delivery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant