Skip to content

Commit

Permalink
Add mail check script
Browse files Browse the repository at this point in the history
  • Loading branch information
infinisil committed Sep 17, 2024
1 parent 3f84029 commit dfd7bfc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/check-mail.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env perl

# From https://github.com/andrewcmyers/civs/blob/cbef7e7a0c5dccc0072096db958d2900174bfe16/cgi-bin/mail.pm#L46-L52
sub CheckAddr {
(my $addr) = @_;

return ($addr =~ m/^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2,8})$/i);
}

while(my $line = <>) {
if (!CheckAddr($line)) {
print($line)
}
}

0 comments on commit dfd7bfc

Please sign in to comment.