LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-27-2009, 05:41 PM   #1
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Rep: Reputation: 17
Question procmail help


how do I make procmail work, which dir and files I need to create, and where do I put .procmailrc files?
thanks in advance
 
Old 06-27-2009, 05:43 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
http://userpages.umbc.edu/~ian/procmail.html
 
Old 06-29-2009, 05:01 AM   #3
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Exclamation need help again

I tried to make procmail work but till now it doesn't do.
I made these steps:
1- I created the file ~/.forward, and wrote inside it:
Code:
|IFS=' ' && exec /usr/bin/procmail || exit 75 #mail_user_name
it's "root" in my case
2- I created ~/.procmail directory and wrote inside it:
Code:
VERBOSE=off
 MAILDIR=$HOME/mail # elm users might use $HOME/Mail instead
 PMDIR=$HOME/.procmail
 DEFAULT=/var/spool/mail/elflord
 LOGFILE=$PMDIR/log
 INCLUDERC=$PMDIR/general.rc
 # INCLUDERC=$PMDIR/other.rc
 # add as many INCLUDERC's as you like 
 # end of .procmailrc
3- I created general.rc inside ~/.procmail directory and wrote inside it:
Code:
:0
 * ^From.*system_username.*localhost.*localdomain.*@
/root/Desktop/test/INBOX
to put all messages received from system_username in /root/Desktop/test/INBOX. "INBOX is a palin file"
4- I executed the procmail binary and send message from system_user to root
and there is nothing working

Last edited by a7mlinux; 06-29-2009 at 05:06 AM.
 
Old 06-29-2009, 05:12 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
try
VERBOSE=on

and look in the logfile to see what happens.
 
Old 06-29-2009, 09:37 AM   #5
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Question

I made all steps and the output is:
Code:
Folder: /var/spool/mail/root                                             7214
procmail: Couldn't read "/root/.procmail/general.rc"
From test@localhost.localdomain  Mon Jun 29 17:17:01 2009
  Folder: /var/spool/mail/root                                              593
procmail: Couldn't read "/root/.procmail/general.rc"
From test@localhost.localdomain  Mon Jun 29 17:17:42 2009
  Folder: /var/spool/mail/root                                              589
and my procmailrc file contain:
Code:
VERBOSE=on
MAILDIR=/home/mail
#PMDIR=/home/.procmail
DEFAULT=/var/spool/mail/root
LOGFILE=/home/.procmail/log
INCLUDERC=/home/.procmail/general.rc
 
Old 06-29-2009, 09:44 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
procmail: Couldn't read "/root/.procmail/general.rc"
make sure /root/.procmail/general.rc exist

However, why do you use it as root ?
Are you logged in as root?
Why not login and work as user and use su or sudo?
 
Old 06-29-2009, 09:54 AM   #7
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Question

Quote:
Originally Posted by repo View Post
make sure /root/.procmail/general.rc exist
yes am sure it is exist, and it contain:
Code:
:0
 * ^From.*test.*localhost.*localdomain.*@
 /root/Desktop/test/INBOX
I want all message from user(test) goes to the path above
and am execute it as root just for experience
 
Old 06-29-2009, 09:56 AM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
yes am sure it is exist, and it contain:
make sure it has the proper permissions.

procmail can't read it.
 
Old 06-29-2009, 10:00 AM   #9
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
INCLUDERC=/home/.procmail/general.rc
try
INCLUDERC=/root/.procmail/general.rc

why do you use
/home/

Last edited by repo; 06-29-2009 at 10:01 AM.
 
Old 06-29-2009, 10:05 AM   #10
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Cool

I gave it the permissions and the output in /root/.procmail/log is:
Code:
From test@localhost.localdomain  Mon Jun 29 18:00:35 2009
  Folder: /var/spool/mail/root                                              601
From root@localhost.localdomain  Mon Jun 29 18:01:31 2009
  Folder: /var/spool/mail/root
and am appreciate your help
 
Old 06-29-2009, 10:12 AM   #11
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
comment out the INCLUDE and add this to your procmailrc

Quote:
TEST=/root/Desktop/test/INBOX

:0
* ^From.test@localhost.localdomain
{
:0
${TEST}
}
 
Old 06-29-2009, 10:39 AM   #12
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Talking thanks

alot of thanks man repo, it's working now with:
Code:
VERBOSE=off
MAILDIR=$HOME/mail
PMDIR=$HOME/.procmail
DEFAULT=/var/spool/mail/root
LOGFILE=$PMDIR/log
#INCLUDERC=$PMDIR/general.rc
TEST=/root/Desktop/test/INBOX

:0
* ^From.test@localhost.localdomain
{
:0
${TEST}
}
but am still need the INCLUDERC to add more rules
 
Old 06-29-2009, 10:47 AM   #13
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
but am still need the INCLUDERC to add more rules
You just can add the rules to the .procmailrc file,
Just use the same layout
I have al my rules in the procmailrc file.

ex

Quote:
:0
* ^From.test@localhost.localdomain
{
:0
${TEST}
}

:0
* ^From.root@localhost.localdomain
{
:0
${DEFAULT}
}

You can also include spamassassin, virusscan....
 
Old 06-29-2009, 11:30 AM   #14
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Cool

thanks alot repo, now am designing my webmail, and am working in messages redirection, anti spam with spamassassin and virus scan with clamAV, appreciate your help and i will need you soon, I hope you to add me in your msn list:
kazenova35@hotmail.com
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Procmail... Cottsay Linux - Software 2 09-21-2006 11:56 AM
Problem with mail delivery procmail>cyrus imap (using sendmail,procmail,cyrus,imap) bwana Linux - Software 2 03-24-2005 07:01 PM
procmail divali Linux - Software 2 03-04-2005 08:09 AM
help with procmail wailm81 Linux - Networking 0 10-15-2004 06:43 PM
Procmail PcHammer Linux - Software 1 04-23-2003 07:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration