Hmail server rules failing

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
chuanDK
New user
New user
Posts: 3
Joined: 2020-12-08 14:43

Hmail server rules failing

Post by chuanDK » 2020-12-08 15:17

Hi Guys


I would like my server only to only accept mail from "no-reply@Mydomain.com" and then forward that mail to "distlist@Mydomain.com" without sending the email to the original receiver of the mail.
But only send the mail to the distlist@Mydomain.com

If the sender of the mail is not "no-reply@Mydomain.com" the server should delete the email.




I have tried to create this rule

from : equals : no-reply@Mydomain.com
to : equals: *

Actions:
Forward email to distlist@Mydomain.com
Delete email


I also tried to split the rules up.

from: equals : no-reply@Mydomain.com
to : not equals: distlist@Mydomain.com

Action Delete Email.

But is does not work.

any suggestions ?


Br

Christian

User avatar
SorenR
Senior user
Senior user
Posts: 4201
Joined: 2006-08-21 15:38
Location: Denmark

Re: Hmail server rules failing

Post by SorenR » 2020-12-08 15:25

change "equals" to "contains"

"From" is in the format

Code: Select all

"jens vejmand" <vejmand@trafikstyrelsen.dk>
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

chuanDK
New user
New user
Posts: 3
Joined: 2020-12-08 14:43

Re: Hmail server rules failing

Post by chuanDK » 2020-12-09 11:04

Hi Søren

Thanks for you reply. I really appreciate it :)

I tried tried to change the "equals" to "contains"

The result is that the original recipient of the mail and the distribution list receives the email.

But I would like to avoid that the original recipient receives the mail. So its just the distribution list that receives the email.


Du you have an idea how to solve that ?

Thanks in advance and best regards ¨

Christian

User avatar
SorenR
Senior user
Senior user
Posts: 4201
Joined: 2006-08-21 15:38
Location: Denmark

Re: Hmail server rules failing

Post by SorenR » 2020-12-09 11:43

This is how we normally do this... Configure it as a "global" rule.
X-hMailServer-LoopCount keep track of how many times an email is forwarded so we can prevent circular references.
.
rule.png
If original recipient still receive the email he/she must be on the distlist ...

PS. Yes, I know the rule on the image is not enabled ;-)
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

chuanDK
New user
New user
Posts: 3
Joined: 2020-12-08 14:43

Re: Hmail server rules failing

Post by chuanDK » 2020-12-09 14:55

Hi Søren

Great that did i !!

Thank you so much :D


Have a nice day

Best regards
Christian

Post Reply