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

zone routingHeaders not working through SMTP interface? #384

Open
ezp-matt opened this issue Apr 12, 2024 · 4 comments
Open

zone routingHeaders not working through SMTP interface? #384

ezp-matt opened this issue Apr 12, 2024 · 4 comments

Comments

@ezp-matt
Copy link

I'm attempting to forward transactional emails to Postmark's SMTP service if the email has a X-PM-Message-Stream header set. I've set up a zone called transactional with routingHeaders like so:

transactional: {
      pool: 'default',
      host: 'smtp.postmarkapp.com',
      port: 587,
      auth: {
        user: '<redacted>',
        pass: '<redacted>'
      },
      routingHeaders: { 'X-PM-Message-Stream': 'transactional' }
}

and I'm testing with this email:

From: "Sender" <[email protected]>
To: "Recipient" <[email protected]>
Subject: This is a test
X-PM-Message-Stream: transactional

I’m sending this mail through Zone MTA.

When I upload this email using the "Upload Message" function of the zmta-webadmin package (which I'm assuming uses the API), it works fine, and is routed to my transactional zone properly. However if I send the exact same message via SMTP using curl, it is always sent through the default zone.

Am I missing something? I set allowRoutingHeaders: [ 'api', 'bounce', 'feeder' ] in the core/default-headers plugin settings, but from what I can gather from reading the source code, that only applies to the X-Sending-Zone header.

Any advice would be appreciated.

@louis-lau
Copy link
Contributor

Maybe you have a plugin overwriting the zone? Most of the plugin hooks only run for messages submitted through SMTP.

@ezp-matt
Copy link
Author

Maybe, I'm using the stock zone-mta-template configuration (just installed it for the first time yesterday). I definitely don't have any custom plugins. I'll try disabling the plugins it comes with installed and see if it makes a difference.

@louis-lau
Copy link
Contributor

Hmm, to my knowledge the default template setup doesn't have anything that overwrites the zone. Sorry, don't know in that case!

@ezp-matt
Copy link
Author

I just disabled all the built-in plugins and tried again and got the same result. Thanks for the suggestion, though!

@ezp-matt ezp-matt changed the title routingHeaders not working through SMTP? zone routingHeaders not working through SMTP interface? Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants