[Mimedefang] Mimedefang Adding Footer

Joseph Brennan brennan at columbia.edu
Fri Nov 3 09:52:36 EST 2006



--On Friday, November 3, 2006 11:21 +0000 Terry Rogers 
<terry.rogers at williams.uk.com> wrote:

> I currently have the following setup in my mimedefang-filter file in
> /etc/mail ...
>
>  # Add footer to outgoing emails
>     if ($Sender =~ /mydomain4.com/) {
>         $text_footer = " ";
>         $html_footer = " ";
>     }
>
>     if ($Sender =~ /mydomain3.com/) {
>         $text_footer = " ";
>         $html_footer = " ";
>     }
>
>     if ($Sender =~ /mydomain2.com/) {
>         $text_footer = " ";
>         $html_footer = " ";
>     }
>
>     if ($Sender =~ /mydomain.com/) {
>         $text_footer = ".";
>         $html_footer = "<b>.</b>";
>     }
>
>     append_text_boilerplate($entity,$text_footer,0);
>     append_html_boilerplate($entity,$html_footer,0);


Why not

    $text_footer = $html_footer = '';

    if ($Sender =~ /mydomain.com/) {
        $text_footer = ".";
        $html_footer = "<b>.</b>";
    }

    append_text_boilerplate($entity,$text_footer,0) if ($text_footer);
    append_html_boilerplate($entity,$html_footer,0) if ($html_footer);

This can be extended easily with more stanzas to specify footers.  It
saves running the two append commands when there is nothing to do.



> I need this to be modified so that any mail going from @mydomain.com to
> @mydomain2.com, @mydomain3.com, @mydomain4.com or @mydomain.com does not
> have the filter added. This also needs to be the case for @mydomain2.com,
> @mydomain3.com and @mydomain4.com.
>
> I also need to specify some email address's that wont have a footer added,
> namely any outgoing mail from bob at mydomain.com will not have a footer
> added.


I agree with what Jan-Pieter Cornet said.  The logic problem of what to
do with a message to multiple recipients would need to be solved before
a solution can be coded.

My first thought is to use what I wrote up there, and have another if
condition or two that sets the footer variables back to '' if certain
other conditions are met, e.g. $Sender =~ /bob\@mydomain/.

Sometimes the logic is interesting to discuss.

Joseph Brennan
Lead Email Systems Engineer
Columbia University Information Technology







More information about the MIMEDefang mailing list