Note that if you add the MX record your server IP will be exposed so people can potentially see that
Note that if you add the MX record your server IP will be exposed so people can potentially see that and bypass Cloudflare.
https://yourdomain.com/cdn-cgi/trace (replace yourdomain.com with your domain)message.reply() on CF email routing worker ?message-id is used, so what if I store that in D1 and use it later to create message object and reply ? For example, the docs cover an example of ticket creation, so let's say I want to send reply on same email when ticket is updated/closed.
https://yourdomain.com/cdn-cgi/tracemessage.reply()message-idexport default {
async email(message, env, ctx) {
const ticket = createTicket(message);
const msg = createMimeMessage();
msg.setHeader("In-Reply-To", message.headers.get("Message-ID"));
msg.setSender({ name: "Thank you for your contact", addr: "<SENDER>@example.com" });
msg.setRecipient(message.from);
msg.setSubject("Email Routing Auto-reply");
msg.addMessage({
contentType: 'text/plain',
data: `We got your message, your ticket number is ${ ticket.id }`
});
const replyMessage = new EmailMessage(
"<SENDER>@example.com",
message.from,
msg.asRaw()
);
await message.reply(replyMessage);
}
}