Community Discussions and Support
Pass values from email to external program....

Thanks for the replies.

 I'll look into using a filtering rule. :)

You could use a filter rule to copy the mail to a directory and

either have your script monitoring it for new files or use a second rule

to trigger the script.

<p>Thanks for the replies.</p><p> I'll look into using a filtering rule. :) </p><p>You could use a filter rule to copy the mail to a directory and either have your script monitoring it for new files or use a second rule to trigger the script.</p>

I know Mercury can run an external program.

EG: I have logmein installed but disabled.
I email a specific account, with a specific key work in the subject and logmein is then enabled.
I can also disable by specifing a different keyword in the subject.

This all works well.  BUT could I pass a value/string from the subject to an external program ?

Ideally with out the use a daemon, as I've no idea how to write one !!

Thanks

<P>I know Mercury can run an external program.</P> <P>EG: I have logmein installed but disabled. I email a specific account, with a specific key work in the subject and logmein is then enabled. I can also disable by specifing a different keyword in the subject. </P> <P>This all works well.  BUT could I pass a value/string from the subject to an external program ?</P> <P>Ideally with out the use a daemon, as I've no idea how to write one !!</P> <P>Thanks</P>

Filtering rules don't have access to the message, they can only specify conditions and perform an action if those conditions are met. To use a header or some other part of the message in an external program you will need either a policy or a daemon, I'm afraid.

/Rolf

<p>Filtering rules don't have access to the message, they can only specify conditions and perform an action if those conditions are met. To use a header or some other part of the message in an external program you will need either a policy or a daemon, I'm afraid.</p><p>/Rolf </p>

> I email a specific account, with a specific key work in the subject and logmein is then enabled.
>
> I can also disable by specifing a different keyword in the subject.
>
> This all works well.  BUT could I pass a value/string from the subject to an external program ?

A policy gets the RFC 2822 message body and the program you use with a policy can do whatever it wants to the text in the RFC 2822 message as long as it's still a valid message when it's passed back to Mercury.

> I email a specific account, with a specific key work in the subject and logmein is then enabled. > > I can also disable by specifing a different keyword in the subject. > > This all works well.  BUT could I pass a value/string from the subject to an external program ? A policy gets the RFC 2822 message body and the program you use with a policy can do whatever it wants to the text in the RFC 2822 message as long as it's still a valid message when it's passed back to Mercury.

Thanks for the replies.

I've decided to look at PHP to see if I can read the mail from the mailbox and capture the data that way !

 

<p>Thanks for the replies.</p><p>I've decided to look at PHP to see if I can read the mail from the mailbox and capture the data that way !</p><p> </p>

You could use a filter rule to copy the mail to a directory and either have your script monitoring it for new files or use a second rule to trigger the script.

The script could then extract the data and delete the file.

<p>You could use a filter rule to copy the mail to a directory and either have your script monitoring it for new files or use a second rule to trigger the script.</p><p>The script could then extract the data and delete the file. </p>
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