Sendmail not sending

I just installed sendmail on Ubuntu. I only want it for sending via an smtp relay, not as server.
I followed the instructions here:
But when I try a really simple command line send, I don't receive any message.
when I look in, it started off empty, but I added the text from the blog, although it looked from the blog like there should have been something there already...?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

In the file did you set the value for smart host (DS)?

Try sending mail with a "-v" option to get more info and post here.
    example:  mail -v
Also, you typically need to configure your mail server to accept a relay from the ip of the system with sendmail.
Silas2Author Commented:
Thanks for looking at this for me.
With the -v option, its showing me that its trying to relay from an old domain where there was a mail server...not my new one.
I followed the instructions in the blog:
makemap hash gmail-auth < gmail-auth
(i'm not using gmail though)
but its still using this old domain...
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

You can set the domain name you want to use in the file.

Locate this section...

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain

and add a Dj line with the domain name similar to above.

Be sure to refresh or restart sendmail when you make changes to the file
   (refresh -s sendmail)

Since you did not mention it, I assume you have set up your mail server to accept the relay.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Silas2Author Commented:
I'm pretty sure the mail server's ok, I can relay from it.

should that be:
(or whatever the mail server is called)?
No, the Dj is the definition part and must come first, and the domain is the rest.

For example: would send mail as if it was from

It is your main domain name that you send mail as, not an internal name for a server.
Silas2Author Commented:
I'm trying to relay from an smtp server, I put into a file called gmail-auth: "U:root" "" "P:pwd"
then makemap hash gmail-auth < gmail-auth,
then I put into :
define(`SMART_HOST',`[ ]')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
define(`confAUTH_OPTIONS', `A p')dnl
FEATURE(`authinfo',`hash -o /etc/mail/authinfo/gmail-auth.db')dnl

Open in new window

Was that wrong?
The changes I indicated were for the file not the is created when you run m4 on the .mc

Please post the output showing the error using  "mail -v" option
Silas2Author Commented:
This is the -v read-out. The is an old domain that  I dont' want to use as an smtp relay
root@mail:/etc/mail/authinfo# sendmail -v
helo Connecting to [] via relay...
220 ESMTP Sendmail 8.14.4/8.14.4/Debian-8; Tue, 7 Jul 2015 14:28:39 GMT; (No UCE/UBE) logging access from: ip6-localhost(OK)-ip6-localhost []
>>> EHLO Hello ip6-localhost [], pleased to meet you
250 HELP
>>> VERB
250 2.0.0 Verbose mode
>>> MAIL From:<> SIZE=5
250 2.1.0 <>... Sender ok
>>> RCPT To:<>
>>> DATA
250 2.1.5 <>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
050 <>... Connecting to via esmtp...
050 220 Sending unsolicited commercial or bulk e-mail to Microsoft's computer network is prohibited. Other restrictions are found at Tue, 7 Jul 2015 07:28:48 -0700
050 >>> EHLO
050 ( Hello []
050 250-SIZE 36909875
050 250-8bitmime
050 250-CHUNKING
050 250-STARTTLS
050 250-AUTH LOGIN
050 250-AUTH=LOGIN
050 250 OK
050 >>> STARTTLS
050 220 SMTP server ready
050 >>> EHLO
050 ( Hello []
050 250-SIZE 36909875
050 250-8bitmime
050 250-CHUNKING
050 250-AUTH LOGIN
050 250-AUTH=LOGIN
050 250 OK
050 >>> MAIL From:<> SIZE=318 AUTH=<>
050 250 OK
050 >>> RCPT To:<>
050 >>> DATA
050 250
050 354 Start mail input; end with <CRLF>.<CRLF>
050 >>> .
050 250  <> Queued mail for delivery
050 <>... Sent ( <> Queued mail for delivery)
250 2.0.0 t67ESdSD008304 Message accepted for delivery Sent (t67ESdSD008304 Message accepted for delivery)
Closing connection to []
>>> QUIT

Open in new window

Jan SpringerCommented:
Have you updated /etc/mail/access to allow your IPs to relay mail?

Has your firewall been updated to allow inbound SMTP connections from your trusted IPs?

Have you run wireshark on the host sending the email?  (or is it being sent locally?)

What do the logs show?
I don't see any errors in the above. Have you checked the mail server to see that the mail is leaving that box?

Setting DJ to what you want should get rid of the old domain.
Silas2Author Commented:
Noooooo, i'm saying the mail server is not the mail server I want to use, I want to use:
but for some reason it keeps using this old one, and I don't (in my very cack-handed way) seem to be able to configure it for this new one...
Jan SpringerCommented:
Did you run /etc/mail/make  after you updated

If so, did you "kill -HUP <pid of sendmail accepting connections"
Silas2Author Commented:
I ran the make, yes, but the kill command, is that a process? (not file)
I have restarted sendmail ....but the sendmail is only for sending (notifications)
Jan SpringerCommented:
restarted works, also,

grep DS /etc/mail/

what shows as the relay?
Silas2Author Commented:
root@mail:/etc/fail2ban# grep DS /etc/mail/
# Return-Receipt-To: header implies DSN request
# DHParameters (only required if DSA/DH is used)
Jan SpringerCommented:
you don't have a relay specified in the cf file.

     grep -i smart /etc/mail/

as root,
    make -C /etc/mail

    grep DS /etc/mail/
Silas2Author Commented:
'Make', doesn't that do a recompile/build?
Do I really have to recompile the sendmail app to configure a smtp relay to replace the one I've got?
Jan SpringerCommented:
it's "make" not "Make" and what is does it does is rebuild your to a (along with your other files in that directory) -- not sendmail itself.
Did you set the smart host in as per my first post above ID: 40870553? That controls where it sends the outgoing mail.
Silas2Author Commented:
Ok, ran the make, after installing the sasls...this is what I got:
make: Entering directory '/etc/mail'
Updating auth ...
Creating /etc/mail/sasl/sasl.m4...

Ah, you're setup with SASL2 !

Unfortunately, there is no automagic way to migrate to /etc/sasldb2 :(

You'll want to make sure /etc/default/saslauthd is setup to start,
and has at least MECHANISMS="pam" !

If you find out what more is needed, please let me know!

To enable sendmail to use SASLS, you need to:
1) Add this line to /etc/mail/ and optionally
   to /etc/mail/
2) Run sendmailconfig
3) Restart sendmail

SASL2 is now minimally setup, there are a few ways to handle users:
   *) Allow only shell users (default)
  You're all set, nothing else to do !
   *) Allow users other than shell
  Add users via /usr/sbin/saslpasswd2 and make sure that the
  realm you used matches what your users specify in their
  netscape/outlook/mutt/etc profiles.

If you need to authorize sendmail as a sender, also update
/etc/mail/default-auth-info and rerun /usr/share/sendmail/update_auth.

Creating /etc/mail/relay-domains
# Optional file...
The following file(s) have changed:
** ** You should issue `/etc/init.d/sendmail reload` ** **

Open in new window

Jan SpringerCommented:
oh please don't modify the cf file!  

have you reloaded/restarted sendmail?

is the smarthost listed in

are you using SMTP AUTH for IP addresses not trusted?
Silas2Author Commented:
Thanks for all your help. Let me just try...
I must be missing something here. Why are you trying SASL now? Looking at the output of the mail -v you posted, it is authorizing correctly. Given that both systems are on your lan, do you really need to login? From what I see here all you have to do is set DS and it should give you what you want.

I will bow out since my advice and that from Jan Springer is contradictory, and may cause confusion. If you want me to respond, please address carlmd.

good luck
Jan SpringerCommented:
it's all well and good to directly modify the *when you are very familiar* with it's configuration and rules.

never recommended for someone that cannot read it to go back and fix it.
Silas2Author Commented:
End of day now...back to it tmrw
Jan SpringerCommented:
if you have teamviewer and want to use that for assistance, drop me an email at EE.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Email Servers

From novice to tech pro — start learning today.