1

I have set-up sendmail on my Ubuntu server but it takes ages to send an email. It doesn't actually sent the email but it takes about 20 seconds.

Try it here: http://genyx.co.uk/form/index.php

You can tell if its sent because it says yay or nay at the top. You don't have to enter any information, just click submit.

I installed sendmail with the default configuration.

Can anyone help?

Adam
  • 349
  • 3
  • 12
  • did you ever change your hostname after installing? – Mike Mar 06 '12 at 14:18
  • after installing sendmail or ubuntu? – Adam Mar 06 '12 at 14:31
  • I think @Mike is trying to ascertain whether your server has its hostname set properly. Sendmail will attempt to figure out the hostname of the server before sending mail and this may be taking time if it doesn't resolve correctly. It is also worth checking your DNS setup to make sure DNS queries are happening quickly. You also could do with posting some Sendmail log output for when you're sending a message (you may need to up the log level in the config file). If you're now using postfix, we still need log output to help. We're not psychic (well...I'm not). – webtoe Mar 06 '12 at 15:27
  • Hi, where are the logs located? – Adam Mar 06 '12 at 15:50
  • /var/log/mail.log – adamo Mar 06 '12 at 16:07
  • http://genyx.co.uk/mail.log – Adam Mar 06 '12 at 16:21
  • According to the first line in your log: _My unqualified host name (GenyxPrimary) unknown; sleeping for retry_ which is why sendmail is lagging. Change your hostname to a fully qualified name like genyx.co.uk via your OS administrative tools. – adamo Mar 06 '12 at 16:29
  • I reinstalled sendmail and changed the hostname, but I still don't receive anything, please check the updated log. – Adam Mar 06 '12 at 16:41
  • sendmail[18054]: gethostbyaddr(10.176.193.144) failed: 1 – Adam Mar 06 '12 at 16:41
  • You do not have a matching entry in _/etc/hosts_ – adamo Mar 06 '12 at 16:44
  • let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/2708/discussion-between-adamo-and-adam-tester) – adamo Mar 06 '12 at 16:49

2 Answers2

1

According to the log files that you posted the delay problem is this:

Mar 6 13:50:36 GenyxPrimary sendmail[8384]: My unqualified host name (GenyxPrimary) unknown; sleeping for retry

Edit /etc/mail/sendmail.mc and add at the bottom the following two lines:

LOCAL_CONFIG
Djgenyx.co.uk

Next see this answer in order to make sure that mail gets delivered properly to where it has to. Do not forget to run sudo sendmailconfig after completing editing sendmail.mc.

Right now it seems that mail gets accepted by your email provider:

Mar 6 13:55:51 GenyxPrimary sm-mta[9354]: q26DtnqT009352: to=, ctladdr= (33/33), delay=00:00:02, xdelay=00:00:02, mailer=esmtp, pri=120377, relay=mx1.emailsrvr.com. [98.129.184.131], dsn=2.0.0, stat=Sent (Ok: queued as 7A/C9-03931-657165F4)

so you have to check whether it is tagged or rejected as spam.

adamo
  • 6,867
  • 3
  • 29
  • 58
  • Thanks for the help! I still have no idea what I just did but it worked :) – Adam Mar 06 '12 at 18:14
  • Whenever you feel like diving into sendmail, grab [the bat book](http://shop.oreilly.com/product/9780596510299.do) – adamo Mar 06 '12 at 19:11
0

Let's call sendmail a command line tool and Sendmail MTA as big sendmail

I guess you have installed big sendmail (that also provides sendmail). It's the most ancient MTA. But probably it can be used for your need if you configure it properly. But I would recommend install postfix or ssmtp (both provides sendmail).