User disconnect from any event. - WeOnlyDo Discussion board

User disconnect from any event. (wodSmtpServer / wodPop3Server / wodImapServer)

by ajitpals, Friday, February 05, 2016, 13:25 (3214 days ago)

Hi,

I'm currently disconnecting user in mail_from event with hard deny and sending the message back to the user in case of error. Something like this.

void mSMTP_MailFrom(SmtpUser User, ref string Address, ref SmtpActions Action)
{
//In case any error.
if(anyerror){
Action = SmtpActions.Deny;
User.Send(disconnectReason);
Thread.Sleep(100);
User.Disconnect();
return;
}
}

On telent, user get disconnected and message is seen on the command prompt.But the sending from email server like office 365 i didn't get any error message back or disconnect reason and servertried again to send the message back to the SMTP connection from different connection, even after i have denied it.

Is this alright or i'm missing something in code?

Thanks,
Ajit


Complete thread: