Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flag external email #6084

Open
kvdb opened this issue Sep 19, 2024 · 3 comments
Open

Flag external email #6084

kvdb opened this issue Sep 19, 2024 · 3 comments

Comments

@kvdb
Copy link

kvdb commented Sep 19, 2024

Summary

Feature request

I would like to be able to enable the feature of flagging external email on a per-domain basis from the mailcow email configuration graphical interface.

Motivation

I manage a mailcow installations for a few coworker accounts. Not all of them are experienced internet users so I've been looking for a way to flag external mails. So far, people checked personally on requests to transfer money to a scammer on the Internet. (https://www.kaspersky.com/blog/how-to-spot-and-prevent-boss-scams/50861/)

Exisiting solutions

Microsoft users have had this feature for a long time already

Also, another helpful mailcow user wrote a script for this.
However, I don't feel comfortable pasting forum scripts in my rspamd config that have not been code-reviewed by a core developer.

Additional context

No response

@mac-linux-free
Copy link

That is a great idea.

@DerLinkman DerLinkman added this to the 2024 milestone Sep 19, 2024
@apio-sys
Copy link

Microsoft users have had this feature for a [long time already

That isn't really a reason... Microsoft doesn't filter DMARC rejects by default, so should we also do such things? Of course not IMHO.

The idea for the banner or subject flag is very good though. And I think you can easily do this with the Global sieve filter mechanism in place. Discussion on that topic here: https://community.mailcow.email/d/3185-email-caution-text/2 comes up with some good ideas. If you change the proposed Zimbra script a bit to say something like:

require["editheader"];
require["variables"];

# add an external domain header to all email not coming from our own domains
if allof(
  not address :domain :is ["from"] ["mydomain.com"],
  not header :contains "Subject" ["[External Email]"]
)
{
  addheader "X-External-Domain" "This Message originated outside of mind.";
  # Match the entire subject ...
  if header :matches "Subject" "*" {
     # ... to get it in a match group that can then be stored in a variable:
     set "subject" "${1}";
  }

  # We can't "replace" a header, but we can delete (all instances of) it and
  # re-add (a single instance of) it:
  deleteheader "Subject";
  # Append/prepend as you see fit
  addheader :last "Subject" "[External Email] ${subject}";
  # Note that the header is added ":last" (so it won't appear before possible
  # "Received" headers).

}

and save it as a pre-filter it will work to change the subject line. You can/should amend whatever is needed for your organization of course.

@samuelfranzini
Copy link
Contributor

Hello,

What's a shame is that it seems that the extracttext plugin is not available on Mailcow's Sieve, which prevents the banner from being added.

That said, if anyone has a solution to this problem, I'd love to hear from you.

Thanks,

/cc @apio-sys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants