Sendmail Fails to send emails from Linux server.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sendmail Fails to send emails from Linux server.
# 15  
Old 09-08-2017
Error

Here is what i did.

Please suggest if i missed anything; still no luck though Smilie.

Step1:
Code:
[root@development_techx ~]#  makemap hash /etc/mail/default-auth-info</etc/mail/default-auth-info
[root@development_techx ~]# more /etc/mail/default-auth-info
AuthInfo:smtp.zoho.com "U:mohtashim@techx.com" "P:mypassword" "M:PLAIN"

Step2:
Enabled the below in /etc/mail/sendmail.cf
Code:
# default authentication information for outgoing connections
O DefaultAuthInfo=/etc/mail/default-auth-info

Step 3:
Restart sendmail service.

Below is the configuration from the sendmail.cf file.
Code:
[root@development_digiklug ~]# grep -i authinfo /etc/mail/sendmail.cf
O DefaultAuthInfo=/etc/mail/default-auth-info
###  authinfo: lookup authinfo in the access map
Sauthinfo
R$*             $: $1 $| $>D <$&{server_name}> <?> <! AuthInfo> <>
R$* $| <?>$*    $: $1 $| $>A <$&{server_addr}> <?> <! AuthInfo> <>
R$* $| <?>$*    $: $1 $| <$(access AuthInfo: $: ? $)> <>
R$* $| <?>$*    $@ no                           no authinfo available

Can you tell me if the above looks good ?

However it still fails with the same error as in my previous post.

Quote:
Sep 8 10:13:48 Development_techx sendmail[3066]: v88ADm38003066: from=<root@dev.techx.com>, size=450, class=0, nrcpts=1, msgid=<201709081013.v88ADmET003065@dev.techx.com>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Sep 8 10:13:48 Development_techx sendmail[3065]: v88ADmET003065: to=mohtashim@techx.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30204, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v88ADm38003066 Message accepted for delivery)
Sep 8 10:13:49 Development_techx sendmail[3068]: STARTTLS=client, relay=smtp.zoho.com., version=TLSv1/SSLv3, verify=FAIL, cipher=AES128-SHA, bits=128/128
Sep 8 10:13:50 Development_techx sendmail[3068]: v88ADm38003066: to=<mohtashim@techx.com>, ctladdr=<root@dev.techx.com> (0/0), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=120450, relay=smtp.zoho.com. [8.40.222.118], dsn=5.0.0, stat=Service unavailable
Sep 8 10:13:50 Development_techx sendmail[3068]: v88ADm38003066: v88ADo38003068: DSN: Service unavailable
Sep 8 10:13:50 Development_techx sendmail[3068]: v88ADo38003068: to=<root@dev.techx.com>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31679, dsn=2.0.0, stat=Sent
@drysdalk: A better bet here is to find another host on your network that can actualy be configured to act as a genuine smart relay for your domain, and to just set Sendmail up to use that host as its smart relay rather than this external service.

Can you suggest any freeware and how to configure/install it so that we don't end up in a similar situation ?

---------- Post updated at 09:20 AM ---------- Previous update was at 03:51 AM ----------

UPDATE: One of the Admin had installed a software called as Jira on the same system and JIRA is able to send out emails to our email ID from info@dev.techx.com to mohtashim@techx.com.

I dont know how does it do that nor can i figure it out.

Anyways it will be great if i could find a solution to sending emails to mohtashim@techx.com from this server.

Last edited by mohtashims; 09-08-2017 at 09:47 AM..
# 16  
Old 09-08-2017
Hi,

Now that you've fixed your host file problem, you might not actually need the smart relay. What happens if you take it out (just going back to the blank DS line), but keep the hosts file changes you made ?
# 17  
Old 09-08-2017
Quote:
Originally Posted by drysdalk
Hi,

Now that you've fixed your host file problem, you might not actually need the smart relay. What happens if you take it out (just going back to the blank DS line), but keep the hosts file changes you made ?
It still does not work. I will update the maillog in a few hrs.

Here is what I think.

1. I think we need to enable TLS in sendmail for zoho to work. Not sure how to do that if someone can help.

