开发者

Prevent Anti-Virus to block outgoing email with C#

开发者 https://www.devze.com 2023-01-06 12:14 出处:网络
I have an application with a static class that is capturing all errors that happens during the runtime (if its the case) and when process is done, it sends out an email with the list of errors so I or

I have an application with a static class that is capturing all errors that happens during the runtime (if its the case) and when process is done, it sends out an email with the list of errors so I or any other develop开发者_Go百科ers can address those errors.

However my problem is that McAfee is blocking the request, as if it was a kind of virus. I do not have rights on my machine to edit McAfee settings, is it possible to fix it through C# code?

Thank you


Probably McAfee is blocking outgoing connections on port 25 (SMTP), only allowing a white list of applications to send email.

What you can do is:

  • Put the email in a mailto:// url. Execute the mailto:// as if it is a normal command line. This will ask for input from the user, but you can create a nice template for the user. (syntax)
  • Send the email through your normal email client (Outlook, Notes), if they have an API for that.
  • Use a Http/Web based provider that has an API. Public ones are probably also blocked by McAfee. But you could create & host a service yourself. Be very carefull to only allow traffic from within your company.
  • Maybe you company has a "drop folder", where you can drop emails that are picked up by the email server.


Depending on what/why McAfee is flagging it, more than likely you will not be able to get around it.

You will want to see if you can find out if McAfee is flagging it due to the port being used, or if there is any other information as to why the individual message is not going.


No. And yes.

No, you can't force McAffee to not flag your email from code, if that's what you mean.

Yes, you can prevent McAffee or other virus scanners from flagging your emails as suspicious. Here are a couple of things I try to make sure of:

  • That your all addresses (especially from: and reply-to:) are valid.

  • That the the name you're sending from is actually the name of a the correct person in your active directory.

You could also ask your system administrators to put your "from:" address on a global whitelist so that it always goes to the client.

Are you attaching executables? Are you sure you aren't attaching any viruses? ;-)


From what I recall, I think McAfee has a list of programmes that are allowed to send emails, if your program is not added to this list, then your emails will not get sent.

This is a big support problem, as you will find your customers have a 101 different virus checkers all setup in different ways.

You may be able to setup a email server to use a none standard port, then send emails to that port.

For testing, attaching to the McAfee process with a debugger and then killing it can work well...

0

精彩评论

暂无评论...
验证码 换一张
取 消