I'm trying to set up a filter on our server to check the headers of incoming email to see if it is being forwarded from gmail, and if not, forwarding the message to gmail where gmail can act as a spam filter and forward the mail back. This method is talked about at the following sites:

Using Gmail as a Spam Filter
Double-Pass Spam Filtering with Gmail - DreamHost
Everybody Just Shut Up Already » Blog Archive » Make GMail’s Spam Filter Work For You
Spam Filtering using Google's GMAIL

I'm a little new to using linux command shell and am having some trouble getting the configurations right to get this to work (server is running Redhat Enterprise Linux 4ES, I'm using the web-based shell through Webmin). We are using postfix/sendmail, and appear to have procmail installed, but it isn't being used. Those tutorials mention using procmailrc to set up the filter, but if there is another option let me know!

Replacing MYUSERNAME and USER with their respective values:

.procmailrc put into root/home/MYUSERNAME/

# forward to gmail account for spam filtering
* !X-Forwarded-For: USER@gmail.com
    | formail -IDelivered-To
    ! USER@gmail.com
This is supposed to enable procmail?
.forward file put into root/home/, I tried .forward and .forward.postfix
"|/usr/bin/procmail -t"
Nothing at all seemed to change when I tried this. Incoming emails continued to be sent as normal and I don't know how to check if it was even being forwarded through procmail and if there was a problem with the .procmailrc. Can anyone help? From the mail server configs, our mail storage type is 'mbox', mail file directory style is 'mail/username', mail file in home directory is 'mbox', user mail file location is '/var/spool/mail', and user forward files set to '$z/.forward.$w:$z/.forward' if that's relevant.