2. Would appreciate some document web resource that helps easily setup smart relay on Linux centos 7as an alternate incase zoho does not work.

3. Below is the configuration that helps softwares on my server to send out emails using the same zoho.
Code:
production: email_delivery: 
delivery_method: :smtp 
  smtp_settings: 
    address: smtp.zoho.com
    enable_starttls_auto: true
    port: 587
    domain: tech.com
    authentication: :login 
    user_name: mohtashim@techx.com
    password: redmine

# 18  
Old 09-09-2017
Hi,

OK, thanks - it would be interesting to know exactly why this didn't work, and what precisely caused the mail delivery to fail, which we'll hopefully get clues about from your mail logs.

One thing I'm not 100% clear on is why you actually need a smart relay here. Ultimately, barring there being networking restrictions in place that prevent your host communicating over SMTP with the outside world, there's nothing a dedicated smart relay box can do that your own local Sendmail install can't. Unless as I say something is configured on your network to stop your own dev box sending mail to the Internet, then it shoud be perfectly capable of delivering e-mail via SMTP to any host without needing a relay.

Of course, other hosts may well still reject that mail for a variety of reasons (e.g. they think it resembles spam, your IP/network range has a poor reputation, your reverse DNS doesn't match your forward DNS, you've gotten yourself listed on an RBL like Spamhaus, etc, etc). So if that's the reason you need a smart host - your own dev box is being rejected by other Internet hosts - then you'd need a smart host on your network that had none of the problems of your dev box, which might actually be hard to do.

Do you have a corporate SMTP gateway or mail server that deals with the normal incoming and outgoing e-mail for your whole site ? If so, can you maybe configure your smart relay to be that host instead. I imagine that somewhere locally you already have a host that handles routine e-mail functionality, and it might well be capable of acting as a smart relay in that case (though it will probably need to be configured to allow the IP of your dev box to relay through it).
# 19  
Old 09-09-2017
Error

Quote:
Originally Posted by drysdalk
Hi,

OK, thanks - it would be interesting to know exactly why this didn’t work, and what precisely caused the mail delivery to fail, which we’ll hopefully get clues about from your mail logs.

One thing I’m not 100% clear on is why you actually need a smart relay here. Ultimately, barring there being networking restrictions in place that prevent your host communicating over SMTP with the outside world, there’s nothing a dedicated smart relay box can do that your own local Sendmail install can’t. Unless as I say something is configured on your network to stop your own dev box sending mail to the Internet, then it shoud be perfectly capable of delivering e-mail via SMTP to any host without needing a relay.

Of course, other hosts may well still reject that mail for a variety of reasons (e.g. they think it resembles spam, your IP/network range has a poor reputation, your reverse DNS doesn’t match your forward DNS, you’ve gotten yourself listed on an RBL like Spamhaus, etc, etc). So if that’s the reason you need a smart host - your own dev box is being rejected by other Internet hosts - then you’d need a smart host on your network that had none of the problems of your dev box, which might actually be hard to do.

Do you have a corporate SMTP gateway or mail server that deals with the normal incoming and outgoing e-mail for your whole site ? If so, can you maybe configure your smart relay to be that host instead. I imagine that somewhere locally you already have a host that handles routine e-mail functionality, and it might well be capable of acting as a smart relay in that case (though it will probably need to be configured to allow the IP of your dev box to relay through it).
In my previous post i strongly believe that it is the missing TLS entries in the sendmail.mc or .cf that is causing the send mail not to work. The reason behind this conclusion is that SMTP email service for zoho is working on my same server with the below details.

Code:
production: email_delivery: 
delivery_method: :smtp 
  smtp_settings: 
    address: smtp.zoho.com
    enable_starttls_auto: true
    port: 587
    domain: tech.com
    authentication: :login 
    user_name: mohtashim@techx.com
    password: redmine

Removing the TLS entry enable_starttls_auto: true from SMTP fails the email service from working. However, i need help directions in enabling TLS on sendmail.

I was able to fix the relay host not being generated in the sendmail.cf file by fixing the syntax issue in the sendmail.mc file.

