{"action":"opened","issue":{"url":"https://api.github.com/repos/fmbla/spamassassin-olemacro/issues/1","repository_url":"https://api.github.com/repos/fmbla/spamassassin-olemacro","labels_url":"https://api.github.com/repos/fmbla/spamassassin-olemacro/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/fmbla/spamassassin-olemacro/issues/1/comments","events_url":"https://api.github.com/repos/fmbla/spamassassin-olemacro/issues/1/events","html_url":"https://github.com/fmbla/spamassassin-olemacro/issues/1","id":374671551,"node_id":"MDU6SXNzdWUzNzQ2NzE1NTE=","number":1,"title":"Cannot set olemacro regex options","user":{"login":"Gazoo","id":379016,"node_id":"MDQ6VXNlcjM3OTAxNg==","avatar_url":"https://avatars3.githubusercontent.com/u/379016?v=4","gravatar_id":"","url":"https://api.github.com/users/Gazoo","html_url":"https://github.com/Gazoo","followers_url":"https://api.github.com/users/Gazoo/followers","following_url":"https://api.github.com/users/Gazoo/following{/other_user}","gists_url":"https://api.github.com/users/Gazoo/gists{/gist_id}","starred_url":"https://api.github.com/users/Gazoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gazoo/subscriptions","organizations_url":"https://api.github.com/users/Gazoo/orgs","repos_url":"https://api.github.com/users/Gazoo/repos","events_url":"https://api.github.com/users/Gazoo/events{/privacy}","received_events_url":"https://api.github.com/users/Gazoo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-27T17:57:42Z","updated_at":"2018-10-27T17:57:42Z","closed_at":null,"author_association":"NONE","body":"I was testing this plugin and it looks like there is a bug with any of the regex config options. The `is_delimited_regexp_valid` method is called and it expects the value to be wrapped in proper delimiters (which it is not). Also you can't just set the delimiters to the config lines as they are already wrapped in delimiters though out the code (so they would be double wrapped). The fix would be to just wrap them when passing them into the `is_delimited_regexp_valid` method.\r\n\r\nTo test just set the defaults in `local.cf`:\r\n```\r\nifplugin Mail::SpamAssassin::Plugin::OLEMacro\r\nolemacro_max_file 512000\r\nolemacro_num_mime 5\r\nolemacro_num_zip 5\r\nolemacro_zip_depth 2\r\nolemacro_extended_scan 0\r\nolemacro_exts (?:doc|dot|pot|ppa|pps|ppt|sldm|xl|xla|xls|xlt|xslb)$\r\nolemacro_macro_exts (?:docm|dotm|ppam|potm|ppst|ppsm|pptm|sldm|xlm|xlam|xlsb|xlsm|xltm)$\r\nolemacro_zips (?:zip)$\r\nolemacro_skip_exts (?:docx|dotx|potx|ppsx|pptx|sldx|xlsx|xltx)$\r\nolemacro_skip_ctypes ^(?:(audio|image|text)\\/|application\\/(?:pdf))\r\nolemacro_prefer_contentdisposition 1\r\nendif\r\n```\r\n\r\nRestarting Spamassassin:\r\n```\r\nOct 27 11:14:48 el7p17 spamd[17633]: config: invalid regexp for rule TESTING: (?:doc|dot|pot|ppa|pps|ppt|sldm|xl|xla|xls|xlt|xslb)$: missing or invalid delimiters\r\nOct 27 11:14:48 el7p17 spamd[17633]: config: SpamAssassin failed to parse line, \"(?:doc|dot|pot|ppa|pps|ppt|sldm|xl|xla|xls|xlt|xslb)$\" is not valid for \"olemacro_exts\", skipping: olemacro_exts (?:doc|dot|pot|ppa|pps|ppt|sldm|xl|xla|xls|xlt|xslb)$\r\nOct 27 11:14:48 el7p17 spamd[17633]: config: invalid regexp for rule TESTING: (?:docm|dotm|ppam|potm|ppst|ppsm|pptm|sldm|xlm|xlam|xlsb|xlsm|xltm)$: missing or invalid delimiters\r\nOct 27 11:14:48 el7p17 spamd[17633]: config: SpamAssassin failed to parse line, \"(?:docm|dotm|ppam|potm|ppst|ppsm|pptm|sldm|xlm|xlam|xlsb|xlsm|xltm)$\" is not valid for \"olemacro_macro_exts\", skipping: olemacro_macro_exts (?:docm|dotm|ppam|potm|ppst|ppsm|pptm|sldm|xlm|xlam|xlsb|xlsm|xltm)$\r\nOct 27 11:14:48 el7p17 spamd[17633]: config: invalid regexp for rule TESTING: (?:zip)$: missing or invalid delimiters\r\nOct 27 11:14:48 el7p17 spamd[17633]: config: SpamAssassin failed to parse line, \"(?:zip)$\" is not valid for \"olemacro_zips\", skipping: olemacro_zips (?:zip)$\r\nOct 27 11:14:48 el7p17 spamd[17633]: config: invalid regexp for rule TESTING: (?:docx|dotx|potx|ppsx|pptx|sldx|xlsx|xltx)$: missing or invalid delimiters\r\nOct 27 11:14:48 el7p17 spamd[17633]: config: SpamAssassin failed to parse line, \"(?:docx|dotx|potx|ppsx|pptx|sldx|xlsx|xltx)$\" is not valid for \"olemacro_skip_exts\", skipping: olemacro_skip_exts (?:docx|dotx|potx|ppsx|pptx|sldx|xlsx|xltx)$\r\nOct 27 11:14:48 el7p17 spamd[17633]: config: invalid regexp for rule TESTING: ^(?:(audio|image|text)\\/|application\\/(?:pdf)): missing or invalid delimiters\r\nOct 27 11:14:48 el7p17 spamd[17633]: config: SpamAssassin failed to parse line, \"^(?:(audio|image|text)\\/|application\\/(?:pdf))\" is not valid for \"olemacro_skip_ctypes\", skipping: olemacro_skip_ctypes ^(?:(audio|image|text)\\/|application\\/(?:pdf))\r\n```\r\n\r\n"}}
{"actor":{"display_login":"Gazoo"}}