-
-
Save mrmt/3878288 to your computer and use it in GitHub Desktop.
rename mail file within Maildir to seen status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# rename mail file within Maildir to seen status | |
use strict; | |
use warnings; | |
my $file = shift; | |
die unless -r $file; | |
die unless -f $file; | |
my ($base, $flag) = ($file =~ /^(.*),(\w+)$/); | |
exit 0 if $flag =~ /S/; # exit already seen | |
exit 1 unless rename $file, $base . ',S' . $flag; | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment