Disallow users to send mail to the internet

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
andydld
New user
New user
Posts: 8
Joined: 2013-02-06 15:13
Location: Germany
Contact:

Disallow users to send mail to the internet

Post by andydld » 2013-02-06 15:43

Hi,

i just played around with rules to disallow some users to send mails outside our mail-domain.
It works great with single recipients, but with more then one recipient (name@ourdomain.tld; name@externaldomain.tld) it doesn't work.

Tested with hMS 5.3.3 (1879) and 5.4 (1945).

I definied a global rule like this:

Criteria: (Use AND)

From - contains - UsersMailAddress
To - Recipient list (tested with "To", too) - Not Contains - @OurMailDomain

Action:

Reply
Delete e-mail

Best regards,

Andy
www.andysblog.de

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Disallow users to send mail to the internet

Post by ^DooM^ » 2013-02-06 15:55

From - contains - UsersMailAddress
Recipient list Not Contains - OurMailDomain

Should work (dont use an @ symbol) and make sure it's a global rule.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

andydld
New user
New user
Posts: 8
Joined: 2013-02-06 15:13
Location: Germany
Contact:

Re: Disallow users to send mail to the internet

Post by andydld » 2013-02-06 16:10

It's a global rule and with no @-symbol it still not work correctly.

Tested with Thunderbird as mailclient (if that helps).

The order of the recipient-mailaddresses doesn't matter, too.
Tested with:

name@ourdomain.tld; name@externaldomain.tld

and

name@externaldomain.tld; name@ourdomain.tld
www.andysblog.de

User avatar
mattg
Moderator
Moderator
Posts: 21044
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Disallow users to send mail to the internet

Post by mattg » 2013-02-07 00:13

andydld wrote:It works great with single recipients, but with more then one recipient (name@ourdomain.tld; name@externaldomain.tld) it doesn't work.
Step through what you are asking...

FROM contains (=match)
Recipient list contains any non-local recipient (=match)

Then
reply and delete email

The only way to achieve the functionality you want for selected senders is via scripts
Here's one I prepared earlier (read the whole thread)
http://www.hmailserver.com/forum/viewto ... =9&t=17190
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

andydld
New user
New user
Posts: 8
Joined: 2013-02-06 15:13
Location: Germany
Contact:

Re: Disallow users to send mail to the internet

Post by andydld » 2013-02-07 09:38

Thanks for the answer.

Well, that's strange (i think), because with single recipients ("To" or "Recipient list") it works, only more then one recipient per mail doesn't work like expected.

Maybe it's a good feature request to add a possibility to accounts configuration to disallow users to send mails outside their own maildomain (like other mailservers do).
www.andysblog.de

User avatar
mattg
Moderator
Moderator
Posts: 21044
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Disallow users to send mail to the internet

Post by mattg » 2013-02-07 11:45

can be achieved with scripting (like most things in hMailsevrer) and a sample script provided.

This is unlikely to be added as a feature request, but if you wish to make a feature request for this, then please do so.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply