[asterisk-users] Check for the voicemail

Raj Mathur ( राज माथुर ) raju at linux-delhi.org
Tue Aug 21 21:17:13 CDT 2012


On Tuesday 21 Aug 2012, Ruben Rögels wrote:
> Hello,
> 
> no problem at all, I think this is the tricky part.
> 
> A smtp dialogue between your email client and a smtp server normally
> looks like this:
> 
> user at box:~? netcat mx1.example.com
> 220 postfix ESMTP mx1.example.com
> helo me.local
> 250 mx1.example.com
> mail from: <ruben.roegels at wiseape.de>
> 250 2.1.0 Ok
> rcpt to: <ruben.roegels at example.com>
> 450 5.7.1 <ruben.roegels at example.com>: Mailbox Full
> 
> The tricky part is writing or finding a console smtp client that
> gives you feedback about the 450 error that just happened.
> Right now I cannot give you a precise way to do that, but I have
> basic understanding of the technology, so I know that it is possible
> to do so ;-)
> 
> I'm looking around in the net, because I think I'll soon have to
> handle your problem aswell in my company ;-)
> If I can find solution, I'll post it.

Something like this ought to do it:

(sleep 5; echo HELO foo; sleep 1; \
  echo mail from: foo at example.com; sleep 1; \
  echo rcpt to: userid.that at youwant.to.check; sleep 1; \
  echo data; echo test; echo .; sleep 1; echo quit) | \
  telnet mail.ho.st 25 2>&1 | fgrep -q '450 5.7.1' && notify-user.sh

Of course, it's probably better to wrap this into a Perl or equivalent 
script, but it should work on the shell too.

Regards,

-- Raj
-- 
Raj Mathur                          || raju at kandalaya.org   || GPG:
http://otheronepercent.blogspot.com || http://kandalaya.org || CC68
It is the mind that moves           || http://schizoid.in   || D17F



More information about the asterisk-users mailing list