LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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

Reply
 
Search this Thread
Old 11-19-2009, 11:37 PM   #1
ergosteur
LQ Newbie
 
Registered: Sep 2009
Posts: 14

Rep: Reputation: 0
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]: DD92CC3E930client=unknown[172.16.32.202]
Nov 19 23:17:55 smtp postfix/cleanup[375]: DD92CC3E930message-id=<20091120041755.GA8931@mydomain.ca>
Nov 19 23:17:55 smtp postfix/qmgr[337]: DD92CC3E930from=<root@mydomain.ca>, size=637nrcpt=(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]: DD92CC3E930to=<my.email@gmail.com>, relay=gmail-smtp-in.l.google.com
>[74.125.93.27]:25delay=0.91delays=0.01/0/0.31/0.58dsn=2.0.0status=sent (250 2.0.0 OK 1258690676 6si3322158qwk.41)
Nov 19 23:17:56 smtp postfix/qmgr[337]: DD92CC3E930removed 
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]: DE858C3E930client=pbx.mydomain.ca[172.16.32.215]
Nov 19 23:21:42 smtp postfix/cleanup[401]: DE858C3E930message-id=<Asterisk-6-581817921-101-15249@pbx.mydomain.ca>
Nov 19 23:21:42 smtp postfix/qmgr[337]: DE858C3E930from=<pbx@mydomain.ca>, size=1821nrcpt=(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]: DE858C3E930host gmail-smtp-in.l.google.com[209.85.212.30
>
said451 4.4.2 Timeout closing connection38si1922093vws.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?

Last edited by ergosteur; 11-21-2009 at 12:23 AM.
 
Old 11-20-2009, 08:54 AM   #2
Guyverix
Member
 
Registered: Nov 2008
Location: Washington State
Distribution: Mint
Posts: 31

Rep: Reputation: 2
I would almost guess that it is missing the CR LF . CR LF at the end of the message.. You could cheat..

http://www.linuxquestions.org/questi...highlight=bash

I posted a silly bash MTA / MDA that I wrote. It will bind to port 25, just have your PBX email there, and see what the message looks like.
 
Old 11-21-2009, 12:22 AM   #3
ergosteur
LQ Newbie
 
Registered: Sep 2009
Posts: 14

Original Poster
Rep: Reputation: 0
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.8with ESMTP id nAL5HwMw026363
for <matt@me.com>; Sat21 Nov 2009 00:17:58 -0500
Received
: (from root@localhost)
by mydomain.ca (8.13.8/8.13.8/Submitid nAL5Hvf5026362;
Sat21 Nov 2009 00:17:57 -0500
Date
Sat21 Nov 2009 00:17:56 -0500
From
PBX <pbx@mydomain.ca>
ToMatthieu <matt@me.com>
Subject: [PBX]: New message 11 in mailbox 101
Message
-ID: <Asterisk-10-1854516493-101-17408@mydomain.ca>
MIME-Version1.0
Content
-Typetext/plaincharset=ISO-8859-1
Content
-Transfer-Encoding8bit


Dear Matthieu
:

Just wanted to let you know you just received a 0:05 long message (number 11)
in mailbox 101 from 6475551212on SaturdayNovember 212009 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.
*
NoteThis 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.
*
NoteThis 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.
*
NoteThis 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:~ matttelnet 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.8with ESMTP id nAL5HwMw026363
for <matt@me.com>; Sat21 Nov 2009 00:17:58 -0500
Received
: (from root@localhost)
by mydomain.ca (8.13.8/8.13.8/Submitid nAL5Hvf5026362;
Sat21 Nov 2009 00:17:57 -0500
Date
Sat21 Nov 2009 00:17:56 -0500
From
PBX <pbx@mydomain.ca>
ToMatthieu  <matt@me.com>
Subject: [PBX]: New message 11 in mailbox 101
Message
-ID: <Asterisk-10-1854516493-101-17408@mydomain.ca>
MIME-Version1.0
Content
-Typetext/plaincharset=ISO-8859-1
Content
-Transfer-Encoding8bit


Dear Matthieu 
:

Just wanted to let you know you just received a 0:05 long message (number 11)
in mailbox 101 from 6472697743on SaturdayNovember 212009 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.
*
NoteThis 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.
*
NoteThis 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.
*
NoteThis 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!
.
250 2.0.0 Okqueued as 77240C3E92A 

Last edited by ergosteur; 11-21-2009 at 12:34 AM.
 
Old 11-22-2009, 04:09 AM   #4
Guyverix
Member
 
Registered: Nov 2008
Location: Washington State
Distribution: Mint
Posts: 31

Rep: Reputation: 2
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)

Last edited by Guyverix; 11-22-2009 at 04:11 AM.
 
Old 11-23-2009, 12:07 AM   #5
ergosteur
LQ Newbie
 
Registered: Sep 2009
Posts: 14

Original Poster
Rep: Reputation: 0
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?

Thanks for the script by the way, pretty handy.
 
Old 11-24-2009, 12:49 AM   #6
Guyverix
Member
 
Registered: Nov 2008
Location: Washington State
Distribution: Mint
Posts: 31

Rep: Reputation: 2
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.
 
Old 12-08-2009, 09:13 AM   #7
ergosteur
LQ Newbie
 
Registered: Sep 2009
Posts: 14

Original Poster
Rep: Reputation: 0
bump?
anyone have any ideas?
 
Old 12-10-2009, 02:08 AM   #8
Guyverix
Member
 
Registered: Nov 2008
Location: Washington State
Distribution: Mint
Posts: 31

Rep: Reputation: 2
Did you check and see about what I was asking? Does your google apps require TLS or SSL authentication for the email?

To be honest, I am running out of ideas other than possible authentication stuff.
 
Old 12-11-2009, 12:10 AM   #9
ergosteur
LQ Newbie
 
Registered: Sep 2009
Posts: 14

Original Poster
Rep: Reputation: 0
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.
 
  


Reply

Tags
asterisk, fail, smtp, timeout


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
Postfix - queue up messages while rolling out new mail server retrovertigo Linux - Server 4 03-03-2009 12:52 PM
Postfix Connection Timeout, CentOs joeyadms Linux - Server 5 05-18-2008 03:49 PM
Postfix: mail status=deferred, read timeout svesch Linux - Server 1 01-11-2008 04:43 AM
timeout after CONNECT from xxxx.com (postfix mail server) marmen Linux - Newbie 0 11-12-2007 03:57 AM
postfix - external mail reader doesn't get messages Danny Regan Debian 3 11-16-2005 08:30 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration