[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Filtering mail before sending to ANOTHER machine for delivery?

On Tue, 9 May 2000, Don Knott wrote:

> On Tue, 9 May 2000, Pete Peterson wrote:
> > We have a RedHat Linux mail gateway which receives all incoming mail from
> > the outside and then relays most of it to other machines, including mostly
> > Micro$oft Exchange servers for Outlook victims.
> I just went through a similar problem. We use HP's Openmail on
> Redhat (unix replacement for Exchange) to serve Outlook clients.
> First we set up the procmail stuff from:
> http://www.wolfenet.com/~jhardin/procmail-security.html


By the way, the procmail man page shows how to set this up. After a
little bit of refinement, you end up with:


Implementing procmail on a sendmail 8.8.8 gateway:
(Note: This is still undergoing testing and refinement)

1. Add the following delivery agent:

Mprocmail,      P=/usr/bin/procmail, F=DFMmShu, S=11/31, R=21/31, T=DNS/RFC822/X-Unix,
                A=procmail -m MAIL_FROM="$_" MAIL_TO="$u" $h


2. Add the following to ruleset 0:

# pipe through procmail for processing
R$*<@example.com>$*     $#procmail $@/etc/procmail/filter.rc $:$1 example com procmail$2
R$*<@$*.procmail>$*     $1<@$2>$3

Vary the domain name and script name (/etc/procmail/filter.rc) for your needs.

3. Here is a sample filter.rc file:

# procmail rules to filter mail on a gateway



* ^From:.+\/[^ ,]+ [^ ,]+

:0                              # pass along all other mail
! -oi -f "$FROM" "$MAIL_TO"

 John Hardin KA7OHZ   ICQ#15735746   http://www.wolfenet.com/~jhardin/
 jhardin wolfenet com      pgpk -a finger://gonzo.wolfenet.com/jhardin
  768: 0x41EA94F5 - A3 0C 5B C2 EF 0D 2C E5  E9 BF C8 33 A7 A9 CE 76 
 1024: 0xB8732E79 - 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
  "Bother," said Pooh as he struggled with /etc/sendmail.cf, "it never
  does quite what I want. I wish Christopher Robin was here."
				-- Peter da Silva in a.s.r
   171 days until Daylight Savings Time ends

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]