・thunderbird autoconfig の用途
- Thunderbird へのメールアカウント追加時にメールアドレスとパスワードのみでSMTP/IMAP設定を完了させる設定
・xmlを作成
#-- 変数に必要な値を代入
DOMAIN=masdon.life
#-- https://masdon.life/.well-known/autoconfig/mail/config-v1.1.xml を作成
mkdir -p /var/www/html/https_root/.well-known/autoconfig/mail
chown -R nginx. /var/www/html/https_root/.well-known
cat <<'_EOL_'>/var/www/html/https_root/.well-known/autoconfig/mail/config-v1.1.xml
<?xml version="1.0"?>
<clientConfig version="1.1">
<emailProvider id="sakuravps">
<domain>_DOMAIN_</domain>
<displayName>_DOMAIN_</displayName>
<displayShortName>_DOMAIN_</displayShortName>
<incomingServer type="imap">
<username>%EMAILADDRESS%</username>
<hostname>_DOMAIN_</hostname>
<port>993</port>
<socketType>SSL</socketType>
<authentication>password-cleartext</authentication>
</incomingServer>
<incomingServer type="pop3">
<username>%EMAILADDRESS%</username>
<hostname>_DOMAIN_</hostname>
<port>995</port>
<socketType>SSL</socketType>
<authentication>password-cleartext</authentication>
<pop3>
<leaveMessagesOnServer>true</leaveMessagesOnServer>
<downloadOnBiff>true</downloadOnBiff>
<daysToLeaveMessagesOnServer>14</daysToLeaveMessagesOnServer>
</pop3>
</incomingServer>
<outgoingServer type="smtp">
<username>%EMAILADDRESS%</username>
<hostname>_DOMAIN_</hostname>
<port>465</port>
<socketType>SSL</socketType>
<authentication>password-cleartext</authentication>
</outgoingServer>
</emailProvider>
<clientConfigUpdate url="http://_DOMAIN_/mail/config-v1.1.xml" />
</clientConfig>
_EOL_
sed -i "s/_DOMAIN_/${DOMAIN}/g" /var/www/html/https_root/.well-known/autoconfig/mail/config-v1.1.xml