LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-24-2019, 09:11 PM   #1
dcroxton
Member
 
Registered: Apr 2004
Distribution: Ubuntu Jaunty
Posts: 80

Rep: Reputation: 16
Unable to send email from within asterisk -- DSN: Host unknown


I have been trying to get my Asterisk server (which is incredible pbx running on a raspberry pi) to send voicemails as emails. I only want it to send within my local network. The hub is another embedded Linux (on an old SheevaPlug) running bind9 and dovecot. I know I have it working in principle because my nas4free box sends an email nightly. I also know that I can send an email from the asterisk computer because I can send a test email through Webmin. Unfortunately, when Asterisk tries to send an email it always fails for one reason or another.

The latest error message I'm getting is:
Code:
Apr 24 21:48:45 incrediblepi sendmail[6739]: x3P1mjeq006739: from=asterisk, size=21780, class=0, nrcpts=1, msgid=<Asterisk-7-197444682-702-1613@incrediblepi>, relay=asterisk@localhost
Apr 24 21:48:45 incrediblepi sm-mta[6740]: x3P1mjhh006740: from=<asterisk@incrediblepi.westphalia.org>, size=21938, class=0, nrcpts=1, msgid=<Asterisk-7-197444682-702-1613@incrediblepi>, proto=ESMTP, daemon=MTA-v4, relay=incrediblepi.westphalia.org [127.0.0.1]
Apr 24 21:48:45 incrediblepi sendmail[6739]: x3P1mjeq006739: to="Derek" <dcroxton@oxenstierna.westphalia.org>, ctladdr=asterisk (1001/1001), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=51780, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (x3P1mjhh006740 Message accepted for delivery)
Apr 24 21:48:45 incrediblepi sm-mta[6742]: x3P1mjhh006740: to=<dcroxton@oxenstierna.westphalia.org>, ctladdr=<asterisk@incrediblepi.westphalia.org> (1001/1001), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=141938, relay=192.168.0.103, dsn=5.1.2, stat=Host unknown (Name server: 192.168.0.103: host not found)
Apr 24 21:48:45 incrediblepi sm-mta[6742]: x3P1mjhh006740: x3P1mjhh006742: DSN: Host unknown (Name server: 192.168.0.103: host not found)
Apr 24 21:48:45 incrediblepi sm-mta[6742]: x3P1mjhh006742: to=<asterisk@incrediblepi.westphalia.org>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent
As you can see, it appears to be failing because it doesn't recognize the name server, 192.168.0.103. Which is really weird, because that is the IP address of my internal nameserver, which I can ping from the command line, do nslookups, etc. on the asterisk box. I have no idea why it would say "host not found."

I realize there are several things that are not optimal about my setup, such as my choice of "westphalia.org" as a domain (since it actually exists). I have worked around that problem by setting my internal dns as the primary, and that does not appear to be at issue here.

My asterisk instance runs fine otherwise. I am really weak on asterisk, but it appears that everything is set up correctly; the message gets to sendmail and gets approved, but it gets stuck on this issue about finding the dns host which seems like it would be the least issue. Any suggestions would be appreciated.
 
Old 04-25-2019, 06:26 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,470

Rep: Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755
Hi,

Quote:
Apr 24 21:48:45 incrediblepi sm-mta[6742]: x3P1mjhh006740: to=<dcroxton@oxenstierna.westphalia.org>, ctladdr=<asterisk@incrediblepi.westphalia.org> (1001/1001), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=141938, relay=192.168.0.103, dsn=5.1.2, stat=Host unknown (Name server: 192.168.0.103: host not found)
From the above snippet, looks like you're using 192.168.0.103 as a smarthost in order to send out emails (in bold above).
You get an answer from the smarthost that it cannot find the MX record of oxenstierna.westphalia.org in order to deliver the email and so it returns a "stat=Host unknown" error.

Regards
 
1 members found this post helpful.
Old 04-25-2019, 08:00 PM   #3
dcroxton
Member
 
Registered: Apr 2004
Distribution: Ubuntu Jaunty
Posts: 80

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by bathory View Post
Hi,


From the above snippet, looks like you're using 192.168.0.103 as a smarthost in order to send out emails (in bold above).
You get an answer from the smarthost that it cannot find the MX record of oxenstierna.westphalia.org in order to deliver the email and so it returns a "stat=Host unknown" error.

Regards
Thanks for the reply. Any idea why it si having trouble finding the MX record in this case? I can send an email from the same computer (incrediblepi) to the same address (see attachment), and I get a nightly email from another computer to the same address (other attachment). What is it about this one that is different from the other two?
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2019-04-25_20-56-32.png
Views:	3
Size:	20.3 KB
ID:	30420   Click image for larger version

Name:	Screenshot_2019-04-25_20-59-50.png
Views:	3
Size:	16.1 KB
ID:	30421  
 
Old 04-26-2019, 03:11 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,470

Rep: Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755
Quote:
Thanks for the reply. Any idea why it si having trouble finding the MX record in this case? I can send an email from the same computer (incrediblepi) to the same address (see attachment), and I get a nightly email from another computer to the same address (other attachment). What is it about this one that is different from the other two?
I'm not familiar with asterisk, but looks like it could use it's own resolver if it finds libunbound installed.

I guess that's the case here, since you can send an email from incrediblepi to oxenstierna from the same box asterisk is running on, but you get that error with emails sent from asterisk itself.
 
Old 04-27-2019, 02:52 PM   #5
dcroxton
Member
 
Registered: Apr 2004
Distribution: Ubuntu Jaunty
Posts: 80

Original Poster
Rep: Reputation: 16
Bathory, thanks again for taking time to reply. I solved the problem with some help from someone else. I think you were telling me the correct thing, but I didn't fully understand it. For those in my boat, the "(Name server: 192.168.0.103: host not found)" message was a result of Asterisk trying to look up "192.168.0.103" (the SMTP server) as though it were a resolvable DNS address rather than a straight IP address. I changed it to use the FQDN (oxenstierna.westphalia.org) and it worked fine. The person who helped me with this suggested that it might be possible to use an IP address as the SMTP server if you put it in brackets, which I haven't tried but I will keep it in mind.
 
Old 04-28-2019, 11:49 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,470

Rep: Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755Reputation: 1755
Quote:
The person who helped me with this suggested that it might be possible to use an IP address as the SMTP server if you put it in brackets, which I haven't tried but I will keep it in mind.
You're right.
If you put the IP address of the smarthost in square brackets, sendmail is not going to try to resolve it.

Anyway, I'm glad to see that you've sorted this out.

Cheers
 
1 members found this post helpful.
  


Reply

Tags
asterisk, bind9, dovecot, email


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
question: 'onclick' within 'onmouseover' within 'form' within 'table' - how is it possible? rblampain Programming 4 04-25-2017 08:49 PM
dsn=5.1.2, stat=Host unknown (Name server: medicherlas89 Linux - Networking 6 06-22-2015 01:19 AM
sendmail error: user unknown dsn=5.1.1 raphael75 Linux - Newbie 5 01-16-2014 12:47 PM
dsn=5.7.1, stat=User unknown raphael75 Linux - Newbie 2 03-08-2013 09:15 AM
Perl email::send.. how to send the email? hawk__0 Programming 6 12-24-2009 01:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration