HSubject: and rulesets

This is a variation of the bat book‘s subject header checking trick. Assuming that you want to block messages based on the content of the Subject: header of an incoming message, you can place the following rules into your .mc file:

LOCAL_CONFIG
HSubject: $>BlockSubject

The above basically instructs sendmail to call ruleset BlockSubject with the value of the subject. On with the ruleset now:

LOCAL_RULESETS
SBlockSubject
# The next rule is broken in two for readability!
R$* test - block this message $*
        $#error $: "553 message blocked due to Subject: " $&{currHeader}
R$* Your new password $*        $#discard $: discard
R$* Casinoo $*        $#discard $: discard
R$*        $#OK

(You may want to change the $> operator with $>+. Read paragraph 25.5.1 of the fourth edition of the bat book for a discussion on the matter.)

The bat book prefers to put all the unacceptable subjects in an external database file (which is maintained much like aliases and virtusertable). I prefer keeping the list of the unacceptable subjects inside the .mc file for two reasons:

First, keeping them in a file outside the .mc makes the list grow faster. Editing the .mc to add yet another unacceptable subject makes one think whether to do so or not.

Second, although a subject that contains a certain phrase may be considered unacceptable, you might want to make an exception. For example one may decide to block all the Your new password messages except ISP name – Your new password message that your MIS sends to your users when they reset their password. This can easily be maintained in one place in the .mc file and is also self documented modem noise code:

R$* ISP - Your new password $*        $#OK
R$* Your new password $*        $#discard $: discard

Remember, do not copy-paste sendmail.mc code. The LHS and the RHS are tab separated. Copy-pasting converts tabs to spaces and your ruleset will not work.

Logicomix – αντί κριτικής

Χτες το πρωί το αγόρασα. Χτες το βράδυ τελείωσα την πρώτη ανάγνωση. Σκέψεις:

  • Ο Παπαδάτος έχει πετύχει καταπληκτικά τον Παπαδημητρίου.
  • Στη βιβλιοθήκη μου για πάνω από 10 χρόνια ξεκουράζεται το The Principles of Mathematics. Θα δοκιμάσω να το διαβάσω μέσα στο 2009.
  • Έχω μερικές διαφωνίες με τη μετάφραση του Δοξιάδη, αλλά δεν έχω και το αρχικό κείμενο για να είμαι σίγουρος.
  • Δεν έχω πειστεί ακόμα για το συμπέρασμα της σελίδας 305.
  • Αυτό το βιβλίο πρέπει να μοιράζεται δωρεάν σε όλα τα λύκεια!

Παράγγειλα ήδη την αγγλική έκδοση.

Υ.Γ. Να περιμένουμε ένα δεύτερο μέρος με ήρωα τον von Neumann;

The Tokeneer Project

Fresh from my INBOX:

The National Security Agency has released a case study showing how to cost-effectively develop code with zero defects. If adopted widely, the practices advocated in the case study could help make commercial software programs more reliable and less vulnerable to attack, the researchers of the project conclude.

The case study is the write-up of an NSA-funded project carried out by the U.K.-based Praxis High Integrity Systems and Spre Inc. NSA commissioned the project, which involved writing code for an access control system, to demonstrate high-assurance software engineering.

With NSA’s approval, Praxis has posted the project materials, such as requirements, security target, specifications, designs and proofs.

The code itself, called Tokeneer, has also been made freely available.

More on the Tokeneer project here.

Update: dds offers constructive criticism on the project’s source code after reviewing a single file!

[via Interesting-People]

connecting the dots…

Διαβάζοντας το “Told you so” και το “Connecting the Dots” σκέφτομαι πως όλοι αυτοί που στα δελτία ειδήσεων αναρωτιούνται για το ποιος είναι ο “ιθύνων νους” για το “ιερό real-estate” μπορούν να εφαρμόσουν social network analysis (ξεκινώντας π.χ. από αυτό το βιβλίο) αντί να εκφράζουν εικασίες και να αφήνουν το τοπίο θολό.

Μπα… που τέτοια τύχη.