<p>I would simply send the message with sendmail -v and then grep the output for the error message</p>
<div class="gmail_quote">Il giorno 22/ago/2012 04:19, "Raj Mathur (राज माथुर)" <<a href="mailto:raju@linux-delhi.org">raju@linux-delhi.org</a>> ha scritto:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tuesday 21 Aug 2012, Ruben Rögels wrote:<br>
> Hello,<br>
><br>
> no problem at all, I think this is the tricky part.<br>
><br>
> A smtp dialogue between your email client and a smtp server normally<br>
> looks like this:<br>
><br>
> user@box:~? netcat <a href="http://mx1.example.com" target="_blank">mx1.example.com</a><br>
> 220 postfix ESMTP <a href="http://mx1.example.com" target="_blank">mx1.example.com</a><br>
> helo me.local<br>
> 250 <a href="http://mx1.example.com" target="_blank">mx1.example.com</a><br>
> mail from: <<a href="mailto:ruben.roegels@wiseape.de">ruben.roegels@wiseape.de</a>><br>
> 250 2.1.0 Ok<br>
> rcpt to: <<a href="mailto:ruben.roegels@example.com">ruben.roegels@example.com</a>><br>
> 450 5.7.1 <<a href="mailto:ruben.roegels@example.com">ruben.roegels@example.com</a>>: Mailbox Full<br>
><br>
> The tricky part is writing or finding a console smtp client that<br>
> gives you feedback about the 450 error that just happened.<br>
> Right now I cannot give you a precise way to do that, but I have<br>
> basic understanding of the technology, so I know that it is possible<br>
> to do so ;-)<br>
><br>
> I'm looking around in the net, because I think I'll soon have to<br>
> handle your problem aswell in my company ;-)<br>
> If I can find solution, I'll post it.<br>
<br>
Something like this ought to do it:<br>
<br>
(sleep 5; echo HELO foo; sleep 1; \<br>
echo mail from: <a href="mailto:foo@example.com">foo@example.com</a>; sleep 1; \<br>
echo rcpt to: userid.that@youwant.to.check; sleep 1; \<br>
echo data; echo test; echo .; sleep 1; echo quit) | \<br>
telnet <a href="http://mail.ho.st" target="_blank">mail.ho.st</a> 25 2>&1 | fgrep -q '450 5.7.1' && notify-user.sh<br>
<br>
Of course, it's probably better to wrap this into a Perl or equivalent<br>
script, but it should work on the shell too.<br>
<br>
Regards,<br>
<br>
-- Raj<br>
--<br>
Raj Mathur || <a href="mailto:raju@kandalaya.org">raju@kandalaya.org</a> || GPG:<br>
<a href="http://otheronepercent.blogspot.com" target="_blank">http://otheronepercent.blogspot.com</a> || <a href="http://kandalaya.org" target="_blank">http://kandalaya.org</a> || CC68<br>
It is the mind that moves || <a href="http://schizoid.in" target="_blank">http://schizoid.in</a> || D17F<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</blockquote></div>