Re: Filter address book on PR_EMS_AB_HOME_MDB

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Dmitry Streblechenko (dmitry_at_dimastr.com)
Date: 02/18/05


Date: Fri, 18 Feb 2005 11:59:15 -0700

Looking at my source code that deals with filtering out mailboxes based on
the server, I too don't use a restriction - I vaguely remember that it
didn't work for me either, so I just loaded all rows and did the filtering
in my code...

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Mikael Svenson" <mikaels@powertech.no> wrote in message
news:4215AA2B.BC22E53B@powertech.no...
> The errorcode I get is -2147221225 which is MAPI_E_TOO_COMPLEX.
>
> -m
>
> Mikael Svenson wrote:
>>
>> No such luck. Any call I try with FindRow just fails. Even the ones
>> which work with table.Restrict. And that's using the exact same
>> restrict.
>>
>> MAPI33.MapiRestrictions.Restriction restriction =
>> new MAPI33.MapiRestrictions.Compare( Tags.PR_ACCOUNT,
>> MAPI33.MapiRestrictions.Compare.TYPES.Equal,
>> new MAPI33.MapiTypes.MapiString( Tags.PR_ACCOUNT,
>> "Administrator" ) );
>>
>> //This works:
>>
>> table.Restrict( restriction, IMAPITable.FLAGS.Default );
>>
>> //This won't work:
>>
>> table.FindRow( restriction, (uint)IMAPITable.FLAGS.BookmarkBeginning, 0
>> );
>>
>> The reason why I'm trying to restrict entries to one mailserver is that
>> some entry is giving me an MAPI_E_NOT_ENOUGH_RESOURCES, and I suspect
>> it's an entry from another mail server. By putting on a restriction I
>> figured I could circumvent the erroneus entry.
>>
>> Would it work by using QueryRows one row at a time, and if I get the
>> resource error then do a table.SeekRow(
>> (uint)IMAPITable.FLAGS.BookmarkCurrent, 1, ref rowSought ) to skip the
>> entry and continue?
>>
>> The error happens at a customers so I can't test it before next week.
>>
>> -m
>>
>> Dmitry Streblechenko wrote:
>> >
>> > Try to use FindRow instead of Restrict - I have seen cases where
>> > Restrict
>> > was failing but FindRow was working just fine.
>> >
>> > Dmitry Streblechenko (MVP)
>> > http://www.dimastr.com/
>> > OutlookSpy - Outlook, CDO
>> > and MAPI Developer Tool
>> >
>> > "Mikael Svenson" <mikaels@powertech.no> wrote in message
>> > news:42145FF1.1064B9EF@powertech.no...
>> > > MAPI33.MapiRestrictions.Restriction restriction =
>> > > new MAPI33.MapiRestrictions.Compare( Tags.PR_EMS_AB_HOME_MDB,
>> > > MAPI33.MapiRestrictions.Compare.TYPES.Equal,
>> > > new MAPI33.MapiTypes.MapiString( Tags.PR_EMS_AB_HOME_MDB,
>> > > "/o=Domain/ou=Location/cn=Configuration/cn=Servers/cn=MAIL/cn=Microsoft
>> > > Private MDB" ) );
>> > >
>> > > err = table.Restrict( restriction, IMAPITable.FLAGS.Default );
>> > >
>> > > So I think it's a COMPAREPROPS. I have tried with Content as well,
>> > > but I
>> > > get an error using that as restriction.
>> > >
>> > >
>> > > MAPI33.MapiRestrictions.Restriction restriction =
>> > > new MAPI33.MapiRestrictions.Content(
>> > > MAPI33.MapiRestrictions.Content.TYPES.IgnoreCase,
>> > > Tags.PR_EMS_AB_HOME_MDB,
>> > > new MAPI33.MapiTypes.MapiString( Tags.PR_EMS_AB_HOME_MDB,
>> > > "/o=Domain/ou=Location/cn=Configuration/cn=Servers/cn=MAIL/cn=Microsoft
>> > > Private MDB" ) );
>> > >
>> > >
>> > > I'm guessing RES_COMPAREPROPS is correct, but that Exchange 5.5 fails
>> > > somehow. I have spoken a bit with the author of MAPI33 as well, and
>> > > he
>> > > agrees that it's weird behaviour.
>> > >
>> > > I will try the same code tomorrow with Redemption and see if the
>> > > result
>> > > is the same.
>> > >
>> > > -m
>> > >
>> > >
>> > > Dmitry Streblechenko wrote:
>> > >>
>> > >> "Compare" as in RES_COMPAREPROPS? Did you try to use RES_CONTENT?
>> > >> Please do post the relevant portions of your code.
>> > >>
>> > >> Dmitry Streblechenko (MVP)
>> > >> http://www.dimastr.com/
>> > >> OutlookSpy - Outlook, CDO
>> > >> and MAPI Developer Tool
>> > >>
>> > >> "Mikael Svenson" <mikaels@powertech.no> wrote in message
>> > >> news:42130699.C8275BA1@powertech.no...
>> > >> > I'm using MAPI33 on this, but it's a compare restriction where I
>> > >> > use
>> > >> > PR_EMS_AB_HOME_MDB and a string to compare with.
>> > >> >
>> > >> > And the DN is shorter than 255 characters as well. I use 0 for the
>> > >> > flag
>> > >> > when setting the restriction on the table.
>> > >> >
>> > >> > If I try a compare on PR_EMAIL_ADDRESS it works just fine. And
>> > >> > equal/notequal are also exclusive.
>> > >> >
>> > >> > -m
>> > >> >
>> > >> > Dmitry Streblechenko wrote:
>> > >> >>
>> > >> >> Whay is the restriction kind and flags?
>> > >> >>
>> > >> >> Dmitry Streblechenko (MVP)
>> > >> >> http://www.dimastr.com/
>> > >> >> OutlookSpy - Outlook, CDO
>> > >> >> and MAPI Developer Tool
>> > >> >>
>> > >> >> "Mikael Svenson" <mikaels@powertech.no> wrote in message
>> > >> >> news:4211FF68.3A458A14@powertech.no...
>> > >> >> > I'm trying to write a restriction on PR_EMS_AB_HOME_MDB when I
>> > >> >> > retrieve
>> > >> >> > the GAL. I want to get all the mailbox's from a particular
>> > >> >> > server.
>> > >> >> >
>> > >> >> > I've tried to add
>> > >> >> > "/o=Domain/ou=Location/cn=Configuration/cn=Servers/cn=MAIL/cn=Microsoft
>> > >> >> > Private MDB"
>> > >> >> >
>> > >> >> > as the filter, but I get 0 entries back. Same with NotEqual on
>> > >> >> > the
>> > >> >> > same
>> > >> >> > filter.
>> > >> >> >
>> > >> >> > If I write "lalala" as the filter I get all entries with both
>> > >> >> > equal
>> > >> >> > and
>> > >> >> > not equal. Guess something is wrong somewhere :)
>> > >> >> >
>> > >> >> > -m



Relevant Pages

  • Sendmail - did not issue MAIL/EXPN - problem with one company.
    ... mail log I see them connecting but the log file has the "did not issue ... entry for every connection they try to make. ... filtering and invalid address filtering happens behind the firewall on ... We don't seem to be having problems resolving their mail server ip's ...
    (comp.mail.sendmail)
  • Re: Spam filtering not applying SCL - Exchange 2007
    ... that since the entry point was a 2003 server which passed it to the 2007 ... it should work if you run the command Set-ContentFilterConfig - ... directly into the 2007 box but I want to do filtering on it. ...
    (microsoft.public.exchange.admin)
  • Re: Stumped! duplicate entry wont go away!
    ... Scroll down to "Ray Charles" and check out the entry for "I'm ... In both IE7 and FF2 I see 2 both locally and off the server. ... Source code shows only 1. ...
    (alt.html)
  • Re: Building a mail server
    ... qmail uses Maildir exclusively. ... vpopmail supports virtual domains and you can set catch-all accounts ... > filtering to happen on the server so it's already filtered no matter what MUA ...
    (Debian-User)
  • Re: Slow Logon related to groups - Update!
    ... Sent update to server: 192.1.1.1 ... Group Policy processing aborted. ... Filtering: Denied ...
    (microsoft.public.windows.server.sbs)