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

custom_vars in scenarios #845

Closed
scheff opened this issue Jan 21, 2020 · 3 comments · Fixed by #847
Closed

custom_vars in scenarios #845

scheff opened this issue Jan 21, 2020 · 3 comments · Fixed by #847
Labels
Milestone

Comments

@scheff
Copy link

scheff commented Jan 21, 2020

Sympa is comlaining about scenarios with rules like this

match([sender],/[custom_vars->sender_whitelist]/)             smtp,dkim,md5,smime  -> do_it
match([msg_header->To],/[custom_vars->recipient_whitelist]/)  smtp,dkim,md5,smime  -> do_it

Version

Sympa 6.2.52

Installation method

From source

Expected behavior

custom_vars should be usable in scenario rules as in prior versions of Sympa up to 6.2.44

Actual behavior

when using a custom_var in a scenario it's not possible to open any page belonging a list using a sceanario that contains an affected rule. Instead of the content of the page the following traceback is shown:

Internal Server Error

Sympa encountered an internal error.

Please contact the listmaster.

Error: Invalid [] range "s->" in regex; marked by <-- HERE in m/[custom_vars-> <-- HERE {sender_whitelist}]/ at (eval 989) line 1.
Traceback

DIED: Invalid [] range "s->" in regex; marked by <-- HERE in m/[custom_vars-> <-- HERE {sender_whitelist}]/ at (eval 989) line 1.
 at (eval 989) line 1.
	eval 'qr\'[custom_vars->{sender_whitelist}]\'' called at /usr/local/sympa/bin/Sympa/Scenario.pm line 686
	Sympa::Scenario::_compile_condition(HASH(0x563c4be355e8)) called at /usr/local/sympa/bin/Sympa/Scenario.pm line 613
	Sympa::Scenario::_compile_rule(HASH(0x563c4be355e8)) called at /usr/local/sympa/bin/Sympa/Scenario.pm line 576
	Sympa::Scenario::_compile_scenario(Sympa::List <000-testliste-2@...>, 'send', HASH(0x563c4ba8ba98)) called at /usr/local/sympa/bin/Sympa/Scenario.pm line 245
	Sympa::Scenario::compile(Sympa::List <000-testliste-2@l...>, 'title.gettext Testversion - Alle - Aber Nachrichten muessen f...', 'function', 'send', 'file_path', '/usr/local/sympa/etc/scenari/send.03b.editorkeyonly-test') called at /usr/local/sympa/bin/Sympa/Scenario.pm line 218
	Sympa::Scenario::new('Sympa::Scenario', Sympa::List <000-testliste-2@...>, 'send') called at /usr/local/sympa/bin/wwsympa.fcgi line 2595
	main::check_param_in() called at /usr/local/sympa/bin/wwsympa.fcgi line 1503

Additional information

OS: Debian GNU/Linux 9.11 (stretch)
Perl: 5.24.1-3+deb9u5

@ikedas
Copy link
Member

ikedas commented Jan 22, 2020

Hi @scheff ,

  • Interpolation in regexp is not possible on 6.2.52. ...Anyway, it has not been documented and seems not feature but side-effect of sloppy code. Please fix the scenario as:
    match([sender],[custom_vars->sender_whitelist])               smtp,dkim,md5,smime  -> do_it
    
  • Also, please apply thease patches (1) and (2) to fix some bugs.

And afterward, could you please check if reported bug will be solved?

@scheff
Copy link
Author

scheff commented Jan 22, 2020

Hi ikedas,

changing the rules from

match([sender],/[custom_vars->sender_whitelist]/) smtp,dkim,md5,smime -> do_it

to

match([sender],[custom_vars->sender_whitelist]) smtp,dkim,md5,smime -> do_it

solved the issue. :-)

Thank you and best regards

Thomas

@scheff scheff closed this as completed Jan 22, 2020
@ikedas
Copy link
Member

ikedas commented Jan 23, 2020

@scheff , thanks for confirmation!

@ikedas ikedas added this to the 6.2.54 milestone Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants