Sendmail not work


#1

I reported a problem with “mail” to the DH, explaining that such a function was causing 500 Internal Error Server, provided a sample code with only 1 line, yet they believe it is a PHP code problem.

The problem of 500 Internal Error Server stopped to occur, but the messages are not delivered to the recipients.

I am using VPS, did a test using the following command:

$ sendmail -v guilherme@mydomain < /home/user/domain/test.mail
sendmail: warning: inet_protocols: disabling IPv6 name/address support: Address family not supported by protocol
postdrop: warning: inet_protocols: disabling IPv6 name/address support: Address family not supported by protocol
Mail Delivery Status Report will be mailed to <leocla>.

The email was not delivered to the recipient.

Details:

  • I did nothing to stop the 500 Internal Error Server happen
  • This is not a problem a specific PHP code
  • The 500 Internal Error Server occurs stopped, but still the emails are not delivered
  • I set up port 587 by “PHP.INI”, but the problem still happens
  • I restarted the VPS few times, but the problem still happens
  • The file /var/logmail.log is empty
  • The file /var/logmail.log.1 “weighs” 138.419.634

How can I fix this? Thanks.

Note: Simple function PHP not work:

[php]<?php
mail(‘guilherme@centroimobiliario.com.br’, ‘My Subject’, ‘example’);
?>[/php]


#2

You must include a FROM header, and it must be an address from @yourdomain.tld

Don’t think that would kick a 500 out, but its the first thing to fix.


#3

Thanks for the reply, but it was as I said, this is an example code, all my code I added the [code]$headers .= ‘from: user@mydomain’ . PHP_EOL;

But not work. This code “PHP” I posted is just a simple example I tested, to understand that the problem is not with the code.

See the example I used to “SSH”:

test.mail content:

[code]From: guilherme@mydomain
Subject: test mail

first line of my message
second line of my message
[/code]

Output:

sendmail: warning: inet_protocols: disabling IPv6 name/address support: Address family not supported by protocol postdrop: warning: inet_protocols: disabling IPv6 name/address support: Address family not supported by protocol Mail Delivery Status Report will be mailed to <leocla>.

But the messages do not reach the recipient.

Please if you have any idea why this occurs, answer me, Thank you!


#4

Response from DH:

[quote]We looked into this issue further and found that there were networking
issues causing your VPS to have problems talking to the MySQL server. We
were able to get things reconfigured, and your sites appear to be loading
without issues now.[/quote]

I also had problem with mysql (after trying to restart the server).

Issue solved.