This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

PHP mail() does not work & How to prevent spam?
#1
PHP mail() does not work & How to prevent spam?
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
Reply
Thanks given by:
#2
RE: PHP mail() does not work & How to prevent spam?
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.

My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons

Sentora's development takes way too long, so i'm transitioning to HestiaCP.
Reply
Thanks given by: 7rdoq
#3
RE: PHP mail() does not work & How to prevent spam?
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
Reply
Thanks given by:
#4
RE: PHP mail() does not work & How to prevent spam?
hi buddy

Are you still there?
Reply
Thanks given by:
#5
RE: PHP mail() does not work & How to prevent spam?
i don't know..
Maybe someone else know more about this?

My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons

Sentora's development takes way too long, so i'm transitioning to HestiaCP.
Reply
Thanks given by:
#6
RE: PHP mail() does not work & How to prevent spam?
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
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by: 7rdoq
#7
RE: PHP mail() does not work & How to prevent spam?
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/8...entication for more
<<< 550 5.7.1 information. f78si2729769otf.316 - gsmtp
554 5.0.0 Service unavailable
Reply
Thanks given by:
#8
RE: PHP mail() does not work & How to prevent spam?
check your domain with https://intodns.com/
Set a SPF record like something like: 'v=spf1 ip4:xx.xx.xx.xx ~all'

My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons

Sentora's development takes way too long, so i'm transitioning to HestiaCP.
Reply
Thanks given by: 7rdoq
#9
RE: PHP mail() does not work & How to prevent spam?
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
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask
Freelance AWS Certified Architect & SysOps// DevOps

10$ free to start your VPS
Reply
Thanks given by: 7rdoq
#10
RE: PHP mail() does not work & How to prevent spam?
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?
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
External mail client cannot connect to server iraqiboy90 2 6 ,209 02-28-2021, 11:34 AM
Last Post: iraqiboy90
Postfix mail.log to database stikekar 2 7 ,198 03-02-2019, 01:22 AM
Last Post: TGates
Sentora Email Setup - EMAIL DOESN'T GO TO SPAM james30263 0 3 ,125 09-15-2018, 01:20 PM
Last Post: james30263

Forum Jump:


Users browsing this thread: 1 Guest(s)