I set up a catchall mailbox for a domain in order to catch all mails sent to unknown addresses (typo, former user, spammer educated guess, etc.)
I also set up an event handler script to list those unknown addresses.
At first I was a happy camper with it but... when multiples unknown addresses are present in the mail, the oMessage.Recipients only contains an unique recipient, as if the hMailServer resolved all unknown addresses to the catchall mailbox and removed duplicates from the resolved recipients list before firing the event handler.
I tried with onDeliverMessage and onAcceptMessage, both behave the same.
Is there a way to have the event handler know all the addresses present in the SMTP envelope, even if at the end of the day, they all resolve to the unknown mailbox?
Code: Select all
Sub OnAcceptMessage(oClient, oMessage) EventLog.Write("entering OnAcceptMessage") for i = 0 to oMessage.recipients.count -1 EventLog.Write("OnAcceptMessage:recipient: " & oMessage.Recipients.Item(i).OriginalAddress) next EventLog.Write("exiting OnAcceptMessage") Result.Value = 0 End Sub