Please find the logs after the hosts file was fixed below with DSsmtp.zoho.com entry in the sendmail.cf & Mail NOT working below.

Quote:
Sep 9 17:00:34 Development_techx sendmail[12215]: v89H0Ys2012215: from=root, size=201, class=0, nrcpts=1, msgid=<201709091700.v89H0Ys2012215@dev.techx.com>, relay=root@localhost
Sep 9 17:00:34 Development_techx sendmail[12216]: v89H0YsW012216: from=<root@dev.techx.com>, size=447, class=0, nrcpts=1, msgid=<201709091700.v89H0Ys2012215@dev.techx.com>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Sep 9 17:00:34 Development_techx sendmail[12215]: v89H0Ys2012215: to=mohtashim@techx.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30201, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v89H0YsW012216 Message accepted for delivery)
--->> 30 odd seconds pause....
Sep 9 17:02:14 Development_techx sendmail[12199]: v89GxL6T012197: to=<mohtashim@techx.com>, ctladdr=<root@dev.techx.com> (0/0), delay=00:02:53, xdelay=00:02:53, mailer=relay, pri=120447, relay=smtp.zoho.com. [8.40.222.118], dsn=4.0.0, stat=Deferred: Connection reset by smtp.zoho.com.
Attaching the sendmail.mc here.

Please suggest.

Last edited by mohtashims; 09-09-2017 at 02:12 PM..
# 20  
Old 09-11-2017
Hi,

Sorry for the delay in replying - glad you've gotten your Sendmail config generating correctly now at least. I'm afraid I can't really help you much further though, sorry. I've got no experience myself in setting up Sendmail to do what you're trying to do, as I've never had to set up a Sendmail box to do quite what you're trying to do.

From some Googling it seems it's certainly possible to get Sendmail to talk to an MSA rather than an MTA and authenticate against it using the authinfo mechanism previously discussed, but as you say you might need to get TLS and other things besides working for this to operate correctly. Perhaps others who have gone down this road and are reading this thread could advise you on how to proceed, if this is really something you absolutely have to do.

On that subject, though: again, is there a reason you have to do this, and pass the mail on to a server that is normally used for talking to mail clients and whatnot ? Why can't you just straight send this mail to its correct destination from your local server, without a relay or smart host or anything else in the way ? Or alternatively, is there not a mail server on site that already is set up to do e-mail correctly that you can just use as your smart relay, saving yourself all this trouble ?
# 21  
Old 09-12-2017
Tools

Quote:
Originally Posted by drysdalk
Hi,

Sorry for the delay in replying - glad you’ve gotten your Sendmail config generating correctly now at least. I’m afraid I can’t really help you much further though, sorry. I’ve got no experience myself in setting up Sendmail to do what you’re trying to do, as I’ve never had to set up a Sendmail box to do quite what you’re trying to do.

From some Googling it seems it’s certainly possible to get Sendmail to talk to an MSA rather than an MTA and authenticate against it using the authinfo mechanism previously discussed, but as you say you might need to get TLS and other things besides working for this to operate correctly. Perhaps others who have gone down this road and are reading this thread could advise you on how to proceed, if this is really something you absolutely have to do.

On that subject, though: again, is there a reason you have to do this, and pass the mail on to a server that is normally used for talking to mail clients and whatnot ? Why can’t you just straight send this mail to its correct destination from your local server, without a relay or smart host or anything else in the way ? Or alternatively, is there not a mail server on site that already is set up to do e-mail correctly that you can just use as your smart relay, saving yourself all this trouble ?
Quote:
Or alternatively, is there not a mail server on site that already is set up to do e-mail correctly that you can just use as your smart relay, saving yourself all this trouble ?
Our domain is techx.com however does not have any smtp service like smtp.techx.com. Infact techx.com domain is actually provided by same zoho.com.

Quote:
Why can’t you just straight send this mail to its correct destination from your local server, without a relay or smart host or anything else in the way ?
I m not sure how to setup using this approach. Any guide / link with step by step approach for Linux centos 7 in this regards would be appreciated. All i need is the outgoing emails from my linux server to work.

