Hi Henrik,

At 13.31 09/08/2005, Henrik Nordstrom wrote:

On Sun, 7 Aug 2005, Serassio Guido wrote:

A "mail_program" configuration option in squid.conf that allows to specify the program that squid will be use to send fatal reports by mail.

Ok. No problem with that.

I have attached the proposed patch.

I have used an eol type instead of a string type, this allow to specify not only the program name, but command line options too.

Ok.

Isn't "wordlist" a more appropriate type, giving you the line already split into words? This is what is used for other program specifications accepting arguments.

Sure. I have used 'eol' only to have a very small change in tools.c:

-    snprintf(command, 256, "mail %s < %s", Config.adminEmail, filename);
+ snprintf(command, 256, "%s %s < %s", Config.EmailProgram, Config.adminEmail, filename);


For example, on Windows I have used something like:
mail_program c:/squid/libexec/mailsend.exe -smtp smtp.tld.com -d tld.com -f [EMAIL PROTECTED] -sub "Squid failure" -t

Hmm.. we do have a config entry for the email address today. Perhaps we should expand the string with errorBuildContent or similar to allow this and other interesting % codes to be used in the string.

I think that something like the following configuration tags could be very useful:

- The destination e-mail address (today we have only this)
- The from e-mail address, currently we use appname string
- The subject of the message
- The email program to use
- The email program command line with % codes that can be expanded with to, from and subject values - The message body itself, with again % codes that can be expanded with a error code/message and the to, from and subject values

But probably a similar change is too big for 2.5.

If you like, I could write a simplified version for 2.5, with only the following tags:
mail_program a string with the mail program name
mail_program_options a wordlist with mail program command line options

Regards

Guido



-
========================================================
Guido Serassio
Acme Consulting S.r.l. - Microsoft Certified Partner
Via Lucia Savarino, 1           10098 - Rivoli (TO) - ITALY
Tel. : +39.011.9530135  Fax. : +39.011.9781115
Email: [EMAIL PROTECTED]
WWW: http://www.acmeconsulting.it/

Reply via email to