Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
did you ever change your hostname after installing? –  Mike Mar 6 '12 at 14:18
    
after installing sendmail or ubuntu? –  Adam Mar 6 '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 6 '12 at 15:27
    
Hi, where are the logs located? –  Adam Mar 6 '12 at 15:50
    
/var/log/mail.log –  adamo Mar 6 '12 at 16:07

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
Thanks for the help! I still have no idea what I just did but it worked :) –  Adam Mar 6 '12 at 18:14
    
Whenever you feel like diving into sendmail, grab the bat book –  adamo Mar 6 '12 at 19:11

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).

share|improve this answer
    
I installed postfix, but now it says "yay" as if its sent, but I don't receive any mail –  Adam Mar 6 '12 at 15:17
    
check for postifx log (/var/log/maillog on my machine) –  Sergey P. aka azure Mar 14 '12 at 14:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.