我试图将Outlook的Autodiscover.xml重定向到Web服务器之外,因为我们不在本地托管Exchange,而是使用office365。
经过大量阅读后,我相信我已经很接近了,尽管昨天进行测试时,它的重定向似乎无效。
问题: 我想知道我使用的配置是否有问题?我是否缺少配置才能正常工作?
我的.htaccess
中的/var/www/html/public/
文件的内容
SetEnv HTTPS on
<IfModule mod_rewrite.c>
RewriteEngine On
Options -Indexes
# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]
Options - Autodiscover
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ autodiscover.php [NC,L]
</IfModule>
autodiscover.php
文件的内容。
<?php
preg_match("/\<EMailAddress\>(.*?)\<\/EMailAddress\>/", $data, $matches);
//set Content-Type
header("Content-Type: application/xml");
?>
<?php echo '<?xml version="1.0" encoding="utf-8" ?>'; ?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
<Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
<Account>
<AccountType>email</AccountType>
<Action>settings</Action>
<Protocol>
<Type>POP3</Type>
<Server>mail.plym.com</Server>
<Port>995</Port>
<LoginName><?php echo $matches[1]; ?></LoginName>
<DomainRequired>off</DomainRequired>
<SPA>off</SPA>
<SSL>on</SSL>
<AuthRequired>on</AuthRequired>
<DomainRequired>off</DomainRequired>
</Protocol>
<Protocol>
<Type>IMAP</Type>
<Server>mail.plym.com</Server>
<Port>993</Port>
<DomainRequired>off</DomainRequired>
<LoginName><?php echo $matches[1]; ?></LoginName>
<SPA>off</SPA>
<SSL>on</SSL>
<AuthRequired>on</AuthRequired>
</Protocol>
<Protocol>
<Type>SMTP</Type>
<Server>mail.plym.com</Server>
<Port>465</Port>
<DomainRequired>off</DomainRequired>
<LoginName><?php echo $matches[1]; ?></LoginName>
<SPA>off</SPA>
<SSL>on</SSL>
<AuthRequired>on</AuthRequired>
<UsePOPAuth>on</UsePOPAuth>
<SMTPLast>off</SMTPLast>
</Protocol>
</Account>
</Response>
</Autodiscover>
如上所述,我想知道我的配置是否存在问题才能使其正常工作?谢谢您对此提供的任何帮助!