0
votes

I have received some encrypted mails. I want to store them in an Exchange public folder. The mails shall be stored decrypted so that others can read them without the need for my private key certificate.

Using the Outlook GUI it's possible to do so using the Forward action with encryption disabled. This has the drawback that the sender of the mail is replaced with my address. Not so good, but at least the mail encryption is removed.

My Outlook is configured to use two accounts. The default account is an external POP3 account. But the mail shall be forwarded directly to the Exchange server. Therefore I want to overwrite the SendUsingAccount property of the mail. But this causes an error with the Exchange server.

$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()

But the assignment $Forward.SendUsingAccount = $Account fails with exception.

(Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)

  • How can I define the SMTP server for the mail to avoid sending to the POP3 server?
  • How can I keep the original sender name and address so that the mail is effectively "moved" to the public folder? The encryption shall be removed in this process.

Edit: The main objective is to decrypt the message an make it public on the Exchange server.

1
Your suggested method appears to allow sensitive material to be intercepted. Removing encryption to share mail is universally needed. Your Outlook ribbon could have a tab for Security/Encryption where you can Unsecure or Unencrypt. This is different from the decryption to open the mail. Once you have unsecured you can move the mail to a shared folder.niton

1 Answers

0
votes

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