I would be very surprised if this script caused your issue. What kind of output do you see if you run the following in a TTY context:
#!/usr/bin/perl
use strict;
use warnings;
my @files = </home/user/Maildir/cur/*>;
for (@files){
open(IN, $_);
while (<IN>) {
last if /The mail system/;
}
while (<IN>) {
if (m#/domain.com$#) {
print "\n";
last;
}
print;
}
close IN;
}
There are a number of methodological changes I'd make to what you've done, particularly adding a check to see if what you are about to open is a file (
-f or next; and see
-f) and testing the result of the open (
open(IN, '<', $_) or die "Open failure on $_:$!\n"), but these shouldn't be the cause of your issue unless you've got an unbelievably large set of subdirectories and have swamped your log file. Which you said you didn't.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.