-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hi Jerry,
Am Mi den 7. Jun 2017 um 2:55 schrieb Jerry Stuckle: > I'm kinda lost here. I have a perl script (call it xyz.pl) I need to > call from ACL processing (SPAM handling). The script returns the number > of days since the sending domain was registered or -1 if it can't be > determined. > > What I want is to call the script during ACL processing, and if the > domain has been registered less than 7 days (0 <= return value < 7), the > email is rejected. > > I have the script working, but having trouble figuring out how to call > it from Exim and handle the return code. And the more I go through the > docs, the more confused I get - Exim is just too powerful! The trick is that you don't implement a full script than just a function. in that function you can return whatever you want. It is more like a package than a standallone script. (But without package directive.) Then you use the following in your main config: perl_startup = do '/etc/exim4/exim.pl' That is starting /etc/exim4/exim.pl in the embedded perl interpreter. Pretty fast, to say. I had that in a big deployment with many million mails per day. After that you can use it in your ACL for example: contition = ${perl{my_pretty_function}{$whatever_I_want_to_say_to_the_function_as_argument}} or contition = ${perl{my_pretty_function}{$whatever_I_want_to_say_to_the_function_as_argument1}{$whatever_I_want_to_say_to_the_function_as_argument2}} In the perl file you can do whatever you want. Use modules, do some callouts, whatever. Regards Klaus - -- Klaus Ethgen http://www.ethgen.ch/ pub 4096R/4E20AF1C 2011-05-16 Klaus Ethgen <kl...@ethgen.ch> Fingerprint: 85D4 CA42 952C 949B 1753 62B3 79D0 B06F 4E20 AF1C -----BEGIN PGP SIGNATURE----- Comment: Charset: ISO-8859-1 iQGzBAEBCgAdFiEEMWF28vh4/UMJJLQEpnwKsYAZ9qwFAlk3r8UACgkQpnwKsYAZ 9qw+nwv/bRBTSIbGak8Sm7YqnbrBfIkKMdKzf2sdiYeEIPOylS4a4dzg2Kg8txH4 BpnUcHSSSIhV7YRtcF/DrpLLWhJ5ncbDmzo7tm2dIvK2OUK7BGrt3YVMef9dgpME v64ehJZemSjJzVqtNvMQ1VLne8BRqAQmX/ADfTgvX44Zt3A7stFFazvw9u+ssoE5 W2BoBObW+BFfu3o1jd0niAMg6/ACQESzwQD2lY8R27NMhvlRt3jrtStGg5vOMgE7 NQItjHwqiQGCW/CSgcjbgfZkfXJD67UafHyd4gAI0tAFLjglBhtnZizdAzf7ncLH /gWumViSbm3BfHwg2WA7v2yJM3JQ1e01BrFte6KZ++tUzKj8qxWJ+YxRMfZpoDpI 4ZFoze7FyzFWMo8GPwLwiNwg4ktgQnhVcV9yLkLjY0llAwBeKZDVcucruW1CtcmI mWVkCcakdsJJ9c9kD2mEKlDAoa5O9c5UUZg72bh7yyiuOY6Mqd3vm1brnil/oUfx ANmEIojn =k6pb -----END PGP SIGNATURE----- -- ## List details at https://lists.exim.org/mailman/listinfo/exim-users ## Exim details at http://www.exim.org/ ## Please use the Wiki with this list - http://wiki.exim.org/