LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   small help :) (https://www.linuxquestions.org/questions/linux-general-1/small-help-738349/)

a7mlinux 07-07-2009 11:24 AM

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

zhjim 07-08-2009 03:51 AM

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.

a7mlinux 07-08-2009 11:16 AM

not sufficient!

repo 07-08-2009 11:18 AM

Quote:

not sufficient!
why not?

a7mlinux 07-08-2009 11:28 AM

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?

repo 07-08-2009 11:35 AM

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


a7mlinux 07-08-2009 11:49 AM

then the procmail use the specified procmailrc in order to the user name which has received the message, am I right?

repo 07-08-2009 11:52 AM

yep

a7mlinux 07-08-2009 11:54 AM

Quote:

Originally Posted by repo (Post 3601144)
yep

thanks man, will need you in later steps

zhjim 07-08-2009 02:20 PM

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.

a7mlinux 07-09-2009 04:40 AM

Quote:

Originally Posted by zhjim (Post 3601335)
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:)

a7mlinux 07-11-2009 05:19 AM

am still needing help

repo 07-11-2009 05:59 AM

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?

a7mlinux 07-11-2009 06:24 AM

Quote:

Originally Posted by repo (Post 3604153)
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

repo 07-11-2009 06:26 AM

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?


All times are GMT -5. The time now is 09:41 PM.