Mailchannels or other SMTP smart host

Your question

Hello,

I am impressed by JMAP and this software in general, and would love to try it out and maybe even use it in production. But before I do so, I was never into sending emails from my IPs due to numerous reasons, so I always used MailChannels.

Would a smarthost like that be compatible with Stalwart, or am I limited to SMTP via my own infrastructure without access to something like EXIM configurations :slight_smile:

Thank you!

All the best :smiley:

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

Yes, Stalwart fully supports smart-host relaying, MailChannels included. You define a Relay-type MtaRoute object pointing at the smart host’s address/port, with optional TLS and SMTP AUTH credentials, and then use the outbound routing expression on MtaOutboundStrategy to send all (or selected) outbound mail through it instead of resolving MX records directly.

Example relay route:

{
  "@type": "Relay",
  "name": "relay",
  "address": "relay.mailchannels.net",
  "port": 587,
  "protocol": "smtp",
  "implicitTls": false,
  "authUsername": "your-username",
  "authSecret": {"@type": "Value", "secret": "your-password"}
}

You then set the routing strategy’s expression (e.g. always resolve to 'relay', or only for certain domains) to select this route. This is configured via the WebUI (Settings › MTA › Outbound › Routes) or through stalwart-cli/JMAP, not via Exim-style config files. See the docs on outbound routing.

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

Yes. Define a route of the Relay variant under Settings > MTA > Outbound > Routes with MailChannels’ host in address, the submission port, and authUsername / authSecret for the credentials. Then point the route expression on your outbound strategy at it so everything that is not a local domain takes that route; the “Relay host” example in the docs is exactly this shape.

Defaults to know: port is 25, protocol is smtp, and implicitTls is false, so for submission on 587 with STARTTLS leave it alone and for 465 set it true. authSecret accepts EnvironmentVariable or File as well as an inline value, so the API key does not have to live in the config.

If you want a fallback rather than an unconditional relay, the route expression can branch on retry_num and drop back to an Mx route after N failures.