Trigger with notification.email is not using SMTP setup

Infos:

  • Used Zammad version: 6.3.1
  • Used Zammad installation type: docker-compose

Expected behavior:

  • Whenever Zammad tries to send an email, it should use the host/port as configured on /#channels/email
  • This should be the case when triggers are used to send emails

Actual behavior:

  • Password reset is caught by mailcatcher
  • Emails from “Trigger” go to the users inbox

Steps to reproduce the behavior:

  • Setup something like Mailhog or Mailcatcher on 127.0.0.1:1025
  • Ensure Zammad is using the host:port as above
  • Confirm mailhog/mailcatcher is working using password reset functionality
  • Create a trigger
  • Set “Execute changes on objects” to use email
    • Visibility: public
    • Recipient: (a user)
    • Subject: anything
    • Attachments: no
    • Body: anything
    • Localization of execution changes: False

Hi, still struggling with this, but is it possible that the Zammad trigger is using the “account” rather than the “Email Notification” settings?

I don’t think I can alter the port for the “Account” settings in the Zammad UI to change, but is it possible to set this somewhere else somehow on an environment?

Hi.
Yes, all e-mails Zammad generates via triggers or the scheduler use the Account settings. The “notification” settings are used for automatic system / agent notifications.

I don’t suppose you can point me to the code which sends the mail for triggers, and has the various mail values in there? I cannot seem to get it to work, so want to fire it off, and look at things like the port etc.

No code required at all.
The documentation has you covered.

https://admin-docs.zammad.org/en/latest/channels/email/accounts/email-notification.html

Thanks, we have it setup using a rails command on our stage site, and clicking edit things look fine, but the email is not going through port 1025 as far as I can tell (as mailhog isn’t picking it up).

I am wondering whether the rails command is causing issues, or maybe the fact we have invalid “incoming” settings is also breaking the “outgoing” settings. Which I think I could determine with the code and some debugging outputs.

Thanks

Also @MrGeneration I might be mistaken, but my understanding from previous comments was that triggers didn’t use the “email notification” settings.

Hard to tell without knowing what you did. Generally people creating a notification channel are breaking stuff technically, so the outcome is unknown and out of application scope.

My bad, you’re right. I got hooked by

still struggling with this, but is it possible that the Zammad trigger is using the “account” rather than the “Email Notification” settings?

in combination with avedors answer.
So then the answer is no. The group the trigger fires in decides on the outgoing email address.

Thanks for the help, I am a little confused I am afraid though.

As far as I can see, triggers do not get assigned groups when we create them (at least, I don’t see a “groups” field I can edit).

I can see that on /#channels/email there is a “Destination Group” set, would this mean that all triggers use this same group, or am I going down the wrong path?

Thanks again,
Dan

There’s a group management section, that’s what I’m talking about
https://admin-docs.zammad.org/en/latest/manage/groups/index.html

Thanks, I had been looking at that groups management page. I can see that our “Group” has an email set, but that is in a dropdown. Where does that email get pulled from, as I am guessing you feel I need to set the port wherever that is configured.

Thanks,
Dan

Ultimately, going back to the original question just as I am aware I may have taken this away from the focus:

  • We have triggers setup that send emails
  • We want these emails to get caught by mailhog on stage (127.0.0.1:1025)
  • They are not being caught (whereas other emails from the site are)