[asterisk-users] Check for the voicemail

Roberto Piola roberto.piola at visiant.it
Wed Aug 22 00:02:28 CDT 2012


I would simply send the message with sendmail -v and then grep the output
for the error message
Il giorno 22/ago/2012 04:19, "Raj Mathur (राज माथुर)" <raju at linux-delhi.org>
ha scritto:

> 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
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>                http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120822/4fc8f7c4/attachment.htm>


More information about the asterisk-users mailing list