将邮件解密到Exchange公用文件夹

时间:2018-06-04 07:44:08

标签: powershell email outlook outlook-vba

我收到了一些加密邮件。我想将它们存储在Exchange公用文件夹中。邮件应以解密方式存储,以便其他人可以在不需要我的私钥证书的情况下阅读邮件。

使用Outlook GUI,可以使用禁用加密的转发操作来执行此操作。这样做的缺点是邮件的发件人被我的地址替换。不太好,但至少删除了邮件加密。

我的Outlook配置为使用两个帐户。默认帐户是外部POP3帐户。但邮件应直接转发到Exchange服务器。因此,我想覆盖邮件的SendUsingAccount属性。但这会导致Exchange服务器出错。

$Exchange="name-of-the-server"
$PublicFolderAddress="address-of-the-folder"
$Outlook = New-Object -ComObject OUTLOOK.APPLICATION
$Account = $Outlook.Session.Accounts | Where-Object { $_.ExchangeMailboxServerName -eq $Exchange }
$Namespace = $Outlook.GetNamespace("MAPI")
$Mailbox = $Namespace.Folders | Where-Object { $_.Name -eq "my-mail-address" }
$Inbox = $Mailbox.Folders | Where-Object { $_.Name -eq "Inbox" }
$Mail = $Inbox.Items[1]
# create forwarded mail
$Forward = $Mail.Forward()
$Forward.Recipients.Add($PublicFolderAddress)
$Forward.SendUsingAccount = $Account
$FW.Send()

但是作业$Forward.SendUsingAccount = $Account失败了。

  

(HRESULT异常:0x80010105(RPC_E_SERVERFAULT)

  • 如何为邮件定义SMTP服务器以避免发送到POP3服务器?
  • 如何保留原始发件人姓名和地址,以便有效地移动邮件"到公共文件夹?在此过程中应删除加密。

编辑:主要目标是解密邮件并在Exchange服务器上公开。

1 个答案:

答案 0 :(得分:0)

You cannot just forward it and keep the signature intact. You can move the message to any folder using MailItem.Move().