input:b0003v0627p0001e0111-e0,1,4,11,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,8C,8E,96,98,9E,9F,A1,A3,A4,A5,A6,AD,B0,B1,B2,B3,B4,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,l0,1,2,3,4,sfw
     �ÆÅÇ      File not found.
  9   ˆl–Ðz¾”Jj"TÒ�zàœ¸”Å£Äƒq–Áa–Ü4ý()¨‰P@Š	›€jàYS�ÿÉ Î    #!/usr/local/cpanel/3rdparty/bin/perl

# cpanel - scripts/delpop                          Copyright 2022 cPanel, L.L.C.
#                                                           All rights reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

package scripts::delpop;

use strict;
use warnings;

use Cpanel::AcctUtils::DomainOwner::Tiny ();
use Cpanel::PwCache                      ();
use Cpanel::SafetyBits                   ();
use Cpanel::SafeFile                     ();
use Cpanel::Email::Validate              ();
use Cpanel::Usage                        ();
use Cpanel::Sys::Setsid::Fast            ();
use Cpanel::Hooks                        ();

my @attributes = qw{ email user owner domain file };

# call binary
run(@ARGV) unless caller();

sub run {
    my (@args) = @_;

    my $debug;
    my $verbose;
    my $email;

    my $opts = {
        email   => \$email,
        debug   => \$debug,
        verbose => \$verbose,
    };

    # compatibility with previous binary version
    if ( scalar @args == 1 && $args[0] !~ /^\-/ ) {
        $email = $args[0];
    }
    else {
        Cpanel::Usage::wrap_options( \@args, \&usage, $opts );
    }

    my $pop = scripts::delpop->new( email => $email || undef );

    # interactive fields
    my $interactive_fields = {
        email => 'Please enter the pop account to be removed (e.g. bob@sally.com)? ',
    };
    foreach my $field ( sort keys %$interactive_fields ) {
        while ( !$pop->$field() ) {
            print $interactive_fields->{$field};
            my $input;
            chomp( $input = <STDIN> );
            $pop->$field($input) if length($input);
        }
    }

    Cpanel::Hooks::hook(
        {
            'category' => 'scripts',
            'event'    => 'delpop',
            'stage'    => 'pre',
        },
        { 'email' => $email },
    );

    $pop->delete();

    Cpanel::Hooks::hook(
        {
            'category' => 'scripts',
            'event'    => 'delpop',
            'stage'    => 'post',
        },
        { 'email' => $email },
    );

    exit;
}

sub usage {
    my $prog = $0;
    print <<USAGE;
$0 [--email=]<user\@domain.com>

Delete the specified email account.

    --help  : display this documentation
    --email : a valid address email ( format: user\@domain.com )
USAGE
    exit 1;
}

sub new {
    my ( $package, %opts ) = @_;
    my $self = bless {}, __PACKAGE__;

    # create accessor and hooks
    $self->_set_attributes();

    # set values
    map { $self->$_( $opts{$_} ) } keys %opts;

    return $self;
}

sub _set_attributes {

    # call once at first init
    return unless @attributes;
    foreach my $att (@attributes) {
        my $accessor = __PACKAGE__ . "::$att";

        # allow symbolic refs to typeglob
        no strict 'refs';
        *$accessor = sub {
            my ( $self, $v ) = @_;
            if ( defined $v ) {
                foreach (qw{before validate set after}) {
                    if ( $_ eq 'set' ) {
                        $self->{$att} = $v;
                        next;
                    }
                    my $sub = '_' . $_ . '_' . $att;
                    if ( defined &{ __PACKAGE__ . '::' . $sub } ) {
                        return unless $self->$sub($v);
                    }
                }
            }
            return $self->{$att};
        };
    }
    @attributes = undef;
    return 1;
}

sub _validate_email {
    my ( $self, $email ) = @_;

    Cpanel::Email::Validate::valid_email($email)
      or die "'$email' is an invalid email";
    return 1;
}

sub _after_email {
    my ($self) = @_;

    # mix validation and before_save :)
 