[SOLVED] Unable to send email from within asterisk -- DSN: Host unknown
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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?
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.