External Application - Content Filtering

External Application - Content Filtering

Postby m1byo » Wed Apr 16, 2008 9:33 am

Hello,

Is there any way of processing a return value from an external application triggered by content filtering.

I would like to include this value into a header-line of the emails which trigger the external application.

Thanks very much

Ian
m1byo
 
Posts: 164
Joined: Fri Sep 21, 2007 2:36 pm
Location: UK

Re: External Application - Content Filtering

Postby Code Crafters » Wed Apr 16, 2008 10:05 am

There is the application result content filter condition that will read the return value of an application and trigger if this is within the specified range. However, currently we haven't added a field tag for this to allow you to print the exact return value but obviously knowing the range that it triggers in you could add a rule that modifies a header to say if the return value was in or out of that range. I will make a note for a field tag to be added for this in a future update.
Code Crafters
 
Posts: 943
Joined: Mon Sep 10, 2007 2:35 pm

Re: External Application - Content Filtering

Postby m1byo » Wed Apr 16, 2008 10:36 am

Thank you very much!
m1byo
 
Posts: 164
Joined: Fri Sep 21, 2007 2:36 pm
Location: UK

Re: External Application - Content Filtering

Postby m1byo » Wed Apr 16, 2008 10:45 am

Another option which would be advantageous would be to have a content filtering option which read text from a file which could then be included as a field tag.

Thanks

Ian
m1byo
 
Posts: 164
Joined: Fri Sep 21, 2007 2:36 pm
Location: UK

Re: External Application - Content Filtering

Postby Code Crafters » Thu Apr 17, 2008 10:54 am

I'll forward your suggestion to the rest of the team for consideration.
Code Crafters
 
Posts: 943
Joined: Mon Sep 10, 2007 2:35 pm

Re: External Application - Content Filtering

Postby m1byo » Thu May 15, 2008 2:07 pm

Hello,

Following this post, I have written a little application which is triggered by content filtering which does the following:

1. Read in the email from the path pointed to by the ""%s"" application switch used in content filtering (double " to force the path to be sent to the application inside ")
2. Look through the email for the Subject Header
3. Prepend the subject after the header with [number]
4. rewrite the email with all of this information included.

If I run this first or second in the list of content filtering it works correctly, however if I run it any lower it does not edit the email. (I know one of the rules has stop filtering if it is triggered)

Any ideas would be greatly appreciated.

Ian
m1byo
 
Posts: 164
Joined: Fri Sep 21, 2007 2:36 pm
Location: UK

Re: External Application - Content Filtering

Postby Code Crafters » Fri May 16, 2008 10:59 am

As you suggested, it sounds as though either an earlier rule is causing "stop filtering" which prevents other rules from being evaluated or possibly a copy of the mail is made and it's the copy not the original that is modified. If you send your contentfiltering.ini to chris@code-crafters.com I'll be happy to have a quick look at it and point out what's most like causing this but I'd guess for now at this being caused by the "stop filtering" action.
Code Crafters
 
Posts: 943
Joined: Mon Sep 10, 2007 2:35 pm

Re: External Application - Content Filtering

Postby m1byo » Thu Mar 26, 2009 3:32 pm

I know this is a resurection of a very old thread, however I have once again been asked to add the numbering function to emails on a mailing list and so I have dug out my old application.

From a little further investigation it seems that the cause of the issue is that AMS is not running slow enough!! It seems that when you trigger the external application, the mail is already a long way through the processing route on AMS and so by the time the application has finished working on the email, AMS has already deleted the file and moved on.

Is there any way of getting AMS to wait before continuing the process the email?

Thanks

Ian
m1byo
 
Posts: 164
Joined: Fri Sep 21, 2007 2:36 pm
Location: UK

Re: External Application - Content Filtering

Postby Code Crafters » Tue Mar 31, 2009 11:43 am

The content filter condition has to have a timeout but this should be sufficient enough for the application to very quickly process and return a value to AMS. It's possible that the application isn't correctly returning this value before the timeout and therefore the condition will default to fail and continue as far as I can remember.
Code Crafters
 
Posts: 943
Joined: Mon Sep 10, 2007 2:35 pm

Re: External Application - Content Filtering

Postby m1byo » Tue Mar 31, 2009 11:56 am

Hello,

If I run the application in the conditions box using the Application Result then the number is appended to the email in question, however it then appends it to every email.

If I run the application as an action it does not seem to do it as I think AMS is already completing the email and moving it to the appropriate folder and is not waiting for an application result.

any ideas?

Thanks

Ian
m1byo
 
Posts: 164
Joined: Fri Sep 21, 2007 2:36 pm
Location: UK

Re: External Application - Content Filtering

Postby Code Crafters » Tue Mar 31, 2009 3:37 pm

The condition application result waits for the application to finish to use the result returned to determine how to act on it. The action just fires an application but does not wait for it to return. Therefore any changes to the mail file will not be updated after the application is finished.

Based on what you have said content filtering won't do what you need but you can use antivirus filtering to perform this task. Create an antivirus scanner which uses your application with appropriate parameters including "%s" to pass the temporary email file. The important bit is that you tick the option Scan Raw Email Data as this does a scan of the entire mail and also allows the antivirus scanner to alter the mail; with antivirus filtering the temporary copy of the email is actually used instead of the original to allow these file edits to remain. Your application should also return a value (e.g. 0 or 1) then you should set the antivirus scanner to use this return value to indicate an infection so that the changes are made permanent. You can untick the Scan Text and HTML Parts option as this isn't needed here. You also shouldn't need to add any further actions to the antivirus scanner unless you need any other action taken.

Of course as always you can feel free to send me your contentfiltering.ini or antivirusfiltering.ini files to chris@code-crafters.com for me to check after you have implemented these changes.
Code Crafters
 
Posts: 943
Joined: Mon Sep 10, 2007 2:35 pm

Re: External Application - Content Filtering

Postby m1byo » Tue Mar 31, 2009 3:57 pm

Is there any way I can do this on selected emails, not every single email?

The main role for this is for the application to add a serial number to the email when it is sent to a mailing list.

At the moment when the application is triggered, it adds the serial number to the email which triggered it.

Thanks very much

Ian
m1byo
 
Posts: 164
Joined: Fri Sep 21, 2007 2:36 pm
Location: UK

Re: External Application - Content Filtering

Postby Code Crafters » Fri Apr 03, 2009 10:44 am

You can of course use content filter conditions to filter which mails are affected by certain rules. However, because only antivirus filtering has the functionality to modify the entire email file this is not possible in the current version. You could obviously create an application as an email relay which receives the mailing list, modifies it then forwards it to Ability Mail Server. You would only need a very simple version of SMTP running for this but this is much more work than your original application.
Code Crafters
 
Posts: 943
Joined: Mon Sep 10, 2007 2:35 pm


Return to General

Who is online

Users browsing this forum: No registered users and 13 guests

cron