LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 07-07-2009, 11:24 AM   #1
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Rep: Reputation: 17
Cool small help :)


how to give any user his own procmail which is separated from other users?
eg:
user A save his spam in /home/A/mail/spam
user B save his spam in /home/B/mail/sapm
user C save messages filtered as virus in /home/C/mail/virus
 
Old 07-08-2009, 03:51 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Taken from http://userpages.umbc.edu/~ian/procmail.html

Code:
Currently, these UMBC systems are already running Procmail. 
All you need to do is compose a special file, called .procmailrc (don't forget that leading dot!),
 which describes the sorting criteria. 
Once you have this file in your $MAIL directory, Procmail will automatically be 
run on any incoming mail you receive
So I'd say just but a seperate .procmailrc file into the users $MAIL dir.

Last edited by zhjim; 07-08-2009 at 03:52 AM. Reason: nicen it
 
Old 07-08-2009, 11:16 AM   #3
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Unhappy

not sufficient!
 
Old 07-08-2009, 11:18 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
Quote:
not sufficient!
why not?
 
Old 07-08-2009, 11:28 AM   #5
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Question

is there a way to automate all the work, it's too time consuming to write .procmailrc for every user, suppose I have 2000 user what o do?
 
Old 07-08-2009, 11:35 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
You only have to write it once, and copy it to the home directories
Since you can use
Code:
MAILDIR=$HOME/mail
SPAM=$MAILDIR/spam
VIRUS=$MAILDIR/virus
 
Old 07-08-2009, 11:49 AM   #7
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Question

then the procmail use the specified procmailrc in order to the user name which has received the message, am I right?
 
Old 07-08-2009, 11:52 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
yep
 
Old 07-08-2009, 11:54 AM   #9
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by repo View Post
yep
thanks man, will need you in later steps
 
Old 07-08-2009, 02:20 PM   #10
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Last reply on this thread. Statements like "Not enough". "will need you in further steps" are so ... Guys like you really strat to piss me off!


Add the .procmail file to the /etc/skel directory and it while magicly be copy to every new user dir.
And if you ever happen to have 2000 users think about using a simple bash script with a for loop.
 
Old 07-09-2009, 04:40 AM   #11
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Wink

Quote:
Originally Posted by zhjim View Post
Last reply on this thread. Statements like "Not enough". "will need you in further steps" are so ... Guys like you really strat to piss me off!


Add the .procmail file to the /etc/skel directory and it while magicly be copy to every new user dir.
And if you ever happen to have 2000 users think about using a simple bash script with a for loop.
first, sorry dude
second, am too weak in shell scripting, do I need To add .procmail file in /etc/skel and write a shell script "both of them", or just do one of them?
thanks in advance

Last edited by a7mlinux; 07-09-2009 at 04:47 AM.
 
Old 07-11-2009, 05:19 AM   #12
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
am still needing help
 
Old 07-11-2009, 05:59 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:
Add the .procmail file to the /etc/skel directory and it while magicly be copy to every new user dir.
Did you tried it?
 
Old 07-11-2009, 06:24 AM   #14
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by repo View Post
Did you tried it?
yes I did, but the dovecot can't dealing with the new path of the INBOX, and I need to use the dovecot to read SPAM and VIRUS files too, what to do, please help
 
Old 07-11-2009, 06:26 AM   #15
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 I did, but the dovecot can't dealing with the new path of the INBOX, and I need to use the dovecot to read SPAM and VIRUS files too, what to do, please help
Can't you change the PATH to the inbox in procmailrc?
 
  


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
Small help Gins Linux - General 11 09-21-2008 06:48 AM
LXer: DLS <small>[<i>sic</i>]</small> answers user requests with 4.0 alpha LXer Syndicated Linux News 0 07-19-2007 07:46 PM
Small Fonts... Too much small! cubax Debian 3 03-28-2005 11:31 AM
Openldap with small directory very small iholdap Linux - Networking 5 10-04-2003 08:09 AM
3 small problems in 1 small post vzzt! Linux - Software 10 02-27-2003 07:40 PM

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

All times are GMT -5. The time now is 04:10 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