Sentora Support Forums
PHP mail() does not work & How to prevent spam? - Printable Version

+- Sentora Support Forums (https://senforums.mach-hosting.com)
+-- Forum: Sentora Forum Archives (https://senforums.mach-hosting.com/forumdisplay.php?fid=5)
+--- Forum: Sentora Public Support Forums v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=32)
+---- Forum: Email Support v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=35)
+---- Thread: PHP mail() does not work & How to prevent spam? (/showthread.php?tid=3292)

Pages: 1 2


PHP mail() does not work & How to prevent spam? - 7rdoq - 12-21-2016

Hi buddy

I use WordPress, on contact form, after click Send button, WP warns email sent successfully but I can not receive any email

Please help me? I do not touch any PHP settings in installing sentora

And I receive so much spam email daily for email accounts, how to stop it?

Many thanks


RE: PHP mail() does not work & How to prevent spam? - Ron-e - 12-22-2016

Have you tried testing out the mail() function on plane php, so without Wordpress with plugin?
For the spam, take a look at this topic.


RE: PHP mail() does not work & How to prevent spam? - 7rdoq - 12-22-2016

Yeah, just check with mail(), it return false

Then I check sendmail status with cmd 
Quote:service sendmail status
it returns
Quote:* sendmail.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

Then I try to send mail with cmd: 
Code:
mail -s "Test Postfix" dfsdfsdfds@gmail.com


but it returns send-mail: Cannot open mail:25


RE: PHP mail() does not work & How to prevent spam? - 7rdoq - 12-24-2016

hi buddy

Are you still there?


RE: PHP mail() does not work & How to prevent spam? - Ron-e - 12-25-2016

i don't know..
Maybe someone else know more about this?


RE: PHP mail() does not work & How to prevent spam? - TGates - 12-25-2016

I had a lot of spam too. I had to make custom configs to deal with it. I also made whitelist to allow major email providers (aol, gmail, etc.) and blacklist configs to block certain .tld altogether (.top, .ru, etc.).

I used Google's help to do the customization's, unfortunately I did not write any of it down Blush 

After the Holidays maybe I can find time to write up another tutorial for what I did.

You are not alone with this issue: [google]send-mail: cannot open mail:25 centos site:www.centos.org[/google]


RE: PHP mail() does not work & How to prevent spam? - 7rdoq - 12-25-2016

Hi TGates

After find from your link, I installed sendmail with cmd
Code:
yum install sendmail sendmail-cf sendmail-doc sendmail-devel


then tried to send, but it no success

I can not find any mail log at /var/log/mail or /var/log

But when I used cmd: sendmailconfig, console alert
Code:
You have new mail in /var/spool/mail/root

Open it, I see warning
Quote:----- The following addresses had permanent fatal errors -----
<xxx@gmail.com>
    (reason: 550-5.7.1 [23.227.172.88] The IP address sending this message does not have a)

   ----- Transcript of session follows -----
... while talking to gmail-smtp-in.l.google.com.:
>>> DATA
<<< 550-5.7.1 [23.x.x.x] The IP address sending this message does not have a
<<< 550-5.7.1 PTR record setup. As a policy, Gmail does not accept messages from
<<< 550-5.7.1 IPs with missing PTR records. Please visit
<<< 550-5.7.1  https://support.google.com/mail/answer/81126#authentication for more
<<< 550 5.7.1 information. f78si2729769otf.316 - gsmtp
554 5.0.0 Service unavailable



RE: PHP mail() does not work & How to prevent spam? - Ron-e - 12-25-2016

check your domain with https://intodns.com/
Set a SPF record like something like: 'v=spf1 ip4:xx.xx.xx.xx ~all'


RE: PHP mail() does not work & How to prevent spam? - Me.B - 12-25-2016

1. Installing sendmail won't resolve the issue. As default setup works fine and use postfix. You just messed up your setup.

2. Check postfix logs first and ensure that port 25 is open and you are not blacklisted.

My advice check 2. before jumping into changing configs that you don't master.

M B


RE: PHP mail() does not work & How to prevent spam? - 7rdoq - 12-26-2016

really thank but I can not find any mail log or postfix log at /var/log/

then I try to check postfix status, it's inactive, then I tried to restart then send email again, it's still no any log, no success

I forgot to tell I'm using CentOS 7 Minimal package with all defaults during install sentora, could this package generate these issues?