[Mimedefang] How to accept whole message at beginning

Jeff Rife mimedefang at nabs.net
Fri May 9 13:40:56 EDT 2008


On 9 May 2008 at 10:46, Karl Boyken wrote:

> I'm trying to hack our mimedefang-filter so that mail from internal 
> machines or that is authed is accepted before any filtering occurs, but 
> after the body is received, so that I can add a header.  Before the 
> requirement to add a header popped up, I would check for internal 
> machines and authed users in filter-recipient and accept with no more 
> filtering.
> 
> I tried using "return action_accept()" in filter_begin, but that 
> apparently did not prevent the message from running through the whole 
> filter.  I'd appreciate any insight--thanks.

In filter_begin, I have the following at the top of the function:

return if (is_trusted_ip($RelayAddr));

In filter and filter_multipart, I have:

return if (message_rejected());
return action_accept() if (is_trusted_ip($RelayAddr));

In filter_end, I have:

return if (message_rejected());
if (is_trusted_ip($RelayAddr))
  {
  do_outgoing();
  return;
  }

Just substitute your own function in place of "is_trusted_ip" to do 
whatever checks you need to decide if the mail is from an internal (or 
trusted) source.  Then, in place of my "do_outgoing", do whatever you 
need to do to add the header.


--
Jeff Rife |  
          | http://www.nabs.net/Cartoons/Dilbert/SalesToFriends.gif 





More information about the MIMEDefang mailing list