Connection timeout in postfix for e-mail messages from Asterisk
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Connection timeout in postfix for e-mail messages from Asterisk
Hello,
I just set up a little home PBX using Switchvox. (yes, proprietary, i know, but I'm just learning...) Everything is working great, inbound and outbound calls, etc. I only have one problem: e-mail notification for voicemails does not work.
Looking at /var/log/mail.log on my smtp server, I see the following messages:
Successful message, sent using mutt.
PHP Code:
Nov 19 23:17:55 smtp postfix/smtpd[394]: connect from unknown[172.16.32.202] Nov 19 23:17:55 smtp postfix/smtpd[394]: DD92CC3E930: client=unknown[172.16.32.202] Nov 19 23:17:55 smtp postfix/cleanup[375]: DD92CC3E930: message-id=<20091120041755.GA8931@mydomain.ca> Nov 19 23:17:55 smtp postfix/qmgr[337]: DD92CC3E930: from=<root@mydomain.ca>, size=637, nrcpt=1 (queue active) Nov 19 23:17:55 smtp postfix/smtpd[394]: disconnect from unknown[172.16.32.202] Nov 19 23:17:56 smtp postfix/smtp[393]: DD92CC3E930: to=<my.email@gmail.com>, relay=gmail-smtp-in.l.google.com >[74.125.93.27]:25, delay=0.91, delays=0.01/0/0.31/0.58, dsn=2.0.0, status=sent (250 2.0.0 OK 1258690676 6si3322158qwk.41) Nov 19 23:17:56 smtp postfix/qmgr[337]: DD92CC3E930: removed
Failed message, sent using Asterisk/switchvox
PHP Code:
Nov 19 23:21:42 smtp postfix/smtpd[397]: connect from pbx.mydomain.ca[172.16.32.215] Nov 19 23:21:42 smtp postfix/smtpd[397]: DE858C3E930: client=pbx.mydomain.ca[172.16.32.215] Nov 19 23:21:42 smtp postfix/cleanup[401]: DE858C3E930: message-id=<Asterisk-6-581817921-101-15249@pbx.mydomain.ca> Nov 19 23:21:42 smtp postfix/qmgr[337]: DE858C3E930: from=<pbx@mydomain.ca>, size=1821, nrcpt=1 (queue active) Nov 19 23:21:42 smtp postfix/smtpd[397]: disconnect from pbx.mydomain.ca[172.16.32.215] Nov 19 23:31:43 smtp postfix/smtp[402]: DE858C3E930: host gmail-smtp-in.l.google.com[209.85.212.30] >said: 451 4.4.2 Timeout - closing connection. 38si1922093vws.65 (in reply to end of DATA command)
My ISP does allow port 25 outbound and the same problem occurs using exim4. Anyone have any idea what might be wrong?
I ran your script. Here's the message that it dumps in /tmp. Not sure what i'm looking for here...
PHP Code:
EHLO mydomain.ca MAIL From:<pbx@mydomain.ca> RCPT To:<matt@me.com> DATA Received: from mydomain.ca (mydomain.ca [127.0.0.1]) by mydomain.ca (8.13.8/8.13.8) with ESMTP id nAL5HwMw026363 for <matt@me.com>; Sat, 21 Nov 2009 00:17:58 -0500 Received: (from root@localhost) by mydomain.ca (8.13.8/8.13.8/Submit) id nAL5Hvf5026362; Sat, 21 Nov 2009 00:17:57 -0500 Date: Sat, 21 Nov 2009 00:17:56 -0500 From: PBX <pbx@mydomain.ca> To: Matthieu <matt@me.com> Subject: [PBX]: New message 11 in mailbox 101 Message-ID: <Asterisk-10-1854516493-101-17408@mydomain.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit
Dear Matthieu:
Just wanted to let you know you just received a 0:05 long message (number 11) in mailbox 101 from 6475551212, on Saturday, November 21, 2009 at 12:17:56 AM so you might want to check it when you get a chance.
You can check your message via the phone or use the links below to download your message:
Use the link below to just download the voicemail. *Note* This does not mark it as read in the system. https://mydomain.ca/main?cmd=play_voicemail&msgnum=10
Use this link below to download the voicemail and mark it as read. *Note* This will move this voicemail message to your Old folder and this link will no longer work. https://mydomain.ca/main?cmd=play_voicemail&msgnum=10&mark=read
Use this link below to download the voicemail and delete it. *Note* This will completely remove the voicemail from the system and this link will no longer work. https://mydomain.ca/main?cmd=play_voicemail&msgnum=10&mark=delete
Thanks! . I CAN RUN A SCRIPT AGAINST THE TMP FILE I could also continue the existing script that I am in and work with the file that I just created.
I tried telnet'ing in to the smtp server on port 25 and pasted the content of the mail.txt into the window. this is what I got:
PHP Code:
matthieu-mbp:~ matt$ telnet smtp 25 Trying 172.16.32.225... Connected to smtp.mydomain.ca. Escape character is '^]'. 220 smtp.mydomain.ca ESMTP Postfix (Debian/GNU) EHLO mydomain.ca MAIL From:<pbx@mydomain.ca> RCPT To:<matt@me.com> DATA Received: from mydomain.ca (mydomain.ca [127.0.0.1]) by mydomain.ca (8.13.8/8.13.8) with ESMTP id nAL5HwMw026363 for <matt@me.com>; Sat, 21 Nov 2009 00:17:58 -0500 Received: (from root@localhost) by mydomain.ca (8.13.8/8.13.8/Submit) id nAL5Hvf5026362; Sat, 21 Nov 2009 00:17:57 -0500 Date: Sat, 21 Nov 2009 00:17:56 -0500 From: PBX <pbx@mydomain.ca> To: Matthieu <matt@me.com> Subject: [PBX]: New message 11 in mailbox 101 Message-ID: <Asterisk-10-1854516493-101-17408@mydomain.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit
Dear Matthieu :
Just wanted to let you know you just received a 0:05 long message (number 11) in mailbox 101 from 6472697743, on Saturday, November 21, 2009 at 12:17:56 AM so you might want to check it when you get a chance.
You can check your message via the phone or use the links below to download your messag250-smtp.mydomain.ca 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN 250 2.1.0 Ok 250 2.1.5 Ok 354 End data with <CR><LF>.<CR><LF> o just download the voicemail. *Note* This does not mark it as read in the system. https://mydomain.ca/main?cmd=play_voicemail&msgnum=10
Use this link below to download the voicemail and mark it as read. *Note* This will move this voicemail message to your Old folder and this link will no longer work. https://mydomain.ca/main?cmd=play_voicemail&msgnum=10&mark=read
Use this link below to download the voicemail and delete it. *Note* This will completely remove the voicemail from the system and this link will no longer work. https://mydomain.ca/main?cmd=play_voicemail&msgnum=10&mark=delete
Darnit... Nothing is jumping out at me. The message looks good, and it appears to follow spec correctly (not an expert however).
I did notice however that mydomain.ca does have one problem..
host -t MX mydomain.ca
mydomain.ca has no MX record
You are going to want one, or larger domains will not always take your mail.
BTW, that MTA bash script that you ran to verify the mail, you are going to want to do a killall nc on that, as that is the listener for port 25. (I did say it is a toy)
oh actually my domain is yiptong.ca. I just have a habit of anonymizing myself.
$ host -t mx yiptong.ca
yiptong.ca mail is handled by 10 aspmx5.googlemail.COM.
yiptong.ca mail is handled by 5 ALT1.ASPMX.L.GOOGLE.COM.
yiptong.ca mail is handled by 5 ALT2.ASPMX.L.GOOGLE.COM.
yiptong.ca mail is handled by 1 ASPMX.L.GOOGLE.COM.
yiptong.ca mail is handled by 10 aspmx2.googlemail.COM.
yiptong.ca mail is handled by 10 aspmx3.googlemail.COM.
yiptong.ca mail is handled by 10 aspmx4.googlemail.COM.
I'm actually using google apps for my domain's mail. But I want to send mail from my server at home. Does that mean I need an MX record that points to my home server?
No, you dont need an MX record for your home. The way I had visualized your LAN arch had me confused. If you are using google apps for your domain email that should be fine, however your PBX might have to authenticate with your SMTP server. Are there options on the PBX for TLS or SSL authentication?
I am glad you like the script.. Thats the first one I have ever written where there were not a bunch of others out there that did similar things.. I am still kind of tempted to make a real MTA out of it, something that would support users and such, but I think that is going to wait until I finish my server monitoring suite of scripts.
My PBX connects to an open postfix server that I have on my LAN, which relays it to my ISP's mail server. So no, I don't think it needs authentication.
Looks like I'm out of luck eh. Thanks Guyverix for your help.
I think I'll install Trixbox or something, so that the PBX isn't a black box system and I can diagnose properly. Or maybe even manually configure Asterisk on Ubuntu or Debian. but not now.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.