Last active
January 8, 2024 06:14
-
-
Save Nilpo/65d106901531795bf5b5c3dcad425dda to your computer and use it in GitHub Desktop.
Autoconfig config-v1.1.xml generator in PHP for Thunderbird mail client.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//get query data so we can extract the email address | |
$email = $_REQUEST['emailaddress']; | |
$domain = explode('@', $_REQUEST['emailaddress'])[1]; | |
//set Content-Type | |
header("Content-Type: application/xml"); | |
echo '<?xml version="1.0" encoding="utf-8" ?>'; ?> | |
<clientConfig version="1.1"> | |
<emailProvider id="<?php echo $domain; ?>"> | |
<domain><?php echo $domain; ?></domain> | |
<displayName><?php echo $email; ?></displayName> | |
<incomingServer type="imap"> | |
<hostname>mail.<?php echo $domain; ?></hostname> | |
<port>993</port> | |
<socketType>SSL</socketType> | |
<username><?php echo $email; ?></username> | |
<authentication>password-cleartext</authentication> | |
</incomingServer> | |
<outgoingServer type="smtp"> | |
<hostname>mail.<?php echo $domain; ?></hostname> | |
<port>587</port> | |
<socketType>STARTTLS</socketType> | |
<username><?php echo $email; ?></username> | |
<authentication>password-cleartext</authentication> | |
</outgoingServer> | |
</emailProvider> | |
</clientConfig> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} -s [OR] | |
RewriteCond %{REQUEST_FILENAME} -l [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^.*$ - [NC,L] | |
RewriteRule ^.*$ autoconfig.php [NC,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://autoconfig.example.com/mail/[email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?>'; ?> | |
<clientConfig version="1.1"> | |
<emailProvider id="example.com"> | |
<domain>example.com</domain> | |
<displayName>[email protected]</displayName> | |
<incomingServer type="imap"> | |
<hostname>mail.example.com</hostname> | |
<port>993</port> | |
<socketType>SSL</socketType> | |
<username>[email protected]</username> | |
<authentication>password-cleartext</authentication> | |
</incomingServer> | |
<outgoingServer type="smtp"> | |
<hostname>smtp.example.com</hostname> | |
<port>587</port> | |
<socketType>STARTTLS</socketType> | |
<username>[email protected]</username> | |
<authentication>password-cleartext</authentication> | |
</outgoingServer> | |
</emailProvider> | |
</clientConfig> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment