The job of one of our projects was MS Exchange animal trainer for processing arriving email.
The straightforward well of culture was this nonfictional prose "Developing Managed Event Sinks/Hooks for Exchange Server Store victimization C#" by Logu Krishnan, published to the code [http://www.codeproject.com/csharp/CsManagedEventSinksHooks.asp], and as well examples from Microsoft Exchange SDK.
We used Synchronous Events and created the handler, which fires on OnSyncSave case. The handler creates stir record in Microsoft CRM and afterwards removes the statement in the Exchange database earlier the commitment:
Post ads:
husband having an emotional affair / phone calls recording system / cell phone monitoring legal / cheaters greco stabbed / cell phone spy mic / how to spy ppc / surveillance equipment store toronto / surveillance camera wireless / gadgets for iphone china / pricespy mobiles / spying on your spouse legality / surveillance cameras stores / ninja spy remote / can you bug a cell phone remotely / spy camcorder car key chain
public space OnSyncSave(IExStoreEventInfo pEventInfo, twine bstrURLItem, int IFlags) {
try {
if (IFlags == ((int)EVT_SINK_FLAGS.EVT_SYNC_COMMITTED (int)EVT_SINK_FLAGS.EVT_IS_DELIVERED)) {
ProcessMessage(pEventInfo, bstrURLItem, IFlags);
}
Post ads:
songs cheating your boyfriend being sorry / how to spy my keyboard / waterproof surveillance microphone / affaires juridiques / spy call software nokia 5233 / jogos do cheating lover / celebrities cheating on their spouses / download software for android mobile / to be cheating on you lyrics / private surveillance as a societal issue / surveillance camera footage / hiding listening devices / trial version mobile spy software / eavesdropping on voip calls / cellular spy software
}
catch (Exception ex) {
log.Debug(ex.Message "\\n" ex.StackTrace);
}
finally {
LogManager.Shutdown();
}
}
For Exchange handlers debugging - it is the dreadfully convenient to use set of laws log4net in RollingLogFileAppender or RemoteAppender modes (for quaternary example of COM objects). You can read much on this argument here
To let the handler ingoing message removal, it is prerequisite to confer puritanical rights to the user, lower than which statement the COM contention runs the handler. These are rights on translation of the numbers in user's boxes for whom it is registered (Windows 2003 Server: Active Directory Users and Computer -> Users -> Properties (for COM entry portrayal) -> Exchange Advanced -> Mailbox Rights). And now the code:
private null DeleteMessage(string bstrURLItem) {
try {
ADODB.Connection oCn = new ADODB.Connection();
oCn.Provider = "exoledb.datasource";
oCn.Open(bstrURLItem, "", "", -1);
if(oCn.State == 1) {
log.Debug("Good Connection");
}
else {
log.Debug("Bad Connection");
}
ADODB.Record rec = new ADODB.Record();
rec.Open(bstrURLItem, oCn,
ADODB.ConnectModeEnum.adModeReadWrite,
ADODB.RecordCreateOptionsEnum.adFailIfNotExists,
ADODB.RecordOpenOptionsEnum.adOpenSource,
"", "");
rec.DeleteRecord(bstrURLItem, false);
rec.Close();
oCn.Close();
rec = null;
oCn = null;
}
catch (Exception ex) {
log.Debug(ex.Message "\\n" ex.StackTrace);
}
}
Happy customizing!
Boris Makushkin
留言列表