Pegasus Mail & Mercury

Welcome to the Community for Pegasus Mail and
The Mercury Mail Transport System, the Internet's longest-serving PC e-mail system!
Welcome to Pegasus Mail & Mercury Sign in | Join | Help
in
Home Blogs Forums Downloads Pegasus Mail Overview Mercury Overview Wiki

daemon not invoked when core is processing an email

Last post 01-22-2010, 16:31 by Gmaper. 20 replies.
Page 2 of 2 (21 items)   < Previous 1 2
Sort Posts: Previous Next
  •  10-28-2008, 4:07

    • dms is not online. Last active: 11-25-2008, 5:44 dms
    • Top 500 Contributor
    • Joined on 10-21-2008
    • Member
    • Points 200

    Re: daemon not invoked when core is processing an email

    Thanks Rolf.  I've already tried that, and it didn't make a difference.  I will continue to debug into the binary to figure this out.
  •  10-28-2008, 9:05

    • dms is not online. Last active: 11-25-2008, 5:44 dms
    • Top 500 Contributor
    • Joined on 10-21-2008
    • Member
    • Points 200

    Re: daemon not invoked when core is processing an email

    Some more investigation.  I'm hoping that this rings a bell for someone or that David is able to respond.  Mercury.exe is loading at the default image base, so all addresses are the same as in the exe file.

    At location 0x41c4ef, there's a function that checks a bunch of stuff including, at location 0x41c546, a particular byte at offset 0x1d0 in a structure describing the daemon plug-in.  The structure contains the daemon name, the dll path, and seemingly some status info, including the byte at offset 0x1d0 and the dll hmod at offset 0x1d8.  For some reason, that byte is a zero for my DLL.  If the value was 4 (or at least that bit set), then mercury would continue and do GetProcAddr on _daemon, daemon, and DAEMON; and call the first one of those found (at location 0x41c5c9).  In other places in Mercury, there are other checks of this byte (against the values of 0, 1, 2, and 0x10).  I haven't yet figured out why my damon dll isn't getting a value of 4 in this structure.  If I manually change the value to 4 in a debugger, the daemon function is called.

    From the asm, my guess is that the source code looks like this:

    if(!global_ptr)

       if(global_ptr->pDaemon->status & 0x4)

          GetProcAddress (global_ptr->pDaemon->hmod, "daemon");

         ...

    I'd really like to know what causes the status byte to have that bit set...

  •  10-28-2008, 15:53

    Re: daemon not invoked when core is processing an email

    or that David is able to respond
    Don't look for anything from David for at least two weeks.  He is still in Europe for another week and probably will not be able to catchup on all his mail for at least another week.

    Thomas R. Stephenson
    San Jose, California
    Member of Pegasus Mail Support Team

    I do not answer private messages from the forum. If you want to contact me use email to techsupp@tstephenson.com.
  •  11-04-2008, 5:55

    • dms is not online. Last active: 11-25-2008, 5:44 dms
    • Top 500 Contributor
    • Joined on 10-21-2008
    • Member
    • Points 200

    Re: daemon not invoked when core is processing an email

    Eduardo Subelman helped track down this issue: the sample code in the DDK is wrong.  Specifically, in the startup function, there is a "*flags = 0;".  On the call to startup, *flags == 0x4.  Setting it to zero, per the sample, causes no calls to the daemon function.  I'm willing to bet (but I haven't verified yet) that flags points to the value at offset 0x1d0 in the daemon structure as described in my post on 10/28 above.  Commenting out the assignment in startup enables Mercury to call the daemon function with each processed email.

    Thanks Eduardo!

    Is there a way to file a bug against the DDK sample?  Mercury DDK\DDK Samples\Resident Daemon\daemon2.c contains the error.

    Now off to write my daemon...

  •  11-05-2008, 15:04

    Re: daemon not invoked when core is processing an email

    dms:
    Is there a way to file a bug against the DDK sample?  Mercury DDK\DDK Samples\Resident Daemon\daemon2.c contains the error.

    I've notified David of this issue - there is no public bug-track - thanks for your efforts.


    Kind regards / Peter
  •  01-22-2010, 16:31

    • Gmaper is not online. Last active: 08-16-2011, 14:22 Gmaper
    • Not Ranked
    • Joined on 02-27-2009
    • Commerce, Ga.
    • Member
    • Points 80

    Re: daemon not invoked when core is processing an email

    Peter Strömblad:

    dms:
    Is there a way to file a bug against the DDK sample?  Mercury DDK\DDK Samples\Resident Daemon\daemon2.c contains the error.

    I've notified David of this issue - there is no public bug-track - thanks for your efforts.

     

    I just experienced this same problem.  The sample daemon2.c as distributed in the DDK still contains the error last discussed in November of 2008.  Were it not for this forum chain I would have been unable to get the sample to run.

     I realized that Mercury is winding down but it sure would be nice if there was a single place to find known problems and any solutions or work arounds.  I'm surprised that there is no bug reporting and tracking mechanism but I guess at this stage of the product life cycle it is too late to expect change.

     

Page 2 of 2 (21 items)   < Previous 1 2
View as RSS news feed in XML

Contact | Advertise | Host provider: PraktIT | Terms of Use | Privacy Statement
Copyright © 2007-2011 David Harris / Peter Strömblad. | Pegasus Mail Home Page