-1

I first installed sendmail on ubuntu 17.04 by running sudo apt-get install sendmail and then I made sure that the hostname of my machine was added to /etc/hosts/ right after localhost like this:

127.0.0.1 localhost myhostname

I then ran sudo sendmailconfig and answered yes to all the questions. I'm now trying to send some mail. I do this:

echo "Subject: sendmail test" | sendmail -v me@gmail.com 

Sendmail prints the following:

    ole@mki:~$ echo "Subject: sendmail test" | sendmail -v me@gmail.com 
    WARNING: local host name (localhost) is not qualified; see cf/README: WHO AM I?
    me@gmail.com... Connecting to [127.0.0.1] via relay...
    220 localhost ESMTP Sendmail 8.15.2/8.15.2/Debian-8ubuntu1; Mon, 14 Aug 2017 14:28:56 -0500; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]
    >>> EHLO localhost
    250-localhost Hello localhost [127.0.0.1], pleased to meet you
    250-ENHANCEDSTATUSCODES
    250-PIPELINING
    250-EXPN
    250-VERB
    250-8BITMIME
    250-SIZE
    250-DSN
    250-ETRN
    250-AUTH DIGEST-MD5 CRAM-MD5
    250-DELIVERBY
    250 HELP
    >>> VERB
    250 2.0.0 Verbose mode
    >>> MAIL From:<ole@localhost> SIZE=23 AUTH=ole@localhost
    250 2.1.0 <ole@localhost>... Sender ok
    >>> RCPT To:<me@gmail.com>
    >>> DATA
    250 2.1.5 <ole.ersoy@gmail.com>... Recipient ok
    354 Enter mail, end with "." on a line by itself
    >>> .

I'm not sure what I'm supposed to do at this point. I tried putting a "." on a line by itself and returning but nothing happens. If I press ctrl C I get the prompt back buy the email does not appear in my gmail inbox. Thoughts?

Ole
  • 223
  • 1
  • 4
  • I know from experience that Gmail has strict authentication protocols which make for a hard time with SendMail. You might have better luck with this question on https://askubuntu.com – KidACrimson Aug 14 '17 at 22:02

1 Answers1

1

If you want to send Internet email directly then make hostname --dqdn (FQDN=Fully Qualified Domain Name) report name with existing DNS MX (or A) record. The exact procedure is Linux distribution dependent.

You can force sendmail to use another name than auto-configured one but it is not "the best way" IMHO.

AnFi
  • 5,883
  • 1
  • 12
  • 26