• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

sending email problem

F

farakhkhan@yaho

Guest
I am sending emails but hotmail is not accepting at all and yahoo, gmail is getting in bulk

1. My SPF record is correct
2. I can resolve my hostname from root
3. I can pointer my host from root

my ip is 209.62.76.34

I am using javaMail for sending the msgs from my website while Plesk is using Qmail. Is there may be conflict between Qmail and javaMail??

thanks & best regards
 
Hello,

There can be two posible situations:
- Your server does not send emails through scripts;
- yahoo, gmail, etc. reject emails from your serevr.

What should be checked in first situation:
1) You can use following simple php script which works 100%, for example with this code:
<?php
$to = "[email protected]";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>

If you received the message "Message successfully sent!", it means that the problem is in syntax of you script;

3) If you received the message "Message delivery failed", what records appear in /var/www/vhosts/$domain_name/statistics/logs/error_log when you try sending mail with php script.
Here $domain_name is the name of the domain on which this script is executed.

4) Check what records appear in /var/log/messages upon script execution. If you see records like:

deny httpd_sys_script_t var_t:file { execute getattr };
deny httpd_t self:tcp_socket connect;
deny httpd_t usr_t:dir write;
deny httpd_t var_log_t:file { append getattr setattr };
deny httpd_sys_script_t devlog_t:sock_file write;
deny httpd_sys_script_t self:unix_dgram_socket {connect create write };

Then this must be caused by Selinux. Check selinux status with getenforce command and if Selinux is in enforcing mode try switching it to permissive mode using following command:
# setenforce 0

In second situation:
Send a message to an email account on yahoo, gmail, etc. and then check /usr/local/psa/var/maillog and maillog files on destination server (yahoo, gmail) to get exact reason why the message was rejected.
 
Back
Top