I have a small server (Ubuntu 14.04) for multiple websites. One of these websites needs to send emails to the user on various actions (registration, password recovery, etc.). I have sendmail installed and I'm able to send mail from PHP scripts.
I have configured a SFP DNS entry. I server's hostname is "rubber". My /etc/hosts file contains
127.0.0.1 localhost localhost.localdomain rubber public.ip.address rubber
With this configuration, sending email takes very long (about 20 seconds). Also, the sendmail log (/var/log/mail.log) show a line like this:
Sep 24 17:28:52 server sendmail: s8OFSLUd019842: to=<email@example.com>, delay=00:00:15, xdelay=00:00:15, mailer=relay, pri=30370, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s8OFSbcl019844 Message accepted for delivery)
The received mail headers look like this (I've changed real addresses):
Delivered-To: firstname.lastname@example.org Received: by 10.112.136.195 with SMTP id qc3csp517582lbb; Wed, 24 Sep 2014 08:20:55 -0700 (PDT) X-Received: by 10.180.99.195 with SMTP id es3mr12425233wib.67.1411572055732; Wed, 24 Sep 2014 08:20:55 -0700 (PDT) Return-Path: <email@example.com> Received: from localhost.localdomain ([2022:4ff0:51:500::16e]) by mx.google.com with ESMTPS id el1si7235041wid.69.2014.08.22.08.20.55 for <firstname.lastname@example.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Sep 2014 08:20:55 -0700 (PDT) Received-SPF: pass (google.com: domain of email@example.com designates 2022:4ff0:51:500::16e as permitted sender) client-ip=2022:4ff0:51:500::16e; Authentication-Results: mx.google.com; spf=pass (google.com: domain of firstname.lastname@example.org designates 2022:4ff0:51:500::16e as permitted sender) email@example.com Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id s8OFKPU7019505 for <firstname.lastname@example.org>; Wed, 22 Sep 2014 17:20:40 +0200 Received: from website-test.com (www-data@localhost) by localhost.localdomain (8.14.4/8.14.4/Submit) with SMTP id s8OFKAOG019503 for <email@example.com>; Wed, 22 Sep 2014 17:20:25 +0200 X-Authentication-Warning: localhost.localdomain: www-data owned process doing -bs Message-ID: <firstname.lastname@example.org> Date: Wed, 22 Sep 2014 17:20:09 +0200 Subject: Test email From: "Website.com" <email@example.com> To: firstname.lastname@example.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable
My questions are:
- How can I make the sendmail server to send the emails faster? What's taking so long?
- How can I get rid of those "personal headers" like the localhost.localdomain and the local server username?