Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sympa
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
29
Issues
29
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
riseup
sympa
Commits
876795c6
Commit
876795c6
authored
Aug 08, 2019
by
taggart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial version of script to find subscriptions in a domain that seem to be bad
parent
c326fbce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
tools/findoldbounce
tools/findoldbounce
+53
-0
No files found.
tools/findoldbounce
0 → 100755
View file @
876795c6
#!/usr/bin/perl -w
# findoldbounce - for a given domain, list the subscribers that have been
# bouncing for a long time
# NOTE: this script requires the current user has read access to the db
# Matt Taggart <taggart@riseup.net> 2019-08
my
$score
=
20
;
# today minus 6 months
my
$time
=
`
date +%s
`
-
15768000
;
my
$code
=
"
5.1.1
";
# things we might remove:
# if firstbounce is 6 months old and the bounce code is 5.1.1 and the bounce score is >15
my
$listsql
=
q(mysql -N --batch --database=sympa --execute "select user_subscriber, bounce_subscriber from subscriber_table WHERE bounce_subscriber <> 'NULL'")
;
if
(
!
$ARGV
[
0
]
)
{
print
"
usage: findoldbounce <domain>
\n
";
exit
1
;
}
my
$target
=
$ARGV
[
0
];
print
"
$target
\n
";
open
(
LISTDUMP
,
"
$listsql
|
")
or
die
"
cannot get dump of address+bounce pairs from database
\n
";
while
(
<
LISTDUMP
>
)
{
chomp
;
# match sane address and list
m/^<?(.*\@(.*?))>?\s*\t(.*) (.*) (.*) (.*)$/
;
my
$address
=
$1
;
my
$domain
=
$2
;
my
$firstbounce
=
$3
;
my
$lastbounce
=
$4
;
my
$bouncescore
=
$5
;
my
$bouncecode
=
$6
;
#print "$address $domain $firstbounce $lastbounce $bouncescore $bouncecode\n";
if
(
$domain
eq
$target
)
{
# hash, key is list, value is number of subscriber
#$domcount{$list}++;
if
(
$firstbounce
<
$time
&&
$bouncecode
eq
$code
&&
$bouncescore
>
$score
)
{
print
"
$address
$firstbounce
$lastbounce
$bouncescore
$bouncecode
\n
";
}
}
}
# sort by number of lists subscribed
#foreach $list ( sort { $domcount{$b} <=> $domcount{$a} } keys %domcount) {
# $count++;
# print "$list ", $domcount{$list}, "\n";
# if ( $count == $limit ) {last;}
#}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment