Community Discussions and Support
Working with "Labels"

Now it works and the Label (for saving attachments) will only be triggered for IP Cam sender address, while all other mails with jpg attachments will be passed. Thanks Brian.

Now it works and the Label (for saving attachments) will only be triggered for IP Cam sender address, while all other mails with jpg attachments will be passed. Thanks Brian.

This is the first time I ty to work with Labels. But my simple script doesn't work as expected. Only mails from ipcam1@domain.com should trigger the Label "IPCAM". It should save the attachment. This is working so far, but is saving jpg attachments from any mails, not only from sender ipcam1@domain.com. Where I'm wrong?

Mercury Global Rules
If header "F" is "ipcam1@domain.com" Call "IPCAM"
If header "F" contains "noreply@domain.com" Copy "name@domain.com"
If header "F" contains "jobiniton.de" Move "spam"
If size > 13000000 SendMessage "jm:E:\\Mercury\\RESOURCE\\MailSize.txt"
If size > 13000000 SendTextFile "E:\\Mercury\\RESOURCE\\attachment too big.txt"
If size > 13000000 Delete ""
If header "F" contains "spam@domain.com" Exit ""
If expression headers matches "X-SPAMHALTER: SPAM*" Move "spam"
Label "IPCAM"
If attachment ExtnPart contains "jpg" SaveAttmt "@D:\\Logs\\IPCam"
Always Return ""


<p>This is the first time I ty to work with Labels. But my simple script doesn't work as expected. Only mails from <b>ipcam1@<i>domain</i>.com</b> should trigger the Label "IPCAM". It should save the attachment. This is working so far, but is saving jpg attachments from any mails, not only from sender <b>ipcam1@<i>domain</i>.com. </b>Where I'm wrong?<b> </b></p><p>Mercury Global Rules <b>If header "F" is "ipcam1@<i>domain</i>.com" Call "IPCAM"</b> If header "F" contains "noreply@<i>domain</i>.com" Copy "name@<i>domain</i>.com" If header "F" contains "jobiniton.de" Move "spam" If size > 13000000 SendMessage "jm:E:\\Mercury\\RESOURCE\\MailSize.txt" If size > 13000000 SendTextFile "E:\\Mercury\\RESOURCE\\attachment too big.txt" If size > 13000000 Delete "" If header "F" contains "spam@<i>domain</i>.com" Exit "" If expression headers matches "X-SPAMHALTER: SPAM*" Move "spam" <b>Label "IPCAM" If attachment ExtnPart contains "jpg" SaveAttmt "@D:\\Logs\\IPCam" Always Return ""</b> </p>

From the mercury-pdf:

Attachment filtering This button creates a special type of rule that checks the filename and/or extension of attachments to messages. The rule is special because it will always trigger if the attachment matches the conditions you specify. There are two specialized actions that are only available in attachment filtering rules – one that deletes the attachment from the message, and another that saves the attachment to a file.

<p>From the mercury-pdf:</p> <p>Attachment filtering This button creates a special type of rule that checks the filename and/or extension of attachments to messages. The rule is special because it will always trigger if the attachment matches the conditions you specify. There are two specialized actions that are only available in attachment filtering rules – one that deletes the attachment from the message, and another that saves the attachment to a file.</p>

[quote user="Sellerie"]... The rule is special because it will always trigger if the attachment matches the conditions you specify. [/quote]

But in case it will be called only by a Label, it should not always trigger, isn't it?

<p>[quote user="Sellerie"]... The rule is special because it will <b>always </b>trigger if the attachment matches the conditions you specify. [/quote]</p><p>But in case it will be called only by a Label, it should not always trigger, isn't it? </p>

Joerg,

You need an Always Exit rule above the first label otherwise processing continues through the labels.

<p>Joerg,</p><p>You need an Always Exit rule above the first label otherwise processing continues through the labels. </p>

[quote user="Brian Fluet"]

Joerg,

You need an Always Exit rule above the first label otherwise processing continues through the labels.

[/quote]

Hi Brian,

I'm aware of that. Of course, I could exit the entire rule set after the Label has been called. But for me it isn't a reason why the "extract the attachment" order triggers at each mail.

[quote user="Brian Fluet"]<p>Joerg,</p><p>You need an Always Exit rule above the first label otherwise processing continues through the labels. </p><p>[/quote]</p><p>Hi Brian,</p><p>I'm aware of that. Of course, I could exit the entire rule set after the Label has been called. But for me it isn't a reason why the "extract the attachment" order triggers at each mail. </p>

Without an Always Exit rule above the label all messages flow through the label resulting in jpg attachments in any message gets saved.

I also think it wise to end every label with an Always Exit rule, even though it may not be needed, to insure that it's in place should future edits make it necessary.

<p>Without an Always Exit rule above the label all messages flow through the label resulting in jpg attachments in any message gets saved.</p><p>I also think it wise to end every label with an Always Exit rule, even though it may not be needed, to insure that it's in place should future edits make it necessary. </p>

[quote user="Brian Fluet"]

Without an Always Exit rule above the label all messages flow through the label resulting in jpg attachments in any message gets saved.[/quote]

Mercury would flow through the label, also when the label wasn't called? [:O]  Ok, in such case I indeed need an Alway Exit above the Label.


[quote user="Brian Fluet"]<p>Without an Always Exit rule above the label all messages flow through the label resulting in jpg attachments in any message gets saved.[/quote]</p><p>Mercury would flow through the label, also when the label wasn't called? [:O]  Ok, in such case I indeed need an Alway Exit above the Label. </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