Daryl C. W. O'Shea wrote:


Yeah, -notfirsthop is good for lists that list known zombies, open relays, and crap like that. Generic dynamic lists are better off as -lastexternal to avoid FPs (I know of lots of businesses that are forced to smarthost their mail through Bell's MSAs due to SORBS listings of static connections because of Bell's crappy rDNS naming scheme).



Is there an SA function that will just return an array of Relays that fit a given one of these criteria? Such as:

@relays = get_relays(options);


where options is a comma delimited string of words like:
   Trusted      - include a given relay if it is trusted
   Untrusted    - include a relay if it is untrusted
   External     - include a relay if it is external
   Internal     - include a relay if it is internal
   LastExternal - do NOT include the relay if it is NOT the
                  most recent external relay
   NotFirstHop  - do NOT include the relay if there are multiple
                  relays and this one was the least recent relay

and the returned relay array meets the specified criteria, and contains the same data about the relays that are in the pseudo-headers?

An SA function, particularly a PerMsgStatus method, that did something like this would be VERY useful.


So, if I'm writing a plugin, and I want to get the last external relay, I can just do:

$relay = shift($pms->get_relays("LastExternal"));

or if I wanted to say "don't do this stuff if there were trusted relays":

unless ($pms->get_relays("Trusted")) {
   #do stuff
   }

Reply via email to