0

Few years ago my company changed its domain, the old and the new one are currently handled by Exchange 2013 server. Now, I would like to create an automatic reply message to inform all sender that the old domain is not used anymore. I want to apply this message only for old domain. It is possibile?

Tobia
  • 1,210
  • 8
  • 37
  • 73
  • If you don't want to receive email for this domain why deal with it at all at the Exchange server? Why don't you just create a null MX record? – joeqwerty Mar 22 '19 at 02:46
  • ... because the sender will not understand why it will be refused? With an automatic reply message I can explain him that he is using an old domain and needs to switch address. – Tobia Mar 22 '19 at 08:03

1 Answers1

0

I think you could try to create a transport rule like this:

If the message... Includes these patterns in the recipients' addresses: '@domain.com' or 'domain.com'

Do the following... reject the message and include the explanation: 'The domain.com is not used for now, please connect to xxx.'

The rule will reject the mail sent to “domain.com”.

If you don’t want to reject the mail, I think you could try to set autoreply for every mailbox, use a script like this:

$mailboxes = get-mailbox -resultsize unlimited | where-object {($_.primarysmtpaddress -like "*@domain.com")}
foreach ($mb in $mailboxes)
{
Set-MailboxAutoReplyConfiguration -Identity $mb -AutoReplyState Enabled -InternalMessage "The domain.com is not used for now, please connect to xxx.." -ExternalMessage " The domain.com is not used for now, please connect to xxx.."
}
Shaw
  • 339
  • 1
  • 4
  • Maybe this is what I need! But can you confirm that this rule will be applied only for the messages received from that domain? My mailboxes has both address, old domain and new domain, but the mailbox is the same. – Tobia Mar 22 '19 at 08:04
  • So the mailbox account have multiple smtp addresses (new and old domain), in my testing, I changed the rule like this, it would not reject the mail sent to other domain (b.com). `If the message... 'To' header contains ''a.com' or '@a.com'' Do the following... reject the message and include the explanation 'The domain is not used for now… '` – Shaw Mar 25 '19 at 09:07