const xml = `<?xml version="1.0" encoding="UTF-8"?>
<clientConfig version="1.1">
    <emailProvider id="natint.nl">
        <domain>natint.nl</domain>
        <displayName>NatInt Mail</displayName>
        <displayShortName>NatInt</displayShortName>
        <incomingServer type="imap">
            <hostname>mail.natint.nl</hostname>
            <port>993</port>
            <socketType>SSL</socketType>
            <authentication>password-cleartext</authentication>
            <username>%EMAILLOCALPART%</username>
        </incomingServer>
        <outgoingServer type="smtp">
            <hostname>mail.natint.nl</hostname>
            <port>587</port>
            <socketType>STARTTLS</socketType>
            <authentication>password-cleartext</authentication>
            <username>%EMAILLOCALPART%</username>
        </outgoingServer>
    </emailProvider>
    </clientConfig>`;

export default {
async fetch(request) {
const url = new URL(request.url);
if (url.pathname === "/mail/config-v1.1.xml") {
return new Response(xml, {
headers: { "content-type": "application/xml; charset=utf-8" },
});
}
return new Response("Not found", { status: 404 });
},
};
