Created
January 21, 2011 09:57
-
-
Save dynax60/789489 to your computer and use it in GitHub Desktop.
Remove helper for Postfixadmin
This file contains hidden or 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/env perl | |
use strict; | |
use warnings; | |
my $mailhome = '/var/spool/postfix/virtual'; | |
my $domain = shift or die; | |
my $username = shift or die; | |
die "Invalid domain: $domain\n" unless $domain =~ m/^[\w\.\-]+$/; | |
die "Invalid username: $username\n" unless $username =~ m/^[\w\.\@\_]+$/; | |
my $maildir = "$mailhome/$domain/$username"; | |
-d $maildir ? | |
qx { /bin/rm -rf $maildir } : | |
die "No such maildir: $maildir\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment