Extension development
ji_access_job_data

[quote user="Vincent Fatica"]
P.S., In the forum's message composer, how do you get your code to appear in a box?
[/quote]

That was just an indent actually. :)

/Rolf 

<p>[quote user="Vincent Fatica"] P.S., In the forum's message composer, how do you get your code to appear in a box? [/quote]</p><p>That was just an indent actually. :)</p><p>/Rolf </p>

After the submission of a message to a list with one member, my DAEMON() is called.  It does this

    CHAR filename[MAX_PATH];
    mi->ji_access_job_data(job, filename, MAX_PATH);

and writes filename to a log file, I get the likes of this (single string):

D:\MERCURY\QUEUE\MG000001.QDFD:\MERCURY\QUEUE\MG000002.QDF

What do I make of this, handle it?  I want to remove a header from the outgoing message (which ultimately winds up being in MG000003.QDF).  (I'm using Mercury v4.62.)

Thanks.

<p>After the submission of a message to a list with one member, my DAEMON() is called.  It does this </p><p>    CHAR filename[MAX_PATH];     mi->ji_access_job_data(job, filename, MAX_PATH); </p><p>and writes filename to a log file, I get the likes of this (single string): </p><p>D:\MERCURY\QUEUE\MG000001.QDFD:\MERCURY\QUEUE\MG000002.QDF</p><p>What do I make of this, handle it?  I want to remove a header from the outgoing message (which ultimately winds up being in MG000003.QDF).  (I'm using Mercury v4.62.)</p><p>Thanks. </p>

[quote user="Vincent Fatica"]

After the submission of a message to a list with one member, my DAEMON() is called.  It does this

    CHAR filename[MAX_PATH];
    mi->ji_access_job_data(job, filename, MAX_PATH);

and writes filename to a log file, I get the likes of this (single string):

D:\MERCURY\QUEUE\MG000001.QDFD:\MERCURY\QUEUE\MG000002.QDF

What do I make of this, handle it?  I want to remove a header from the outgoing message (which ultimately winds up being in MG000003.QDF).  (I'm using Mercury v4.62.)

Thanks.

[/quote]

 Sorry, I didn't have newlines in my debug logging function, so that's actually 2 calls to DAEMON().  I  still don't know what to make of it.  Why is my DAEMON() being called twice?

Thanks.

 

[quote user="Vincent Fatica"]<p>After the submission of a message to a list with one member, my DAEMON() is called.  It does this </p><p>    CHAR filename[MAX_PATH];     mi->ji_access_job_data(job, filename, MAX_PATH); </p><p>and writes filename to a log file, I get the likes of this (single string): </p><p>D:\MERCURY\QUEUE\MG000001.QDFD:\MERCURY\QUEUE\MG000002.QDF</p><p>What do I make of this, handle it?  I want to remove a header from the outgoing message (which ultimately winds up being in MG000003.QDF).  (I'm using Mercury v4.62.)</p><p>Thanks. </p><p>[/quote]</p><p> Sorry, I didn't have newlines in my debug logging function, so that's actually 2 calls to DAEMON().  I  still don't know what to make of it.  Why is my DAEMON() being called twice?</p><p>Thanks.</p><p> </p>

You should be able to see the corresponding message ids in the Mercury core log file, which might give some hint. Are there any other deamons loaded?

/Rolf 

<p>You should be able to see the corresponding message ids in the Mercury core log file, which might give some hint. Are there any other deamons loaded?</p><p>/Rolf </p>

No, there are no other daemons loaded.

I'm trying to get rid of the "Sender:" header that's put into messages to lists.  And I'm trying to do it "by the book".  Code like this (below) just results in an endless loop of files being created in the queue (with alternating names) and my daemon being called over and over.

CHAR *rid[2] = {"Sender", NULL};
CHAR filename[MAX_PATH];
mi->ji_open_job(job);
mi->ji_access_job_data(job, filename, MAX_PATH);
mi->edit_message_headers(filename, &rid[1], rid);
mi->ji_unaccess_job_data(job);
mi->ji_close_job(job);
return 0; 

Am I doing something wrong?  Has David taken steps so the "Sender:" header cannot be removed?

<p>No, there are no other daemons loaded.</p><p>I'm trying to get rid of the "Sender:" header that's put into messages to lists.  And I'm trying to do it "by the book".  Code like this (below) just results in an endless loop of files being created in the queue (with alternating names) and my daemon being called over and over.</p><p>CHAR *rid[2] = {"Sender", NULL}; CHAR filename[MAX_PATH]; mi->ji_open_job(job); mi->ji_access_job_data(job, filename, MAX_PATH); mi->edit_message_headers(filename, &rid[1], rid); mi->ji_unaccess_job_data(job); mi->ji_close_job(job); return 0; </p><p>Am I doing something wrong?  Has David taken steps so the "Sender:" header cannot be removed? </p>

I mainly write in Pascal and haven't made any global daemon that modifies raw message data, but I did a small test which worked OK in my system (slightly simplified code with just the main ingredients):

   if mi.ji_access_job_data(job, Filename, 256) = 1 then

  begin

   mi.logstring(10, LOG_DEBUG, 'Message extracted');

    if mi.edit_message_headers(Filename, AddHeaders, DelHeaders) = 1 then

      mi.logstring(10, LOG_DEBUG, 'Headers have been modified.')

    else mi.logstring(10, LOG_DEBUG, 'Error modifying headers.');

    mi.ji_unaccess_job_data(job);

  end

else

   mi.logstring(10, LOG_DEBUG, 'Failed to extract message'); 

  Result := 0;

/Rolf 

<p>I mainly write in Pascal and haven't made any global daemon that modifies raw message data, but I did a small test which worked OK in my system (slightly simplified code with just the main ingredients):</p> <blockquote>   <i> if mi.ji_access_job_data(job, Filename, 256) = 1 then</i> <i>  begin</i> <i>   mi.logstring(10, LOG_DEBUG, 'Message extracted');</i> <i>    if mi.edit_message_headers(Filename, AddHeaders, DelHeaders) = 1 then</i> <i>      mi.logstring(10, LOG_DEBUG, 'Headers have been modified.')</i> <i>    else mi.logstring(10, LOG_DEBUG, 'Error modifying headers.');</i> <i>    mi.ji_unaccess_job_data(job);</i> <i>  end</i> <i>else </i> <i>   mi.logstring(10, LOG_DEBUG, 'Failed to extract message'); </i> <i>  Result := 0;</i> </blockquote> <p>/Rolf </p>

[quote user="Rolf Lindby"]

I mainly write in Pascal and haven't made any global daemon that modifies raw message data, but I did a small test which worked OK in my system (slightly simplified code with just the main ingredients):

   if mi.ji_access_job_data(job, Filename, 256) = 1 then

  begin

   mi.logstring(10, LOG_DEBUG, 'Message extracted');

    if mi.edit_message_headers(Filename, AddHeaders, DelHeaders) = 1 then

      mi.logstring(10, LOG_DEBUG, 'Headers have been modified.')

    else mi.logstring(10, LOG_DEBUG, 'Error modifying headers.');

    mi.ji_unaccess_job_data(job);

  end

else

   mi.logstring(10, LOG_DEBUG, 'Failed to extract message'); 

  Result := 0;[/quote]

 That's basically the same as the one I had posted except that I did no logging and did call ji_open/close_job.  So I mimmicked yours (C code below).  It worked!  I don't know what the problem was with using ji_open/close_job.  Thanks.
    CHAR *rid[2] = {"Sender", NULL};
    CHAR filename[MAX_PATH];
    if ( mi->ji_access_job_data(job, filename, MAX_PATH) )
    {
        mi->logstring(10, LOG_DEBUG, filename);
        if ( mi->edit_message_headers(filename, &rid[1], rid) )
            mi->logstring(10, LOG_DEBUG, "Headers modified");
        else
            mi->logstring(10, LOG_DEBUG, "Error modifying headers");
        mi->ji_unaccess_job_data(job);
    }
    else
        mi->logstring(10, LOG_DEBUG, "Failed to access job data");
    return 0;
P.S., In the forum's message composer, how do you get your code to appear in a box?
[quote user="Rolf Lindby"]<p>I mainly write in Pascal and haven't made any global daemon that modifies raw message data, but I did a small test which worked OK in my system (slightly simplified code with just the main ingredients):</p> <blockquote>   <i> if mi.ji_access_job_data(job, Filename, 256) = 1 then</i> <i>  begin</i> <i>   mi.logstring(10, LOG_DEBUG, 'Message extracted');</i> <i>    if mi.edit_message_headers(Filename, AddHeaders, DelHeaders) = 1 then</i> <i>      mi.logstring(10, LOG_DEBUG, 'Headers have been modified.')</i> <i>    else mi.logstring(10, LOG_DEBUG, 'Error modifying headers.');</i> <i>    mi.ji_unaccess_job_data(job);</i> <i>  end</i> <i>else </i> <i>   mi.logstring(10, LOG_DEBUG, 'Failed to extract message'); </i> <i>  Result := 0;</i>[/quote] </blockquote> That's basically the same as the one I had posted except that I did no logging and did call ji_open/close_job.  So I mimmicked yours (C code below).  It worked!  I don't know what the problem was with using ji_open/close_job.  Thanks.<blockquote>    CHAR *rid[2] = {"Sender", NULL};     CHAR filename[MAX_PATH];     if ( mi->ji_access_job_data(job, filename, MAX_PATH) )     {         mi->logstring(10, LOG_DEBUG, filename);         if ( mi->edit_message_headers(filename, &rid[1], rid) )             mi->logstring(10, LOG_DEBUG, "Headers modified");         else             mi->logstring(10, LOG_DEBUG, "Error modifying headers");         mi->ji_unaccess_job_data(job);     }     else         mi->logstring(10, LOG_DEBUG, "Failed to access job data");     return 0; </blockquote>P.S., In the forum's message composer, how do you get your code to appear in a box?
0
-1
0
This topic is closed

Related Topics

live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft