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 HostsFree MagazinesJobs
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)
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
 

Free Magazines
Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe
Systems Management News, the newspaper for IT systems administration and data center managers!
Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 09:00 PM.




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

Content Relevant URLs by vBSEO 3.2.0