[Mimedefang] disclamer only for out going mails.

Jan Pieter Cornet johnpc at xs4all.nl
Sat Dec 17 10:11:53 EST 2005

On Fri, Dec 16, 2005 at 11:46:35AM -0800, Gary Funck wrote:
> filter_end().  You'll need to capture the Sender's IP address in
> filter_sender().  As I understand things, filter_sender() can only
> communicate with filter_end() via a file in the $CWD directory (or via
> an external database, which is more complicated).

Err, no! This is overly complicated.

There should probably be a page on the wiki that says something like:
    _ALL_ information available in filter_relay, filter_sender, and
    filter_recipient is _also_ available in filter_begin, filter,
    filter_multipart and filter_end through various global variables
    (See GLOBAL VARIABLES SET BY MIMEDEFANG.PL in man mimedefang-filter).

In this case, through $RelayAddr.
> Others here, please correct me if the following is incorrect,
> or if there is an easier way, but here are the steps that based
> upon my understanding need to be done to accomplish the task:

This is not incorrect per se, but overly complex.
> 4. Restart MimeDefang and test.  It would be best to
> test this on a test server, or perhaps others here could
> suggest a way to fire up another copy of sendmail (and
> MimeDefang), working off another SMTP port so that the
> code can be properly tested before deploying it?  I'd
> guess that some customization of startup scripts would
> be required.  In my view, a separate test server would
> be the most straightforward way to go.

The best way to test mimedefang in my experience is:
1) use a test server.
2) if you don't have a test server, buy one and go back to 1.
3) realise that your own workstation can also run sendmail
   and mimedefang, and use that as a test server, then go back
   to step 1 (if you're running windows, then this might be
   tricky, but then again, that's your own fault for using
   toys in a workplace)
4) if you must test on production, kill the production sendmail,
   edit /etc/services, find the line that says "smtp   25/tcp" and
   change it into "smtp   26/tcp" (ie put "26" where it said "25"),
   then fire up sendmail again, and telnet to port 26 to test stuff
   out (this won't work correctly if you setup multiple listening
   ports, for example on 587 or 465).
5) make a new sendmail config file with a separate queue dir,
   separate pid file location, mimedefang enabled on a different
   socket, and listening on a non-default port. Fire up a new
   copy of mimedefang if necessary, on the new port, and start
   sendmail with the new config file you generated.

I haven't tested option 5 myself, I'm using option 1 if it's not
clear by now :)

> If I have the time, I'll try and write the code, but
> would appreciate hearing from others more experienced
> in modifying MdF before implementing the suggested
> approach.

For the original request, what the OP wanted is possible with stock
mimedefang, and even with plain sendmail, as long as you optimize
the inserted disclaimer to be "", the empty string (which has the
same legal effect as any disclaimer you'd like to add). This is an
optimization you'd have to push through management, though. Careful
quoting of http://goldmark.org/jeff/stupid-disclaimers/ might help.

#!perl -wpl # mmfppfmpmmpp mmpffm <pmmppfmfpppppfmmmf at fpffmm4mmmpmfpmf.ppppmf>
$_[2]}->(map{/p|f/i+/f/i}split//,$&)+97):qw(m p f)[map{((ord$&)%32-1)/$_%3}(9,
3,1)]),5,1)='`'lt$&;$f.eig;                                # Jan-Pieter Cornet

More information about the MIMEDefang mailing list