Take for example sendmail. If you want to configure and run a customized sendmail you'll have to learn the sendmail configuration language. Same thing for apache, etc...
These linux services are complex and each has ist own configuration language. And if you need further nonstandard customization, you'll nedd to modify the source code and recompile, which is very time consuming.
How can we fix that?
I was imagining that every "service" (like sendmail, apache, etc) would provide "data structures" and default behaviour.
Here's an example to understand.
Say you install sendmail and kapersky antivirus. Now both run in default configurations. Say you want kapersky antivirus to scan all your incoming mail. Imagin that all you have to do is write this "script":
===============================
Code:
function scan_mail($mail) {
$scan_result = v1.services.antivirus.kapersky_av.mail_scanner.scan_mail($mail);
if $scan_result.is_infected {
$return_text = "
This mail could not be delivered because it was determined to contain a virus.\n
These are the viruses found in the email:\n";
for each $scan_result.found_viruses as $virus{
$return_text += "Virus name: " + $virus.name + "\n";
$return_text += "Virus description: " + $virus.description + "\n";
}
$return_text += "The original mail is provided as attachement\n";
$return_mail = v1.classes.mail.blank;
$return_mail.to = $mail.sender;
$return_mail.subject = "Returned mail";
$return_mail.text = $return_text;
$return_mail.attach ($mail.raw_source() );
v1.services.mail.postfix.send_mail($return_mail);
}
else {
return default;
}
}
v1.bind(v1.services.mail.postfix.smtp_server.mail_received, scan_mail);
===============================
Now let me explain some stuff: This:
v1.services.mail.postfix.smtp_server.mail_received
Is what I called previously a "data structure". that should be provided by sendmail. The v1 is for "version 1", as they may be diferent versions.
The last line in the "script" binds the event "mail_received" with the preceding function (scan_mail).
The "return default" in the function means "continue processing the mail normally".
Now all we'll have left to do is issue some command that would, err, "enable" our customization.
Now all this is great, but can in become real, without too much work?
My "ideas" might be stupid, but I'll never know if I dont share them.
And thanks for reading to the end.