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:
http://linuxconfig.org/configuring-gmail-as-sendmail-email-relay
But when I try a really simple command line send, I don't receive any message.
when I look in sendmail.mc, 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...?
Silas2Asked:
Who is Participating?
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.

carlmdCommented:
In the sendmail.cf 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 anybody@anywhere.com
0
carlmdCommented:
Also, you typically need to configure your mail server to accept a relay from the ip of the system with sendmail.
0
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:
AuthInfo: "U:root" "I:YOUR GMAIL EMAIL ADDRESS" "P:YOUR PASSWORD"
and
makemap hash gmail-auth < gmail-auth
(i'm not using gmail though)
but its still using this old domain...
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

carlmdCommented:
You can set the domain name you want to use in the sendmail.cf file.

Locate this section...

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.Foo.COM
Djmydomainchoice.com

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 sendmail.cf file
   (refresh -s sendmail)

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

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:
MAIL.Djmydomainchoice.com
(or whatever the mail server is called)?
0
carlmdCommented:
No, the Dj is the definition part and must come first, and the domain is the rest.

For example:   DJgoogle.com would send mail as if it was from google.com

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

Open in new window

Was that wrong?
0
carlmdCommented:
The changes I indicated were for the sendmail.cf file not the sendmail.mc

sendmail.cf is created when you run m4 on the .mc

Please post the output showing the error using  "mail -v" option
0
Silas2Author Commented:
This is the -v read-out. The truenotesdomain.com is an old domain that  I dont' want to use as an smtp relay
root@mail:/etc/mail/authinfo# sendmail -v hotmailrecip@hotmail.com
helo
hotmailrecip@hotmail.com... Connecting to [127.0.0.1] via relay...
220 mail.truenotesdomain.co.uk 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 [127.0.0.1]
>>> EHLO mail.truenotesdomain.co.uk
250-mail.truenotesdomain.co.uk Hello ip6-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:<root@mail.truenotesdomain.co.uk> SIZE=5 AUTH=root@mail.truenotesdomain.co.uk
250 2.1.0 <root@mail.truenotesdomain.co.uk>... Sender ok
>>> RCPT To:<hotmailrecip@hotmail.com>
>>> DATA
250 2.1.5 <hotmailrecip@hotmail.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
050 <hotmailrecip@hotmail.com>... Connecting to mx3.hotmail.com. via esmtp...
050 220 COL004-MC4F21.hotmail.com Sending unsolicited commercial or bulk e-mail to Microsoft's computer network is prohibited. Other restrictions are found at http://privacy.microsoft.com/en-us/anti-spam.mspx. Tue, 7 Jul 2015 07:28:48 -0700
050 >>> EHLO mail.truenotesdomain.co.uk
050 250-COL004-MC4F21.hotmail.com (3.21.0.194) Hello [162.13.42.109]
050 250-SIZE 36909875
050 250-PIPELINING
050 250-8bitmime
050 250-BINARYMIME
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 mail.truenotesdomain.co.uk
050 250-COL004-MC4F21.hotmail.com (3.21.0.194) Hello [162.13.42.109]
050 250-SIZE 36909875
050 250-PIPELINING
050 250-8bitmime
050 250-BINARYMIME
050 250-CHUNKING
050 250-AUTH LOGIN
050 250-AUTH=LOGIN
050 250 OK
050 >>> MAIL From:<root@mail.truenotesdomain.co.uk> SIZE=318 AUTH=<>
050 250 root@mail.truenotesdomain.co.uk....Sender OK
050 >>> RCPT To:<hotmailrecip@hotmail.com>
050 >>> DATA
050 250 hotmailrecip@hotmail.com
050 354 Start mail input; end with <CRLF>.<CRLF>
050 >>> .
050 250  <201507071428.t67ESZ2A008303@mail.truenotesdomain.co.uk> Queued mail for delivery
050 <hotmailrecip@hotmail.com>... Sent ( <201507071428.t67ESZ2A008303@mail.truenotesdomain.co.uk> Queued mail for delivery)
250 2.0.0 t67ESdSD008304 Message accepted for delivery
hotmailrecip@hotmail.com... Sent (t67ESdSD008304 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT

Open in new window

0
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?
0
carlmdCommented:
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.
0
Silas2Author Commented:
Noooooo, i'm saying the mail server mail.truenotesdomain.com is not the mail server I want to use, I want to use:
mail.mynewdomain.com
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...
0
Jan SpringerCommented:
Did you run /etc/mail/make  after you updated sendmail.mc?

If so, did you "kill -HUP <pid of sendmail accepting connections"
0
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)
0
Jan SpringerCommented:
restarted works, also,

grep DS /etc/mail/sendmail.cf

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

     grep -i smart /etc/mail/sendmail.mc

as root,
    /etc/mail/make
         or
    make -C /etc/mail

then,
    grep DS /etc/mail/sendmail.cf
0
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?
0
Jan SpringerCommented:
it's "make" not "Make" and what is does it does is rebuild your sendmail.mc to a sendmail.cf (along with your other files in that directory) -- not sendmail itself.
0
carlmdCommented:
Did you set the smart host in sendmail.cf as per my first post above ID: 40870553? That controls where it sends the outgoing mail.
0
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/sendmail.mc and optionally
   to /etc/mail/submit.mc:
  include(`/etc/mail/sasl/sasl.m4')dnl
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:
  /etc/mail/relay-domains
** ** You should issue `/etc/init.d/sendmail reload` ** **

Open in new window

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

have you reloaded/restarted sendmail?

is the smarthost listed in sendmail.cf?

are you using SMTP AUTH for IP addresses not trusted?
0
Silas2Author Commented:
Thanks for all your help. Let me just try...
0
carlmdCommented:
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
0
Jan SpringerCommented:
it's all well and good to directly modify the sendmail.cf *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.
0
Silas2Author Commented:
End of day now...back to it tmrw
0
Jan SpringerCommented:
if you have teamviewer and want to use that for assistance, drop me an email at EE.
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.