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

All Events

Last post 01-28-2017, 21:14 by Gary. 12 replies.
Sort Posts: Previous Next
  •  12-24-2016, 3:18

    • Gary is not online. Last active: 01-28-2017, 21:15 Gary
    • Not Ranked
    • Joined on 03-22-2015
    • Tenneessee
    • Member
    • Points 145

    All Events

    I am "learning" how to use the DDK for the mail server and did some fiddling around, developed a "all events" dll, and ran into an issue... I have successfully written the dll that loads and registers properly, but i cannot figure out (beyond log  "event occurred") how to figure out which event actual occurred. does anyone have a "list" of (all) events that i'm seeing happen in my system messages window -and/or- an example (just the event handler) on how to "display" in the system messages window which event has occurred so i can filter out which ones i'm really interested in? Ultimately, i am trying to find the event(s) that happen just before it gets handed off to be processed (after spamhalter, clamwall, graywall, AND content control) so i can modify the emails "body" -or- "subject" to indicate i.e. it was flagged as spam, or for deletion (which i have setup and working now, i just want to "do" something with the email after all these checks and headers have been added/done)... i will be happy sharing my end result, because mercury does a fine job of indicating possible spam, i just want to carry it a bit further. right now i just send suspected spam to two accounts; "spam" & "delete these" (to assure nothing slips). did you guess i'm dealing with spam? i'm effectively moving around the suspects pretty good right now, i just want to venture into mercury's events (all of them) and push everything a bit further.

    Ok, now i'm REALLY stumped... I tried to create a "new" window for my events daemon in the main console window, and i played with the example in the developers guide quite a bit, and... i can't get  the code to compile, keeps saying that the "MCONSOLE" hasn't been defined... help?

    I've been trying to find any examples of daemon scripts on the internet now for a couple days to no avail... if anyone can point me to some examples, i probably can figure out alot of what i'm trying to do on my own. All but (of course) the event messages i'm trying to figure out anyhow. 


    There has GOT to be a harder way...
  •  12-25-2016, 17:06

    • Rolf Lindby is not online. Last active: 2017-08-19, 16:36 Rolf Lindby
    • Top 10 Contributor
    • Joined on 05-08-2007
    • Stockholm, Sweden
    • SuperStar
    • Points 25,515
    • BetaTeam Moderator SystemAdministrator

    Re: All Events

    There is proper event handling for MercuryS (SMTP) and MercuryP (POP3), and the available events are listed in the "MercuryS Events.txt" and  "MercuryP Events.txt" files. Messages passing through Mercury core are accessible from daemons at certain points but not really event based. All deamons can write to the system messages window using the logstring and logdata functions, see pages 72-74 in the Daemon Developer Guide. 

  •  12-25-2016, 17:25

    • Gary is not online. Last active: 01-28-2017, 21:15 Gary
    • Not Ranked
    • Joined on 03-22-2015
    • Tenneessee
    • Member
    • Points 145

    Re: All Events

    i found the example for creating a "window" in the main window, but it has issues with the "MCONSOLE" not being declared, do i need another include ? 


    There has GOT to be a harder way...
  •  12-25-2016, 21:13

    • Rolf Lindby is not online. Last active: 2017-08-19, 16:36 Rolf Lindby
    • Top 10 Contributor
    • Joined on 05-08-2007
    • Stockholm, Sweden
    • SuperStar
    • Points 25,515
    • BetaTeam Moderator SystemAdministrator

    Re: All Events

    Haven't tested creating console window objects, but I would expect that the example code on page 79 in the developer guide is correct. Try catching errors from the oif_new call to see what is happening.

     

  •  12-26-2016, 12:45

    • PaulW is not online. Last active: 03 Aug 2017, 8:35 PaulW
    • Top 10 Contributor
    • Joined on 05-08-2007
    • UK
    • SuperStar
    • Points 18,055

    Re: All Events

    Gary - I'm interested in following your progress on this.

    I've been running a policy for some years which alters the subject line of certain incoming messages, and that works well.  I'm currently experimenting with expanding that to avoid the DMARC / mailing list problems by altering the From: address.  Using the DDK would seem like a more efficient method and is an option I'd like to explore.

     

  •  12-27-2016, 2:47

    • Gary is not online. Last active: 01-28-2017, 21:15 Gary
    • Not Ranked
    • Joined on 03-22-2015
    • Tenneessee
    • Member
    • Points 145

    Re: All Events

    Attachment: customevents.c.txt

    Well, as mentioned above Paul, i have already tried to use the example in the ddk reference (as referred to above) but that's where the problems started, it would not recognize the 'MCONSOLE' declaration. I'm assuming i need to use another include which is my 1st step in resolving this myself, the next step; i will try is to "decompile" the dll (if possible) and see how David created the windows inside the main window, then i'll try to find a viable way to decipher the event calls. Right now i have successively sent to the system messages window that "an event has occurred" - but i have no idea which one. I have gone over the ddk reference several times and it does not provide a lot of info on what i'm trying to do, i was hoping someone else had attempted any of these scenarios.(hope you see this David, i seriously like the software, just being a coder myself...). I will be posting anything i manage to figure out here only because i believe in "open source"... *heh*

    Attaching the current code i am currently "testing" for anyone else interested. 

    Wait, Paul? You said you had something that edits the subject line? Is the code protected -or- mind sharing? - Thanx 


    There has GOT to be a harder way...
  •  12-27-2016, 8:38

    • Gary is not online. Last active: 01-28-2017, 21:15 Gary
    • Not Ranked
    • Joined on 03-22-2015
    • Tenneessee
    • Member
    • Points 145

    Re: All Events

    O...K... It seems that "Decompiling" a DLL proved to be a major $$$ problem. It seems that I need some real C++ examples of how to create a window inside the main window. While i go onto the internet and try to find "anything" other than the example in the DDK (which i can't figure out... yet), if anyone else has any ideas/examples please let me know. Again, i will try to keep everything posted here that i do figure out.
    There has GOT to be a harder way...
  •  12-27-2016, 13:24

    • Gary is not online. Last active: 01-28-2017, 21:15 Gary
    • Not Ranked
    • Joined on 03-22-2015
    • Tenneessee
    • Member
    • Points 145

    Re: All Events

    Attachment: customevents.c.txt
    My goal is to catch "all" events so i can redirect them (if needed) appropriately. I want to be as though as possible for expansion.

    As i promised of course; the attachments this time are the revised code with the actual output (i still haven't figured out the new "console" window problem...) of what i have figured out so far.

     

    There has GOT to be a harder way...
  •  12-27-2016, 13:26

    • Gary is not online. Last active: 01-28-2017, 21:15 Gary
    • Not Ranked
    • Joined on 03-22-2015
    • Tenneessee
    • Member
    • Points 145

    Re: All Events

    Attachment: System Messages.gif

    *hah*... it seems i can't upload more than one file per reply... here's the output...

    (this is the result of my email client checking 9 accounts, curious eh?)

    now if i can just figure out which each of these calls mean... 



    There has GOT to be a harder way...
  •  01-03-2017, 10:58

    • PaulW is not online. Last active: 03 Aug 2017, 8:35 PaulW
    • Top 10 Contributor
    • Joined on 05-08-2007
    • UK
    • SuperStar
    • Points 18,055

    Re: All Events

    Gary:
    Wait, Paul? You said you had something that edits the subject line? Is the code protected -or- mind sharing? - Thanx 

    Happy to share it but it's nothing special - just a compiled script that copies the message body line by line and modifies the subject line when it finds it.  Originally I produced it to avoid overlong subject lines caused by [absurdly long mailing list titles] and buggy emailers that produced multiple multilingual "Re:" insertions.

    (It has quite a few limitations, encoded text being one and it struggles with multi-line subjects, but it does the job for me.)

    If you are still interested I'll PM it to you.

  •  01-03-2017, 22:44

    • Gary is not online. Last active: 01-28-2017, 21:15 Gary
    • Not Ranked
    • Joined on 03-22-2015
    • Tenneessee
    • Member
    • Points 145

    Re: All Events

    yes, i would love you to send me a copy, eventually i want to be able to "modify" the subject of "suspicious" emails so they can be caught "faster" when read. I'm still having major trouble with the event-table that i mentioned above (what does what and what it means)... because of the context, i'm trying to include <typeinfo> so i can decipher the responses, but it seems that vc++ 2010 express doesn't like that include at all, and i'm limited to which operating system i can use to run that compiler. I'm trying to use XP, it's terrible hard to restore win7 if i crash the system (which happens when you try to write code *heh*) and i still haven't been able to create my "own" window for output inside the primary window... even using the example in the ddk. Thanx for responding Paul.
    There has GOT to be a harder way...
  •  01-07-2017, 19:15

    • PaulW is not online. Last active: 03 Aug 2017, 8:35 PaulW
    • Top 10 Contributor
    • Joined on 05-08-2007
    • UK
    • SuperStar
    • Points 18,055

    Re: All Events

    That's done.

    As I said I'm changing it to cope with DMARC mailing list problems by altering From addresses (particularly yahoo ones!) and may change it from a script to something with less overhead.

  •  01-28-2017, 21:14

    • Gary is not online. Last active: 01-28-2017, 21:15 Gary
    • Not Ranked
    • Joined on 03-22-2015
    • Tenneessee
    • Member
    • Points 145

    Re: All Events

    I haven't given up on this project, it's just turned out to be a lot more complicated without some guidance. I'm hoping that one of the programmers from the original mercury software will catch this and give me some more direction. Meanwhile i keep trying to work on this, does anyone know the proper way to "identify" a variable type then show it's contents? that's kind of where i'm at now... (Visual C++ 2010 Express - Using a virtual WinXP machine to code, only windows i had an extra key for VM)

     


    There has GOT to be a harder way...
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