Last edited by mohtashims; 09-13-2017 at 12:12 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to configure mutt to send emails on Linux.?

Hello, I am trying to use mutt in order to send emails. I have installed mutt using yum and pasted some details about it later in the post. When I try to run: echo test | mutt -s "Test Email" user@id.com It doesn't do anything. I dont receive any emails. I have the SMTP details for... (1 Reply)
Discussion started by: vaibhavraj
1 Replies

2. AIX

Sendmail daemon is inactive, but still i can send emails

Hi, I did setup sendmail on one of AIX LPARs. Its working as expected. But, would like to clarify something with you all. I stopped the sendmail daemon on AIX LPAR, now it is inactive(&commented it on /etc/rc.tcpip ). But still, am able to send the emails even after stopping daemon. ... (6 Replies)
Discussion started by: system.engineer
6 Replies

3. UNIX for Dummies Questions & Answers

Emails sent from Linux server are rejected by recipient

Hello i have this longterm issue which im unable to solve, i think this is quite simple issue, i hope you may know the cause It is on CentOS Redhat server with qmail installed. # service qmail status # service qmail start Starting Qmail: # ps aux | grep mail qmails 1688 0.0 0.0 ... (1 Reply)
Discussion started by: postcd
1 Replies

4. Linux

Sendmail takes too long to start and the host is unable to send emails

Hello All, Sendmail takes too long to start and the host is unable to send emails, below are the steps followed, Please let me know if I'm missing anything, is there a debug mode for mailx? # time service sendmail restart Shutting down sm-client: Shutting... (6 Replies)
Discussion started by: lovesaikrishna
6 Replies

5. UNIX for Advanced & Expert Users

mailx Vs sendmail to send internal emails to exchange

Hi Gurus, I have been searching for this around, but sendmail seems complicated and not sure if "mail" command would do, since all what I need to send internal emails from my solaris 10 box to our exchange server. Would the mailx or mail command do ? I tried the : # mailx -s test... (2 Replies)
Discussion started by: aladdin
2 Replies

6. UNIX for Dummies Questions & Answers

Can't configure sendmail to send mails to external SMTP Server

Hi all,I know, that this is very common issue, but I can't find where is the problem... I have Solaris 10 installed.I want to send mail to external SMTP server, like:echo "letter body"| mailx -s "subject" test@test.comBut I donno what kind of changes I have to do in /etc/hosts and sendmail.cf or... (5 Replies)
Discussion started by: nypreH
5 Replies

7. Shell Programming and Scripting

Send email from sendmail on AIX using exchange server as SMTP server

i am new in AIX i am trying to write a script to take a backup for specific files on server to and check error log if backup success send email to administrator , script done except for sending mail , i try to configure sendmail on aix to use our exchange server to send emails but still get error... (0 Replies)
Discussion started by: ahmed_salah
0 Replies

8. UNIX for Dummies Questions & Answers

How do I configure Linux server to be able to send emails internally?

Hi The script: #!/bin/sh #set -x # set admin email so that you can get email ADMIN="myemailaddress" # set alert level ALERT=4 df -HP | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; do #echo $output usep=$(echo $output | awk '{ print... (5 Replies)
Discussion started by: wbdevilliers
5 Replies

9. Red Hat

Sendmail fails receiving mail since the IP changed on Redhat Server

Hi, Since i move my Linux Redhat server on another Network with new IP address. WE'RE ABLE TO SEND MAIL OUTSIDE BUT we can not receive any incoming mail. It alway points to the old IP. I updated new IP in /etc/hosts and /etc/sysconfig/network then reboot the system. 10.117.32.20 is an old ip... (3 Replies)
Discussion started by: lamoul
3 Replies

10. Solaris

how to send mails to users on exchange server from sendmail/solaris(mailx)

Hi, Can anyone pls. tell me how to access Active directory from solaris. I am looking at solution by which I can send mail notification from the logs generated by scripts, to the users on Exchange server. I am trying for a Perl-LDAP module , but don't realy know how to go for it (5 Replies)
Discussion started by: ganeshh
5 Replies
Login or Register to Ask a Question