Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Servers
Reload this Page Postfix with procmail, using a per-user .procmailrc file to forward through gmail
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Servers Anything server related, Apache, MySQL, Samba, server security, sendmail, exim, etc

Reply
 
Thread Tools Display Modes
Old 04-28-2008   #1 (permalink)
tenji
Just Joined!
 
Join Date: Apr 2008
Location: Florida
Posts: 1
Question Postfix with procmail, using a per-user .procmailrc file to forward through gmail

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/
Code:
DEFAULT=/var/spool/mail/MYUSERNAME
MAILDIR=$HOME/mail
PMDIR=$HOME/.procmail
LOGFILE=$PMDIR/log
SHELL=/bin/sh

# forward to gmail account for spam filtering
:0
* !X-Forwarded-For: USER@gmail.com
{
    :0fw
    | formail -IDelivered-To
    
    :0
    ! USER@gmail.com
}
This is supposed to enable procmail?
.forward file put into root/home/, I tried .forward and .forward.postfix
Code:
"|/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.
tenji is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 10:25 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0