Sieve-Example:Notify: Difference between revisions

From AAISP Support Site
mNo edit summary
mNo edit summary
Line 2: Line 2:


[[File:Sieve-roundcube-notify.png|Roundcube screenshot]]
[[File:Sieve-roundcube-notify.png|Roundcube screenshot]]

If you can edit the sieve filter manually, then you can


<syntaxhighlight>
<syntaxhighlight>
# rule:[notify]
# rule:[notify]
if header :matches "subject" "*"
if header :matches "Subject" "*"
{
{
set "subject" "${1}";
set "subject" "${1}";
notify :importance "2" :message "[Notification] ${subject}" "mailto:someone@example.com";
}
}

if header :matches "From" "*"
{
set "from" "${1}";
}
notify :importance "2" :message "[Notification] ${from}: ${subject}" "mailto:andrew@aa.net.uk";

</syntaxhighlight>
</syntaxhighlight>



Revision as of 14:38, 19 September 2016

Send a notification email to another mailbox when the mailbox gets an email:

Roundcube screenshot

If you can edit the sieve filter manually, then you can

# rule:[notify]
if header :matches "Subject" "*"
{
	set "subject" "${1}";
}

if header :matches "From" "*"
{
	set "from" "${1}";
}
notify :importance "2" :message "[Notification] ${from}: ${subject}" "mailto:andrew@aa.net.uk";

This sets a variable of the subject, and then sends an email to another mailbox using the subject line.