Page 1 of 1

I'm facing big problem of mail system. Please help.

Posted: Thu Apr 25, 2019 10:49 am
by dvlraj
1st of all i feces more bugs about vesta cp about mysql, dns, ssl, roundcube . and i saw previous post of problems and i also fixed some problem.
And now face more problem with mail system.


Problem-1= When i add new user(client) and give email for ''Send login credentials to email address'',than not receive any mail from server to new user email.


Problem-2=When user request for forgotten password than not receive any mail from server to user.


Big Problem-3=i create a user myself on my vestacp and i uploaded a website with this user account.all worked fine but mail system not work.
this user site have roles such as registration activation link verify by email, payment successful email, expired email.
All for are not working . even on this website , no user can registration for not sending registration activation verity link from server.
i already cheek this website code is work fine on xampp localhost , cpanel hosting , sentora hosting.

some coding here

Code: Select all

<?php
if (isset($_POST['form1'])) {

    $valid = 1;
  if(empty($_POST['agent_email'])) {
        $valid = 0;
        $error_message .= "Email can not be empty.\\n";
    } else {
    	if (filter_var($_POST['agent_email'], FILTER_VALIDATE_EMAIL) === false) {
	        $valid = 0;
	        $error_message .= 'Email address must be valid.\\n';
	    } else {
	    	$statement = $pdo->prepare("SELECT * FROM tbl_agent WHERE agent_email=?");
	    	$statement->execute(array($_POST['agent_email']));
	    	$total = $statement->rowCount();							
	    	if($total) {
	    		$valid = 0;
	        	$error_message .= 'Email address already exists.\\n';
	    	}
	    }
    }
	
	   if($valid == 1) {

    	$token = md5(uniqid(rand(), true));
    	$now = time();

		// saving into the database
		$statement = $pdo->prepare("INSERT INTO tbl_agent (agent_name,agent_designation,agent_organization,agent_email,agent_phone,agent_address, agent_city,agent_state,agent_country,agent_zip_code,agent_password,agent_token,agent_time,agent_access) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
		$statement->execute(array($_POST['agent_name'],$_POST['agent_designation'],$_POST['agent_organization'],$_POST['agent_email'],$_POST['agent_phone'],$_POST['agent_address'],$_POST['agent_city'],$_POST['agent_state'],$_POST['agent_country'],$_POST['agent_zip_code'],md5($_POST['agent_password']),$token,$now,0));

		// Send email for confirmation of the account
        $to = $_POST['agent_email'];
        
        $subject = 'Registration Email Confirmation for ' . BASE_URL;
        $verify_link = BASE_URL.'verify.php?email='.$to.'&token='.$token;
        $message = '
Thank you for signing up!
Your account has been created, you can login with the following credentials after you have activated your account by pressing the url below.<br><br>

Please click this link to activate your account:
<a href="'.$verify_link.'">'.$verify_link.'</a>';

		$headers = "From: noreply@" . BASE_URL . "\r\n" .
				   "Reply-To: noreply@" . BASE_URL . "\r\n" .
				   "X-Mailer: PHP/" . phpversion() . "\r\n" . 
				   "MIME-Version: 1.0\r\n" . 
				   "Content-Type: text/html; charset=ISO-8859-1\r\n";
				   
        mail($to, $subject, $message, $headers); // Send the email

    	unset($_POST['agent_name']);
    	unset($_POST['agent_designation']);
    	unset($_POST['agent_organization']);
    	unset($_POST['agent_email']);
    	unset($_POST['agent_phone']);
    	unset($_POST['agent_address']);
    	unset($_POST['agent_city']);
    	unset($_POST['agent_state']);
    	unset($_POST['agent_country']);
    	unset($_POST['agent_zip_code']);

    	$success_message = 'Your registration is completed. Please check your email address to follow the process to confirm your registration.';
    }
}
?>


And
my server vestacp record:
host name =abar.cf
i am setting dns record on digitalocean.

Code: Select all

$ORIGIN abar.cf.
$TTL 1800
abar.cf. IN SOA ns1.digitalocean.com. hostmaster.abar.cf. 1556173590 10800 3600 604800 1800
abar.cf. 3600 IN A 68.183.26.66
ns1.abar.cf. 3600 IN A 68.183.26.66
ns2.abar.cf. 3600 IN A 68.183.26.66
mail.abar.cf. 3600 IN A 68.183.26.66
www.abar.cf. 43200 IN CNAME abar.cf.
ftp.abar.cf. 43200 IN CNAME abar.cf.
abar.cf. 14400 IN MX 10 mail.abar.cf.
abar.cf. 86400 IN NS ns1.abar.cf.
abar.cf. 86400 IN NS ns2.abar.cf.
smtp.abar.cf. 3600 IN A 68.183.26.66
also on my vestacp have dns record same to this record.
and i am using Lets Encrypt Support SSL from server . its worked and i see my cp is secure. :)

following of problem 3 , here user website domain is wassbd.org.
cloudflare ssl and have record all record also for mail = mail.wassbd.org on mx and A.


i am cheeking on checktls.com/TestReceiver
both website results say all ok (100%) but only cert FAIL.


Please My Friend Help Me I Can't Sleep About Two Days For Having This Problem. :(

Re: I'm facing big problem of mail system. Please help.

Posted: Sat May 04, 2019 9:26 am
by MAN5
Haha. Be cool. VestaCP got bugs and rectified (AFAIK). Becoz im using it to manage few wordpress sites.

Your prblms 1-3 all related to EXIM4. Chk ur /var/log/exim4.