-3

I am no longer able to send emails since I updated my server from Ubuntu 13.04 to 14.04.

I have several websites installed in my server, and none of them is able to send emails any more. Before the update everything was working perfectly.

Some of the websites are based on Drupal, so they send emails using the Drupal emailing system. Other websites use phpmailer for that purpose.

I also tried to send an email directly with mail command, but this is not working, either. For example:

mail [email protected]

After several hours of investigation, I have no idea from where the problem could come from. I tried to remove/install all programs involved in emailing system such as:

postfix

Usually when I setup a new server and my websites are not able to send emails, I just install theses components and it solves the issue every time:

sudo apt-get install php-pear
sudo pear install mail
sudo pear install Net_SMTP
sudo pear install Auth_SASL
sudo pear install mail_mime
sudo apt-get install postfix

So I tried to uninstall/install also all of them, but it didn't help.

How can I diagnose this issue? My mail logs are not very helpful.

**** EDIT ****

After last procedure described above, I finally found something on mail.err file:

Dec  8 21:08:59 ns3268116 postfix/master[22716]: fatal: bind 0.0.0.0 port 25: Address already in use
Dec  8 21:52:37 ns3268116 postfix/master[27738]: fatal: bind 0.0.0.0 port 25: Address already in use 

Also I found something special in mail.log, sometimes (I mean not every time):

Dec  8 19:07:27 ns3268116 postfix/smtp[11051]: A84F8120023: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[2a00:1450:4013:c01::1b]:25, delay=1.8, delays=0.19/0/0.85/0.79, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[2a00:1450:4013:c01::1b] said: 550-5.7.1 [2001:41d0:8:5d63::1      12] Our system has detected that this 550-5.7.1 message is likely unsolicited mail. To reduce the amount of spam sent 550-5.7.1 to Gmail, this message has been blocked. Please visit 550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for 550 5.7.1 more information. v10si10884736wif.101 - gsmtp (in reply to end of DATA command))

**** EDIT 2 ****

As sendmail seems to be in conflict with postfix (see masegaloeh comment/answer), I uninstalled it and rebooted server. Here is what the logs said:

Dec  8 22:40:24 ns3268116 postfix/master[4447]: daemon started -- version 2.11.0, configuration /etc/postfix
Dec  8 22:40:24 ns3268116 postfix/pickup[4481]: BDDA9120427: uid=33 from=<[email protected]>
Dec  8 22:40:24 ns3268116 postfix/cleanup[4483]: BDDA9120427: message-id=<[email protected]>
Dec  8 22:40:24 ns3268116 postfix/qmgr[4482]: BDDA9120427: from=<[email protected]>, size=664, nrcpt=1 (queue active)
Dec  8 22:40:24 ns3268116 postfix/pickup[4481]: DD1FC12006A: uid=33 from=<[email protected]>
Dec  8 22:40:24 ns3268116 postfix/cleanup[4483]: DD1FC12006A: message-id=<[email protected]>
Dec  8 22:40:24 ns3268116 postfix/qmgr[4482]: DD1FC12006A: from=<[email protected]>, size=863, nrcpt=1 (queue active)
Dec  8 22:40:28 ns3268116 postfix/smtp[4498]: DD1FC12006A: to=<[email protected]>, relay=mta7.am0.yahoodns.net[66.196.118.240]:25, delay=1331, delays=1328/0/2.3/0.84, dsn=2.0.0, status=sent (250 ok dirdel)
Dec  8 22:40:28 ns3268116 postfix/qmgr[4482]: DD1FC12006A: removed
Dec  8 22:40:56 ns3268116 postfix/smtp[4493]: connect to example.com[93.184.216.119]:25: Connection timed out
Dec  8 22:41:26 ns3268116 postfix/smtp[4493]: connect to example.com[2606:2800:220:6d:26bf:1447:1097:aa7]:25: Connection timed out
Dec  8 22:41:26 ns3268116 postfix/smtp[4493]: BDDA9120427: to=<[email protected]>, relay=none, delay=1389, delays=1328/0.08/62/0, dsn=4.4.1, status=deferred (connect to example.com[2606:2800:220:6d:26bf:1447:1097:aa7]:25: Connection timed out)

And now when I do:

sudo netstat -tulpn | grep 25

I get:

tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      7783/master
tcp6       0      0 127.0.0.1:8079          :::*                    LISTEN      4525/java
tcp6       0      0 :::8983                 :::*                    LISTEN      4525/java
tcp6       0      0 :::25                   :::*                    LISTEN      7783/master

And emails are still NOT being sent..

Actually now I can send emails with command mail. But it's weird because only the email defined on cc field is receiving the email.

Also the Drupal websites are again able to send emails.

But phpmailer is still not working. Anyone has an idea what's missing there??

7
  • 2
    What do your mail logs say? Please have a look at the help center, specifically the section serverfault.com/help/how-to-ask
    – Jenny D
    Dec 8, 2014 at 20:57
  • I didn't find anything in mail.log that can help for debugging unfortunately. Why do you find my question is not well? I am going to integrate some logs right now.
    – 118218
    Dec 8, 2014 at 21:07
  • Can somebody tell me why this question is not eligible? Instead of just clicking in a button.
    – 118218
    Dec 8, 2014 at 21:16
  • 3
    @118218 Format for the site is question and answer for specific problems. It is not intended for general troubleshooting of an issue from start to finish. You are expected to narrow down the issue to a specific problem and then ask for guidance on that, if required.
    – jlehtinen
    Dec 8, 2014 at 21:20
  • ok sorry about that, I will try to narrow my question, then
    – 118218
    Dec 8, 2014 at 21:30

1 Answer 1

1

Binding problem

Command netstat returns tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 14774/sendmail: MTA

If you want to use postfix, please uninstall/stop sendmail.

sudo apt-get remove sendmail

Then restart postfix

sudo service postfix restart

Email bounce problem

This line

Dec 8 19:07:27 ns3268116 postfix/smtp[11051]: A84F8120023: to=, relay=gmail-smtp-in.l.google.com[2a00:1450:4013:c01::1b]:25, delay=1.8, delays=0.19/0/0.85/0.79, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[2a00:1450:4013:c01::1b] said: 550-5.7.1 [2001:41d0:8:5d63::1 12] Our system has detected that this 550-5.7.1 message is likely unsolicited mail. To reduce the amount of spam sent 550-5.7.1 to Gmail, this message has been blocked. Please visit 550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for 550 5.7.1 more information. v10si10884736wif.101 - gsmtp (in reply to end of DATA command))

says that google doesn't like your email. Looks like you have trouble because you use IPv6 to send email. Disabling it maybe solve this problem.

Add/edit this parameter in main.cf

inet_protocols = ipv4

And don't forget to configure SPF, DKIM, PTR to ensure the email deliverability. See Prevent mail being marked as spam

Not the answer you're looking for? Browse other questions tagged .