使用Exchange Web服务进行正则表达式信用卡搜索? [英] Regular expression credit card search using Exchange Web Services?

查看:75
本文介绍了使用Exchange Web服务进行正则表达式信用卡搜索?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个小应用程序来扫描员工的邮箱并清除他们的信用卡号(不幸的是,有时人们会通过电子邮件向他们发送电子邮件!)

I want to write a little app to scan employee's mailboxes and cleanse them of credit card numbers (people sometimes email them in unfortunately!)

我已经在Outlook中做到了这一点,但这意味着要设置共享邮箱,这有点麻烦.看来Exchange端将是最好的选择.

I've already got something that does this in Outlook, but it means setting up shared mailboxes and is a bit of a hassle. It seems that Exchange-side would be the best option.

我想使用EWS,但是它的搜索选项有些局限(即使我想获得一组潜在的候选电子邮件,我认为我也需要10个不同的过滤器来返回数字为0-9的电子邮件他们的身体...然后使用代码中的正则表达式确认/拒绝!)

I'd like to use EWS, but it's search options are a bit limited (even if I want to get a set of potential candidate emails, I think I need 10 different filters to return emails with the numbers 0-9 in their body... and then to confirm/deny using regular expression in code!)

无论如何,如果有人能想到一种使用EWS进行此操作的好方法,那将是非常出色的!

Anyway, if anyone can think of a nice way to do this using EWS, that would be most excellent!

推荐答案

不幸的是,EWS无法进行正则表达式搜索.您需要从服务器提取消息并在客户端上执行搜索.

Unfortunately, Regex searches are not possible with EWS. You'll need to pull the messages from the server and perform the search on the client.

您可以执行一件事来加快它的速度:与其重复一遍又一遍地轮询每个邮箱,请使用SyncFolderItems(http://www.infinitec.de/post/2009/06/07/Processing-items -在使用EWS-Managed-API.aspx的Exchange文件夹中).

There is one thing you can do to speed it up: Instead of polling each mailbox over and over again, use the SyncFolderItems (http://www.infinitec.de/post/2009/06/07/Processing-items-in-an-Exchange-folder-using-EWS-Managed-API.aspx).

使用您在后续调用中返回的cookie.显然,您需要将cookie存储在某个地方,但是具有两列FolderId和cookie的简单数据库表就足够了.

Use the cookie you get back in subsequent calls. Obviously, you need to store the cookies somewhere, but a simple database table with the two columns FolderId and cookie is sufficient.

这样,您将仅处理自上次通话以来的新商品/更改过的商品.

This way you'll only process new/changed items since the last call.

这篇关于使用Exchange Web服务进行正则表达式信用卡搜索?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