Thus spake Lindsay Haisley on Fri, Feb 03, 2006 at 10:32:08AM CST
> Thus spake Sam Varshavchik on Wed, Feb 01, 2006 at 08:25:11PM CST
> > Lindsay Haisley writes:
> > 
> > >I would like to be able to have courier return a temporary (4xx) error to
> > >corresponding servers with a custom failure message for one and only one
> > >address.  There seem to be lots of ways to generate a permanent (5xx) 
> > >error,
> > >or to generate a 4xx error for the entire server, but I can't find that 
> > >will
> > >generate a 4xx error for a single address, plus allow me to customze the
> > >error message.  Is there any way to do this?
> > 
> > No, I don't think there is a way to do this.
> 
> Yes there is.  Dave Platt pointed me to the solution:
> 
> > Set up a .mailfilters/rcptfilter-WHATEVER script file for this ID.
> > 
> > Have it simply do an
> > 
> >         echo "451 fee fie foe fam, I smell the blood of SMTP spam"
> >         EXITCODE=100
> 
> I was thinking that _any_ EXITCODE from rcptfilter other than 0 or 99
> returned a 5xx error, however apparently this isn't the case.  The above
> code quotes the echoed string directly to the SMTP dialog without prefixing
> any other error code, so whatever the number is at the beginning of this
> string will be the error returned by the SMTP session.

Sam, you're working too hard!  You're trying to do the work of a whole
development team <grin!>.  This has actually been possible for quite a
while.  In submit.C, function getrcpts(...):

                if (my_rcptinfo.errflag > 0)
                {
                const char *errmsg=my_rcptinfo.errmsgtext;
                int     l=atoi(errmsg);

                        if (l < 400 || l > 599) l=511;
                        mailfromerr(l, errmsg, 0);
                }

If the number at the beginning of the string echoed by maildrop (or some
other MDA filter) is < 400 or > 599, or if there is no number there, the
error number return is set to 511.  Otherwise, the user specified error is
returned to the requesting SMTP client.

I'll let this go now, but I had to figure out what goes on here :-)

Thanks to Dave Pratt for pointing me in the right direction.

-- 
Lindsay Haisley       | "Fighting against human |     PGP public key
FMP Computer Services |    creativity is like   |      available at
512-259-1190          |    trying to eradicate  | <http://pubkeys.fmp.com>
http://www.fmp.com    |        dandelions"      |
                      |      (Pamela Jones)     |


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to