<?
require_once('include/global.php');
require_once('conf.inc.php');


// set
	$CFG['TITLE'] = '<b>환경설정</b> >> <b>외부 메일(POP3)</b>';

// check
	if ($G['DINFO']['d_svc_external_pop3'] === 'N') {
		msg("외부 메일(POP3)를 사용할 수 없습니다.\\n\\n서버관리자에게 문의하여 주십시오.");
	}

// [2006-03-08] 메일서버가 동작중인지 확인
	require_once('include/admin_lib.php');
	mail_server_check_limit();

// data
	// db - select
		$DEBUG['db_select']['start'] = getmicrotime();

		$sql = "
			SELECT
				*
			FROM
				" . $TB['POP3'] . "
			WHERE
				m_no='" . $AUTH['auth_m_no'] . "' 
			ORDER BY
				p3_no DESC
			";
		$rows = db_get_rows($sql);

		// [2025-09-25] Xmail SSL 설정 가져오기
		require_once('include/admin_lib.php');
		$cfgs = nm_cfgfileget('server.tab');
		$enable_smtp = nm_cfg_val_get($cfgs, 'EnableSMTP-TLS');

		if ($enable_smtp) {
			$view['p3_server_port'] = input_value('995', 1);
			$view['port'] = '995';
		} else {
			$view['p3_server_port'] = input_value('110', 1);
			$view['port'] = '110';
		}

		$mail_service = array(
			""        => "직접 입력",
			"NAVER"   => "네이버",
			"daum"    => "다음",
			'NATE'    => '네이트',
			'Google'  => 'Gmail (Google)',
			'Outlook' => 'Outlook.com (Microsoft)',
		);

		$view['external_mail_service'] = radio_value("external_mail_service", $_GET['external_mail_service'], array_values($mail_service), array_keys($mail_service), 0, 0, 1);

		$DEBUG['db_select']['exec'] += getmicrotime() - $DEBUG['db_select']['start'];


// skin view
	nskinset('webmail', 'pop3.html');
	include($NSKIN['view_layout']);


require_once('include/global_end.php');
?>