New email notification?

Is there a way that a mailbox could be configured to send only a “new message” notification by email to non-MayFirst email accounts? In other words, rather than forwarding the entire content of a message, just let non-MayFirst accounts know there is a new email in the MayFirst mailbox? Then, one of those recipients would know to log in to the MayFirst mailbox to view the full contents of the message.

That seems like something that could potentially be done directly on the server, but I’m not sure if there is a way to access that in our MayFirst account.

go to roundcube (webmail. or I guess could use another sieve client), hamburger, settings, filters, add a filter, under actions choose “send notification”. I tested matching against subject and sending with and without matching subjects, it works.

I guess you can customize further with sieve language. RFC 5435 - Sieve Email Filtering: Extension for Notifications

1 Like

Yes, you can do that. If you follow the filter guide here:

https://help.mayfirst.org/en/guide/how-to-set-up-an-email-filter-on-the-server

One of the action options is to send a notification email. I think that would do what you are looking for.

Jamie

1 Like

Whoops. Sorry for the duplicate. What @electricat said :). Our messages crossed.

Thank you! That really helped! I was able to use the raw editor to even put in multiple recipients (by repeating the action), and even a customized body, since the GUI just lets you set the subject.

Update: It worked when I repeated the notify action in the raw Sieve file using “Edit Filter Set” to have two recipients. When I tried to make it five, it seems to have failed. I hope I didn’t cause any issues for the mail server!

I did a Track Delivery from my own email domain, and can see that an email I sent to a list serve at mayfirst.org got this error (where “myList” and “custom_mayfirst_domain” are the redacted placeholders for sharing here):

SMTP error from remote mail server after RCPT TO:<myList@lists.custom_mayfirst_domain.org>: 450 4.3.2 Service currently unavailable

you don’t have to post your own domains or email addresses but I think maybe better to use actual domains (even if they aren’t yours) in the examples you give here.

can you post the whole sieve config?

I don’t know what a “track delivery” is.

I’m also curious about what track delivery is?

SMTP error from remote mail server after RCPT TO:<myList@lists.custom_mayfirst_domain.org>: 450 4.3.2 Service currently unavailable

This is a normal error our mail server gives the first time it receives a connection from an unknown address. It essentially tells the mail server: I’m not accepting your message, try again later. When the mail server tries again later, it will accept the message. It’s a technique to fight spammers. I’m curious to know if the message eventually was delivered. And also, which server attempted the connection.

And lastly, you may need to send this support request privately via email to support [at] mayfirst.org with the precise messages, including the exact domain names so we can track what happened with the messages.

p.s. I don’t really understand the use case. why is an email notification without passing on the whole email the best solution?

Track Delivery is a feature of CPanel. I checked it just in case my own (recipient) domain was blocking an incoming email from the mayfirst.org mail server. That turned out to not be the issue, as far as I can tell. I mistakenly thought that might be related, but it seems unrelated.

Here is the Sieve script, with fake emails used:

require ["enotify"];
# rule:[NotifyOfRequest]
if allof (header :contains "subject" "New Request")
{
	notify :importance "2" :message "New Request" "mailto:person1@example.com?body=There%20is%20a%20new%20Request.%20%20Go%20to%20https%3A%2F%2Froundcube.mayfirst.org%20and%20log%20in%20to%20the%20webmail";
	notify :importance "2" :message "New Request" "mailto:person2@example.com?body=There%20is%20a%20new%20Request.%20%20Go%20to%20https%3A%2F%2Froundcube.mayfirst.org%20and%20log%20in%20to%20the%20webmail";
}

On previous attempts, I also had a custom “:from” tag, but removed that, in case it was part of the problem. I have not yet tried removing the body param appended to the “mailto”, although that has worked in the past. Also, strangely, it did work with only two recipients in an earlier test, so perhaps I’ve unwittingly broken something since that successful test?

Also, the use case here is that, since the notifications are being sent out to multiple email addresses, we do not want the full content of the original email to be sent into those other mail systems. We’d prefer the possibly sensitive details be kept in the original webmail account on MayFirst, not sent out to external (e.g. Google-managed) email accounts.

Wait. I think I may have found the mistake on my end. Will follow up soon.

Yeah. As part of my changes, I accidentally changed the subject-matching filter. So, the match wasn’t happening, which of course meant no notifications went out. PEBKAC here.

After fixing that, it works, with multiple recipients and a custom body. Here’s a sample of what worked:

require ["enotify"];
# rule:[NotifyOfRequest]
if allof (header :contains "subject" "New Request")
{
	notify :importance "2" :from "my_custom_account@mail.mayfirst.org" :message "New Request" "mailto:person1@example.com?body=There%20is%20a%20new%20Request.%20%20Go%20to%20https%3A%2F%2Froundcube.mayfirst.org%20and%20log%20in%20to%20the%20webmail";
	notify :importance "2" :from "my_custom_account@mail.mayfirst.org" :message "New Request" "mailto:person2@example.com?body=There%20is%20a%20new%20Request.%20%20Go%20to%20https%3A%2F%2Froundcube.mayfirst.org%20and%20log%20in%20to%20the%20webmail";
}

That sends to both recipients, from the “my_custom_account” (which I believe needs to be a real mayfirst.org account) and includes the customized URL-encoded body param in the mailto link.

Nice! Thanks for sharing what worked!