Hello,

Apologies for my newbie question. I searched in forum but could not find the answer so requesting in new discussion.

I would like some users to restrict email delivery outside of internal domains as well as I can define some domain names or specific email IDs where they can only send emails.

If anyone has some guidance on it… pls guide.

  • Here is a working multimap if anyone wants to achieve it.

    restricted_local_senders {
    type = "combined";
    prefilter = true;
    regexp = true;
    action = "reject";
    rules {
    user {
    map = "/etc/rspamd/override.d/local_restricted_users.map";
    selector = "user";
    }
    rcpt = {
    map = "/etc/rspamd/override.d/allowed_domains_restricted_users.map";
    selector = "rcpts:domain";
    }
    }
    expression = "user & !rcpt"
    }

I tried with some combined map in RSPAMD like below:

restricted_local_senders {
  type = "combined";
  prefilter = true;
  regexp = true;
  action = "reject";
  rules {
    user {
      map = "/etc/rspamd/override.d/local_restricted_users.map";
      selector = "user";
    }
    rcpt = {
      map = "/etc/rspamd/override.d/allowed_domains_restricted_users.map";
      selector = "rcpts:domain";
    }
  }
  expression = "user & rcpt"
}

local_restricted_users.map contains internal user Email IDs and allowed_domains_restricted_users.map contains domains.

Well as Action is REJECT currently it is working fine.

Just want to know how can I make it reverse… like instead of reject it only allows sending of emails to specified domains. (Changing action to “accept” opens everything.)

Also raised the same query to rspamd if anyone helps (GitHub Icon Restricting local users to send emails to specific domains · rspamd/rspamd · Discussion #4407

)

Have something to say?

Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

20 days later

Here is a working multimap if anyone wants to achieve it.

restricted_local_senders {
type = "combined";
prefilter = true;
regexp = true;
action = "reject";
rules {
user {
map = "/etc/rspamd/override.d/local_restricted_users.map";
selector = "user";
}
rcpt = {
map = "/etc/rspamd/override.d/allowed_domains_restricted_users.map";
selector = "rcpts:domain";
}
}
expression = "user & !rcpt"
}

2 years later

This looks like what I want to do, but could someone help me understand how to use this? Like where in the mailcow server should I put this in, and where do I configure those .map files? I apologize for my ignorance, but I’ve been searching for a while with no luck.

No one is typing