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

add_header does not work with user settings #367

Closed
sandromello opened this issue Sep 16, 2015 · 6 comments
Closed

add_header does not work with user settings #367

sandromello opened this issue Sep 16, 2015 · 6 comments

Comments

@sandromello
Copy link

I have the following configuration in /etc/rspamd/common.conf

(...)

settings {

    mydomain {
        priority = high;
        rcpt = "@mydomain.tld";
        apply "default" {
                FORGED_OUTLOOK_TAGS = 2.5;
                actions {
                        reject = 100.0;
                        add_header = 2.0;
                };
        }
    }

}

The rule gets applied with success accordingly to logs:

2015-09-16 22:19:16 #23534(normal) settings.lua:198: <1073380318.329196.1442441954884.JavaMail.zimbra@mydomain.tld> apply settings according to rule mydomain
2015-09-16 22:19:16 #23534(normal) dns_callback: <1073380318.329196.1442441954884.JavaMail.zimbra@mydomain.tld domain [mydomain.tld.multi.uribl.com] is in surbl multi.uribl.com
2015-09-16 22:19:16 #23534(normal) dns_callback: <1073380318.329196.1442441954884.JavaMail.zimbra@mydomain.tld> domain [mydomain.tld.multi.uribl.com] is in surbl multi.uribl.com
2015-09-16 22:19:16 #23534(normal) dns_callback: <1073380318.329196.1442441954884.JavaMail.zimbra@mydomain.tld> domain [mydomain.tld.multi.uribl.com] is in surbl multi.uribl.com
2015-09-16 22:19:19 #23534(normal) rspamd_protocol_http_reply: id: <1073380318.329196.1442441954884.JavaMail.zimbra@mydomain.tld>, qid: <922DDD40F5>, (default: F (**no action**): [2.89/100.00] [HFILTER_HOSTNAME_UNKNOWN,R_SPF_ALLOW]), len: 6664, time: 2944.994ms real, 25.697ms virtual, dns req: 23, part: 3515AE54, part: 28021967

However the action add_header does not trigger. When I set the reject action it works.

Am I missing something?

I am using rspamd version 0.9.10 from this repo: https://launchpad.net/~dabbed/+archive/ubuntu/rspamd

@vstakhov
Copy link
Member

That should be fixed in the development branch which will be released soon.

@sandromello
Copy link
Author

Nice! Thank you for the quick response!

@sandromello
Copy link
Author

I've tested the new release (1.0.0), and it works with greylist now.

Using the action add_header still doesn't work. I did a fresh install for testing but without success.

# With greylist action
# /etc/rspamd/common.conf
settings {
    mydomainrule {
        priority = high;
        rcpt = "@mydomain.tld";
        apply "default" {
                actions {
                        reject = 50
                        greylist = 1
                }
        }
    }
}

# Logs
15-09-17 17:46:43 #28748(normal) <bbacc7>; task; rspamd_message_parse: loaded message; id: <255821221.487954.1442511998934.JavaMail.zimbra@mydomain.tld>; queue-id: <1730A22051>
2015-09-17 17:46:43 #28748(normal) <bbacc7>; lua; settings.lua:247: <255821221.487954.1442511998934.JavaMail.zimbra@mydomain.tld> apply settings according to rule mydomainrule
2015-09-17 17:46:43 #28748(normal) <bbacc7>; task; dns_callback: <255821221.487954.1442511998934.JavaMail.zimbra@mydomain.tld> domain [mydomain.tld.multi.uribl.com] is in surbl multi.uribl.com
2015-09-17 17:46:45 #28748(normal) <bbacc7>; task; rspamd_protocol_http_reply: id: <255821221.487954.1442511998934.JavaMail.zimbra@mydomain.tld>, qid: <1730A22051>, ip: 192.168.6.80, from: sandro.mello@mydomain.tld, (default: F (greylist): [2.89/50.00] [HFILTER_HOSTNAME_UNKNOWN,R_SPF_ALLOW]), len: 10186, time: 2211.696ms real, 37.543ms virtual, dns req: 24,

# With add_header action
# /etc/rspamd/common.conf
settings {
    mydomainrule {
        priority = high;
        rcpt = "@mydomain.tld";
        apply "default" {
                actions {
                        reject = 50
                        add_header = 1
                }
        }
    }
}

# Logs
2015-09-17 17:58:16 #2478(normal) <921729>; task; rspamd_message_parse: loaded message; id: <948693112.491556.1442512696672.JavaMail.zimbra@mydomain.tld>; queue-id: <85FFE22024>
2015-09-17 17:58:16 #2478(normal) <921729>; lua; settings.lua:247: <948693112.491556.1442512696672.JavaMail.zimbra@mydomain.tld> apply settings according to rule mydomainrule
2015-09-17 17:58:16 #2478(normal) <921729>; task; dns_callback: <948693112.491556.1442512696672.JavaMail.zimbra@mydomain.tld> domain [mydomain.tld.multi.uribl.com] is in surbl multi.uribl.com
2015-09-17 17:58:17 #2478(normal) <921729>; task; rspamd_protocol_http_reply: id: <948693112.491556.1442512696672.JavaMail.zimbra@mydomain.tld>, qid: <85FFE22024>, ip: 192.168.6.80, from: sandro.mello@mydomain.tld, (default: F (no action): [2.89/50.00] [HFILTER_HOSTNAME_UNKNOWN,R_SPF_ALLOW]), len: 11966, time: 1372.643ms real, 246.403ms virtual, dns req: 24,

@vstakhov
Copy link
Member

You need replace add_header with "add header" I'm afraid (with a space instead of underscore). I know that it's stupid, but it is a compatibility issue.

@sandromello
Copy link
Author

It's is working!
Maybe mentioning this at the documentation as example could help others.

Thanks!

@vstakhov
Copy link
Member

Updated.

rm-minus-rf pushed a commit to rm-minus-rf/rspamd that referenced this issue Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants