Re: error documents and info email

From: PsychoTekk .de <psychotekk@dont-contact.us>
Date: Sat, 20 Jul 2002 06:28:58 -0500

> > second, it would be even easier to include all the info
> > automatically:
> > "admin@domain.net?subject=CacheErrMsg&body=all-the-data-goes-here".
> > to do so, one would have to modify errorpage.c lines 569 following:
>
> Good idea. especially considering that the mailto arguments are
> standard these days (RFC2368) (was not when the error page functions
> in Squid was originally written)
>

here is a code example that would replace the plain case 'w' case
in errorpage.c
i'm not sure if it actually works, it's just an idea how i think
it should work:

 /*
 * errorpage.c, lines 569 following
 * strInfo is the string that the info is added to)
 * ErrMsg_SquidErrCode is related to squid.conf's err_msg_squid_err_code on
 * ErrMsg_Hostname is related to squid.conf's err_msg_hostname on
 * ...
 */

    case 'w':
        if (Config.adminEmail) {
                if (Config.ErrMsg_SquidErrCode)
                    {strInfo+="ErrCode:", errorPageName(err->type), "\n";} /* %w only set on error pages (not ERR_FTP_PUT_CREATED or ERR_FTP_PUT_MODIFIED --> Squid Error Code will be defined */
                if (Config.ErrMsg_FTPRequest)
                    {if (err->ftp.request) /* check if FTP Request is defined */
                        {strInfo+="FTP-Request:", (err->ftp.request), "\n";}
                    }
                if (Config.ErrMsg_FTPReply)
                    {if (err->ftp.reply) /* check if FTP Reply is defined */
                        {strInfo+="FTP-Reply:", (err->ftp.reply), "\n";}
                    }
                if (Config.ErrMsg_Hostname)
                    {strInfo+="Hostname:", getMyHostname(), "\n";}
                if (Confid.ErrMsg_ClientIP)
                    {strInfo+="ClientIP:", inet_ntoa(err->src_addr), "\n";}
                /* if ... */
            memBufPrintf(&mb, "%s", Config.adminEmail, "?subject=CacheErrMsg&body=", strInfo);
        } else {
            p = "[unknown]";
        break;
        }

regards,
 C.L.

-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup


Save up to $160 by signing up for NetZero Platinum Internet service.
http://www.netzero.net/?refcd=N2P0602NEP8

Received on Sat Jul 20 2002 - 05:29:00 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:52 MST