Version 1.05

The Custom Headers Filter can be used by PopOver (version 2.0). It provides filtering of all outgoing messages, by adding header lines to each message. A custom inspector titled "Custom Headers" is added to the Preferences panel in the PopOver application. This custom inspector allows the user to easily customize what custom headers will be used and what values each of the headers will have.

On the custom inspector, one finds a table view with three column headings. The first represents the name of the header as it will appear in the mail message. Note that a colon (:) will be appended to this name automatically when it is used in an outgoing mail message. The second column represents the value that will be used for the header. And the third indicates whether the header should be used.

The value that is used for the header is determined by comparing the contents of the column with the filesystem. If a file exists with a name that matches the contents of the column, and the file is executable, the file will be executed and its output to stdout will be used as the value for the header. If the file is not executable, the first line of the file will be read and used as the value for the header. Otherwise, the actual string that is in the column will be used as the header value.

If the third column does not indicate a header should be used, it will not appear in an outgoing mail message. Headers appear in the outgoing mail messages in the order they appear in the inspector. One can use the up and down buttons to move the selected header to rearrange the order in which they appear in outgoing messages.

When pressing the Save button, the defaults database is updated with the contents of the inspector. When pressing the Revert button, the inspector is updated with the contents of the defaults database. Note that outgoing messages will use the contents of the inspector at all times. Therefore, one can make a temporary header be used by entering it into the inspector, and then sending a message. One can then Revert the contents of the inspector to ensure no future messages will use that header.

For those that are daring, there is a default called CustomHeadersOverrides which is a dictionary. The keys in the dictionary represent headers, and the values are methods that the Header object implements. If the Custom Heades Filter is instrucuted to include a header whose key is in the CustomHeadersOverrides dictionary, it will use the associated method to set the value of that header. For example, if one includes a custom header of "From" with a value of "Godzilla," what normally appears in the outgoing message are two "From" headers: one with the user's name, and the other with "Godzilla." However, if there is a key "From" with the value "setFrom:" in the CustomHeadersOverrides dictionary, only one "From" will appear in the outgoing message: that of "Godzilla." There is no user interface to set the values in this dictionary, but one can use any tool that edits the defaults database.