• filter.pl

    From Avon@21:1/101 to All on Sun Apr 25 19:57:23 2021
    Can someone point me to a basic example if this?

    Trying to figure out how to add the PING function in.

    PING docs say use it by

    sub filter{
    if ( !defined( $area ) ) {
    ping_pong( $fromname, $fromaddr, $toname, $toaddr, $subject, $text );
    }
    }

    so do I just add that to the filter.pl file?

    Up until not I have not got filter.pl working. I did have some code I'd got from Deon at the start of setting up HPT but it never worked from memory so I commented filter.pl out of the config file.

    I can see a filter.pl in the hpt repo so would I be best to copy that in and enable it?

    I'm trying to figure out how to enable something without turning on stuff or opening stuff up that I don't realise what I am doing / risking issues.

    --- Mystic BBS v1.12 A46 2020/08/26 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Al@21:4/106 to Avon on Sun Apr 25 01:05:37 2021
    Hello Avon,

    Can someone point me to a basic example if this?

    Trying to figure out how to add the PING function in.

    PING docs say use it by

    sub filter{
    if ( !defined( $area ) ) {
    ping_pong( $fromname, $fromaddr, $toname, $toaddr, $subject, $text );
    }
    }

    so do I just add that to the filter.pl file?

    Yes, just for a look here is my filter.pl that I placed beside hpt and pingpong.pm in /usr/local/bin.


    ==== Begin: "filter.pl" ====
    use pingpong;

    sub filter{
    if ( !defined( $area ) ) {
    ping_pong( $fromname, $fromaddr, $toname, $toaddr, $subject, $text );
    }
    }

    sub route{
    return route_to();
    }
    ==== End: "filter.pl" ====

    I can see a filter.pl in the hpt repo so would I be best to copy that
    in and enable it?

    I have not, it is vastly to complex for me but it is full of goodies.

    I'm trying to figure out how to enable something without turning on
    stuff or opening stuff up that I don't realise what I am doing /
    risking issues.

    You also need this is your main fido config file.

    hptperlfile /usr/local/bin/filter.pl

    At this point your hpt will look for messages to ping when you run hpt toss and reply to them.

    Ttyl :-),
    Al

    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: The Rusty MailBox - Penticton, BC Canada (21:4/106)
  • From Avon@21:1/101 to Al on Sun Apr 25 20:23:21 2021
    On 25 Apr 2021 at 01:05a, Al pondered and said...

    so do I just add that to the filter.pl file?

    Yes, just for a look here is my filter.pl that I placed beside hpt and pingpong.pm in /usr/local/bin.

    thanks for this info Al.

    OK so by the looks of it I need to become root and copy the pingpong.pm over
    to the same path here

    In my case I have filter.pl in another directory

    You also need this is your main fido config file.

    hptperlfile /usr/local/bin/filter.pl

    This I will change but point to the location of the filter.pl I am using. Do
    I need to set execute privs for the filter.pl file? Guessing yes?

    I can see a filter.pl in the hpt repo so would I be best to copy that in and enable it?

    I have not, it is vastly to complex for me but it is full of goodies.

    OK thanks. I'll start small (which is my pref) and see if I can just build
    the filter.pl using the PING function first.

    At this point your hpt will look for messages to ping when you run hpt toss and reply to them.

    I'm on my way now, thanks... not sure if all the bits are in place but
    working on it. :)

    --- Mystic BBS v1.12 A46 2020/08/26 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Avon@21:1/101 to Al on Sun Apr 25 20:50:56 2021
    On 25 Apr 2021 at 01:05a, Al pondered and said...

    At this point your hpt will look for messages to ping when you run hpt toss and reply to them.

    OK got it working but not happy with the %links feature and noted I could set
    a level for trusted links that is at X or higher. The niggle for me is I have
    a number of nodes set higher for various things but not all I want to use as trusted for routing PING netmails. I may ask if the feature can be updated
    such that a specific level can be set as opposed to X and above.

    --- Mystic BBS v1.12 A46 2020/08/26 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Al@21:4/106 to Avon on Sun Apr 25 01:43:31 2021
    Hello Avon,

    OK so by the looks of it I need to become root and copy the
    pingpong.pm over to the same path here

    That is where I have mine and it is working. The docs say to put it somewhere in the @INC path but I don't know what that means.

    In my case I have filter.pl in another directory

    That may work also, I am not sure.

    This I will change but point to the location of the filter.pl I am
    using. Do I need to set execute privs for the filter.pl file? Guessing yes?

    I am not sure. I made those files executible just to be on the safe side.

    OK thanks. I'll start small (which is my pref) and see if I can just
    build the filter.pl using the PING function first.

    That is what I have done. I had a look at Deon's filter-route.pl also but it is over my head so we'll have to talk to him about making that work.

    At this point your hpt will look for messages to ping when you
    run hpt toss and reply to them.

    I'm on my way now, thanks... not sure if all the bits are in place but working on it. :)

    Yes, those are the only steps I needed. You can send netmail to 21:4/106 addressed to ping to see if it works. I've done some testing in fido and it seems to work well but no testing in zone 21 yet.

    I did make a small change as Stas suggested to add the PVT flag to netmail.

    Ttyl :-),
    Al

    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: The Rusty MailBox - Penticton, BC Canada (21:4/106)
  • From Avon@21:1/101 to Al on Sun Apr 25 20:53:34 2021

    I wonder if where I see >= I just set it to = ?

    if ( $subj =~ /\%RouteTo\: (\d\:\d+\/\d+)/i) {
    w_log( "\'\%RouteTo\:\' command found." );
    if ( defined $links{$1}{password} &&
    $links{$1}{level} >= $m_level ) {
    $addline = "\r\%RouteTo\: $1\r" if $secure == 1;
    } else {
    $addline = "\r$1 isn't my password protecded link. '%RouteTo\: $1' command was ignored.\r";
    w_log("$1 isn't protecded link. \'\%RouteTo\: $1\' command was not accepted.");
    }
    }
    if ( $subj =~ /\%Links/i) {
    $addline .= "My links are:\r~~~~~~~~~~~~~\r";
    foreach my $key( sort keys %links) {
    $addline .= sprintf("%-20s", $key) .
    "$links{$key}{name}\r" if defined $links{$key}{password} &&
    $key =~ /^\d+\:\d+\/\d+$/ &&
    $links{$key}{name} !~ /Our virtual lin/i &&
    $links{$key}{level} >= $m_level;

    --- Mystic BBS v1.12 A46 2020/08/26 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Al@21:4/106 to Avon on Sun Apr 25 01:52:30 2021
    Hello Avon,

    OK got it working but not happy with the %links feature and noted I
    could set a level for trusted links that is at X or higher. The niggle
    for me is I have a number of nodes set higher for various things but
    not all I want to use as trusted for routing PING netmails.

    If you want to disable the routeto feature you can comment out or remove the last three lines of the filter.pl.

    You can also comment out the help text in the pingpong.pm so the replies don't mention it.

    I may ask if the feature can be updated such that a specific level can
    be set as opposed to X and above.

    There is a way to do that I am sure. Best to ask Stas and see what he has to say.

    Ttyl :-),
    Al

    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: The Rusty MailBox - Penticton, BC Canada (21:4/106)
  • From Avon@21:1/101 to Al on Sun Apr 25 20:59:10 2021
    On 25 Apr 2021 at 01:43a, Al pondered and said...

    OK so by the looks of it I need to become root and copy the pingpong.pm over to the same path here

    That is where I have mine and it is working. The docs say to put it somewhere in the @INC path but I don't know what that means.

    I found out I could add it to where my main husky config file was, HPT was showing error messages but helpfully it also showed where @INC was looking to find files from and displayed several paths :)

    In my case I have filter.pl in another directory

    That may work also, I am not sure.

    Yep it did :)

    This I will change but point to the location of the filter.pl I am using. Do I need to set execute privs for the filter.pl file? Guessin yes?

    I am not sure. I made those files executible just to be on the safe side.

    I did not and they worked. I think because they are perl based and perl is already installed on the box. Just a guess on my part.

    OK thanks. I'll start small (which is my pref) and see if I can just build the filter.pl using the PING function first.

    That is what I have done. I had a look at Deon's filter-route.pl also
    but it is over my head so we'll have to talk to him about making that work.

    Same. I got lost at the first turn :)

    I'm on my way now, thanks... not sure if all the bits are in place bu working on it. :)

    Yes, those are the only steps I needed. You can send netmail to 21:4/106 addressed to ping to see if it works. I've done some testing in fido and it seems to work well but no testing in zone 21 yet.

    I've just disabled it again until I can nail the preferred links it returns
    but then it should be running and I'll need to add in some new flags into the Fido and fsxNet nodelists :)

    I did make a small change as Stas suggested to add the PVT flag to netmail.

    Yes I should do that to, was PVT the only one to add?

    --- Mystic BBS v1.12 A46 2020/08/26 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Al@21:4/106 to Avon on Sun Apr 25 01:57:13 2021
    Hello Avon,


    I wonder if where I see >= I just set it to = ?

    You want to remove the help text from the ping replies?

    I would comment out lines 169 through 180 with # and that text will not be included in replies.

    Ttyl :-),
    Al

    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: The Rusty MailBox - Penticton, BC Canada (21:4/106)
  • From Avon@21:1/101 to Al on Sun Apr 25 21:03:56 2021
    On 25 Apr 2021 at 01:57a, Al pondered and said...

    Hello Avon,


    I wonder if where I see >= I just set it to = ?

    You want to remove the help text from the ping replies?

    No I am thinking I modify a logical check in the code of the $m_level variable so it changes from 'greater than or equal to' which is >= to just 'equal to'
    =

    Doing so I think will solve my problem. I think :)

    --- Mystic BBS v1.12 A46 2020/08/26 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Avon@21:1/101 to Al on Sun Apr 25 21:06:06 2021
    On 25 Apr 2021 at 01:43a, Al pondered and said...

    I did make a small change as Stas suggested to add the PVT flag to netmail.

    so something like...

    ping_pong( $fromname, $fromaddr, $toname, $toaddr, $subject,
    $text, $PVT, 100 );

    set PVT and access levels 100 or greater

    --- Mystic BBS v1.12 A46 2020/08/26 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Al@21:4/106 to Avon on Sun Apr 25 02:14:41 2021
    Hello Avon,

    No I am thinking I modify a logical check in the code of the $m_level variable so it changes from 'greater than or equal to' which is >= to
    just 'equal to' =

    Doing so I think will solve my problem. I think :)

    It very well might, just have to try and see if it does what you need it to do.

    I am no programmer of any language at all, so I couldn't say. :)

    Ttyl :-),
    Al

    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: The Rusty MailBox - Penticton, BC Canada (21:4/106)
  • From Avon@21:1/101 to Al on Sun Apr 25 21:19:05 2021
    On 25 Apr 2021 at 02:14a, Al pondered and said...

    I am no programmer of any language at all, so I couldn't say. :)

    neither am I but after tonight I may just talk myself into it :)

    --- Mystic BBS v1.12 A46 2020/08/26 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Al@21:4/106 to Avon on Sun Apr 25 02:20:04 2021
    Hello Avon,

    so something like...

    ping_pong( $fromname, $fromaddr, $toname, $toaddr, $subject,
    $text, $PVT, 100 );

    set PVT and access levels 100 or greater

    This is line 135 and 136 in pingpong.pm

    ==== Begin: "1.txt" ====
    $m_attr = 0 unless defined $m_attr;
    $m_level = 0 unless defined $m_level;
    ==== End: "1.txt" ====

    I changed them to this..

    $m_attr = $PVT unless defined $m_attr;
    $m_level = 100 unless defined $m_level;

    So now I get the PVT flag and a list of nodes with level 100.

    I think you can make the first line $PVT+K_S if you want K/S as well.

    I wasn't sure of the best way to do that but that is working as intended. It looks like I can define $m_attr; but I am not sure how to do that.

    Ttyl :-),
    Al

    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: The Rusty MailBox - Penticton, BC Canada (21:4/106)
  • From Avon@21:1/101 to Al on Sun Apr 25 22:02:49 2021
    On 25 Apr 2021 at 02:20a, Al pondered and said...

    Hello Avon,
    I changed them to this..

    $m_attr = $PVT unless defined $m_attr;
    $m_level = 100 unless defined $m_level;

    Thanks, I have taken a different route and have defined things in the
    filter.pl

    ping_pong( $fromname, $fromaddr, $toname, $toaddr, $subject, $text,
    $PVT, 123);

    and in the code have set line 145 to

    $links{$1}{level} == $m_level ) {

    and set line 159 to

    $links{$key}{level} == $m_level;

    so links with a level = 123 only show now... well that's seems to be the case.

    I am also playing with the help file as I wanted to tweak the layout and info.

    What I am unsure of is if you add route to links for different zones how will the system behave if your netmail is from Zone 21 aka and you ask it to route via a Zone 3 system? Hmm

    --- Mystic BBS v1.12 A46 2020/08/26 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Al@21:4/106 to Avon on Sun Apr 25 03:13:14 2021
    Hello Avon,

    Thanks, I have taken a different route and have defined things in the filter.pl

    ping_pong( $fromname, $fromaddr, $toname, $toaddr, $subject,
    $text, $PVT, 123);

    Aha! I think that is probably what Stas had in mind so I will change my setup like that also.

    I am also playing with the help file as I wanted to tweak the layout
    and info.

    I have been commenting and uncommenting that text. I can't decide if I want it there or not so I have it commented out for now but the %RouteTo in the subject line is working.

    What I am unsure of is if you add route to links for different zones
    how will the system behave if your netmail is from Zone 21 aka and you
    ask it to route via a Zone 3 system? Hmm

    It does seem to work well from what I have seen. I just sent a ping to 21:4/106 from 106.1 and it worked as expected and replied from zone 21.

    I also sent a ping to 1:153/757 from 757.2 this past week and I asked it to route the reply via 3:770/1. It came back about 15 minutes later after taking 4 or five hops around New Zealand and the US. :)

    Your node is one of the nodes listed if someone puts %Links in the subject line so it's possible you may see pings travelling through your node at times.

    I never thought of it at the time but I am going to add 21:1/100, 3/100 and 4/100 to that list, so some pings could be seen if someone chooses that route.

    Ttyl :-),
    Al

    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: The Rusty MailBox - Penticton, BC Canada (21:4/106)
  • From deon@21:2/116 to Al on Sun Apr 25 20:24:33 2021
    Re: filter.pl
    By: Al to Avon on Sun Apr 25 2021 01:43 am

    Howdy,

    That is what I have done. I had a look at Deon's filter-route.pl also but it is over my head so we'll have to talk to him about
    making that work.

    Yeah, it is a little complex. :)

    I cant take credit for it - I found it somewhere, but adapted it with my filter.pl.

    My filter.pl is also based on something I found (probably the one from hpt). But its where I have all the "configuration" with all the filter-*.pl having the logic. I've just noticed some config stuff that should go into my filter.pl, so I'll make some changes to it.

    ...лоеп

    ... War will cease when men refuse to fight.
    --- SBBSecho 3.14-Linux
    * Origin: I'm playing with ANSI+videotex - wanna play too? (21:2/116)
  • From Avon@21:1/101 to Al on Sun Apr 25 22:35:56 2021
    On 25 Apr 2021 at 03:13a, Al pondered and said...

    I have been commenting and uncommenting that text. I can't decide if I want it there or not so I have it commented out for now but the %RouteTo in the subject line is working.

    I can't seem to get mine to respond to the %command ... not sure why, it's rather frustrating. I have the correct syntax in the filter I think. It's just

    sub route{
    return route_to();
    }

    sitting below the chunk of text set for the filter...

    for every %RouteTo: x:x/x attempt I try it replies to me and does not route
    the netmail away. Nor do the logs in HPT show that %RouteTo: command found
    ... only Ping message detected.. it's a bit weird.

    I wonder if it's because I messed with the code? But in that area I did not touch it. I think :)

    --- Mystic BBS v1.12 A46 2020/08/26 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Avon@21:1/101 to Al on Sun Apr 25 22:42:50 2021
    Heading off to catch some zzzz.

    I'll leave the function running... but I think the RouteTo is not working.
    But if you (or anyone) want's to test the feature then you should be able to get a reply out of 21:1/100 or 3:770/1 - I think :)

    Let me know :)

    --- Mystic BBS v1.12 A46 2020/08/26 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Al@21:4/106.1 to Avon on Sun Apr 25 04:10:56 2021
    Re: Re: filter.pl
    By: Avon to Al on Sun Apr 25 2021 10:42 pm

    I'll leave the function running... but I think the RouteTo is not working. But if you (or anyone) want's to test the feature then you should be able to get a reply out of 21:1/100 or 3:770/1 - I think :)

    Let me know :)

    Yes, it is working. I have pinged both you and Deon and got the replies.

    I am going to do it again and ask it to route yours through Deon and Deon's through you. That should get me a ping and trace each.

    Ttyl :-),
    Al

    ... Our program, who art in memory. EXE be thy name.
    --- SBBSecho 3.14-Linux
    * Origin: The Rusty MailBox - Penticton, BC Canada (21:4/106.1)
  • From Al@21:4/106.1 to deon on Sun Apr 25 04:30:55 2021
    Re: filter.pl
    By: deon to Al on Sun Apr 25 2021 08:24 pm

    That is what I have done. I had a look at Deon's filter-route.pl
    also but it is over my head so we'll have to talk to him about
    making that work.

    Yeah, it is a little complex. :)

    Yes, it is.. :)

    I'll hit you up about that after my head clears. ;)

    Ttyl :-),
    Al

    ... What?! I'm missing Star Tre$#%$^ NO CARRIER
    --- SBBSecho 3.14-Linux
    * Origin: The Rusty MailBox - Penticton, BC Canada (21:4/106.1)
  • From Al@21:4/106.1 to Avon on Sun Apr 25 04:37:06 2021
    Re: Re: filter.pl
    By: Avon to Al on Sun Apr 25 2021 10:42 pm

    I'll leave the function running... but I think the RouteTo is not working.

    I think you are right. %RouteTo: was working for me, I routed a ping towards 3:770/1 but that may have been before Stas's recent upgrade. I still have the previous version so I'll give it a try and see if there is a difference.

    But if you (or anyone) want's to test the feature then you should be able to get a reply out of 21:1/100 or 3:770/1 - I think :)

    Ping/Trace is working anyway. I got trace replies from 21:4/106 when I pinged you from 106.2.

    Ttyl :-),
    Al

    ... You don't get once-in-a-lifetime offers like this every day.
    --- SBBSecho 3.14-Linux
    * Origin: The Rusty MailBox - Penticton, BC Canada (21:4/106.1)