Page 1 of 1

Add Domain\Country Restrictions in user account like MDaemon.

Posted: 2020-01-15 19:55
by hjbg1976
I would like if it is possible to add in hMail the function or feature that allows you to configure filtering by inbound and outbound domains\countries at the mailbox or email account level, as Alt-N Mdaemon satisfactorily does in the part of restrictions on mailbox configuration, all reflected in the guardian.dat file in the \ mdaemon\app folder. Any clue or suggestions please.

Below I give an example of how it looks more or less in this configuration file (of course I would like it to be seen with a graphical interface)

The example in question denies access to all domains except for all those ending in *.xx

[test@domain.xx-Outbound]
Action=Returned to sender
Restrict=Yes
Address0=*.xx
[test@domain.xx-Outbound]
Action=Returned to sender
Restrict=Yes
Address0=*.xx

Re: Add Domain\Country Restrictions in user account like MDaemon.

Posted: 2020-01-15 21:15
by palinka
This can be done with account rules. No scripting required, unless you want to get really fancy.

For ".xx", ".cn", ".co.uk"

IF: To [regular expression] = ^.*([a-zA-Z0-9-]{2,253}\.(xx|cn|co.uk))>?$
THEN: delete email, or forward or whatever

Re: Add Domain\Country Restrictions in user account like MDaemon.

Posted: 2020-01-15 23:26
by mattg
OR

use zz.countries.nerd.dk as a DNSBL and score appropriately if you want to use GeoLocation data, rather than rely on domain naming conventions

Re: Add Domain\Country Restrictions in user account like MDaemon.

Posted: 2020-01-16 00:13
by palinka
He doesn't want to do scripting. But yes, geoip is absolutely a better option. More accurate and more flexible.

On second look, you could trim the regex down to this: ^.*(xx|cn|co.uk)>?$

I guess I was thinking finding domains when all I needed was TLDs.

Re: Add Domain\Country Restrictions in user account like MDaemon.

Posted: 2020-01-16 03:57
by mattg
Setting up a DNSBL doesn't use scripting