How to return user specific message if server deny - WeOnlyDo Discussion board

How to return user specific message if server deny (wodSmtpServer / wodPop3Server / wodImapServer)

by Aleksey Diachok, Wednesday, September 05, 2012, 15:15 (4462 days ago)

Hi all,

can anyone tell me how to return user specific message if wodsmtpserver denying incoming message.

I use wodsmtpserver to receive users' messages from Exchange.I save statistic information to DB. And I should stop all messages which were not processed.

If my DB is unavailable I set Deny flag in [code]_IwodSmtpServerComEvents.MailFrom[/code] event. And it causes returning of SMTP error: Cannot receive mail from...

Then Exchange sends a Undelivery report to the sender/administrator with Cannot receive mail from... .

But i want Exchange to send something like DB is currently unavailable.

Is there any way to cancel receiving of message on wodsmtpserver side and specify my explanation

Re: How to return user specific message if server

by wodDamir, Wednesday, September 05, 2012, 15:48 (4462 days ago) @ Aleksey Diachok

Hi Aleksey,

You can try using SilentDeny instead. Once you set Action to SilentDeny, make sure that you send your custom message (along with error code) and end of line character. I.e:

[code]
Action = SilentDeny
User.Send( 451 I decided to refuse message from ... & vbCrLf )
[/code]

Can you try something like that?

regards,
Damba

Re: How to return user specific message if server

by alekseydiachok, Wednesday, September 05, 2012, 16:47 (4462 days ago) @ wodDamir

Great! thanks a lot!

It is what need.