May 22 2016

Outlook 2016 for Mac 更改邮件存放路径

Category: 技术ssmax @ 15:30:45

由于Office 2016 实现了OSX新的sanbox api,所以导致直接更改邮件存放路径,然后使用软链接link回来的做法失效

下面就是一个小日本琢磨出来的解决方案,试过有效,共享一下:

sudo su
cd "/Applications/Microsoft Outlook.app/Contents/MacOS/"
hexdump -ve '1/1 "%.2X"' "Microsoft Outlook" | \
sed "s/73616E64626F783C2F6B65793E0A093C747275652F3E/73616E64626F783C2F6B65793E0A093C66616C732F3E/g" | \
xxd -r -p > "Microsoft Outlook.patched"
# search com.apple.security.app-sandbox
# change the value to false
chown YOURUSER "Microsoft Outlook.patched"
chmod `stat -f %A "Microsoft Outlook"` "Microsoft Outlook.patched"
mv "Microsoft Outlook" ~/Desktop/Microsoft\ Outlook.bak
mv "Microsoft Outlook.patched" "Microsoft Outlook"
ln -s "/Volumes/TarDisk/Outlook" "/Users//Library/Group Containers/UBF8T346G9.Office/Outlook"

其实就是关掉了sanbox,false没有完整拼写是为了保留字节数不变,不需要重新编译。
这样就可以把目录链接到别的盘了
另外一个解决方案是实用hdiutil attch 一个mountpoint,这个比较简单一点,但是我没有闲心慢慢看下去,比较喜欢粗暴一点,哈哈。

更改之后,如果你有多个邮箱,用户名密码会保存不下来,这是因为程序签名破坏了,要对程序进行重签
先在钥匙串里面新建一个自签名证书,然后信任它,最后重签,–no-strict 这个是个坑(遇到报错 main executable failed strict validation 的话)

codesign -f -s "YOUR SELF-SIGNED CERT NAME" --no-strict --deep "/Applications/Microsoft Outlook.app/"

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.