# # poprelayd-scanaddr - alternate versions of scanaddr # # This file contains alternate versions of poprelayd's scanaddr() # routine for use with other POP servers. (The original version is # for the University of Washington's pop3 and imap servers.) # # I (Curt Sampson) have not personally tested these; if you have any # problems I'd first check with the original author, and then send # updates to me. Additions to this file may also be sent to me; please # include your licensing terms and a URL pointing to the canonical # distribution of the server. My e-mail address is . # # Each routine has separate copyright and licensing terms described # in the comments before each routine. # # Berkeley in.pop3 # # Ben Nabors . # # Linux binaries are at ftp://ftp.scott.net/pub/linux/mail/. # This eventually turned into qpopper. I don't know who, if anyone, # is still maintaining in.pop3. # sub scanaddr ($) { my $s = $_[0]; my @paddrs; # Packed IP addresses. my @addrs; # ASCII addresses. my $junk; if ($s =~ m/pop3d\[[0-9]+\]: Servicing /) { #$s =~ s/.*\) (\S+) .*/\1/; ($trash,$s)=split(/\@ /,$s); push (@addrs,$s); return @addrs; } return (); } # qpopper 2.53, patched per http://spam.abuse.net/spam/tools/smPbS.html # # By Jan Gruber (jgruber@rz.htwk-leipzig.de) sub scanaddr ($) { my @addrs; # avoid hangs my $s = $_[0]; ($s =~ /.*?popper.*?POP login.*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/) && (push (@addrs,$1)); return @addrs; } # qpopper 2.53, patched per http://spam.abuse.net/spam/tools/smPbS.html # # By Tobias Barth # Based on the one by Jan Gruber (jgruber@rz.htwk-leipzig.de) # sub scanaddr ($) { local $s, $i, @adressen; $s = $_[0]; $i = index ($s,'popper'); undef @adressen; if ($i>=0){ ($s =~ /.*?popper.*?POP login.*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/) && (push (@adressen,$1)); } return @adressen; } # Cubic Circle POP3 daemon (cucipop) # # Sheldon Hearn # # Source available from # ftp://ftp.informatik.rwth-aachen.de/pub/packages/cucipop/ # sub scanaddr ($) { my $s = shift; # or $_[0] if you prefer my $ip; $s =~ /cucipop\[\d+\]:\s+\w+\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/; $ip = $1; if (defined($ip)) { return $ip; } else { return undef(); } }