Prevent Anti-Virus to block outgoing email with C#

寵の児 提交于 2019-12-10 19:25:19

问题


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 developers 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


回答1:


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.



回答2:


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.




回答3:


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? ;-)




回答4:


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...



来源:https://stackoverflow.com/questions/3194978/prevent-anti-virus-to-block-outgoing-email-with-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!