LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-18-2007, 02:26 PM   #16
Chiragrs
Member
 
Registered: May 2007
Distribution: Kubuntu
Posts: 43

Original Poster
Rep: Reputation: 15

If this was working correctly, should I be able to receive mail in my squirrelmail MUA or is the mail simply be put inside the $HOME/Maildir ?
 
Old 05-18-2007, 02:38 PM   #17
Chiragrs
Member
 
Registered: May 2007
Distribution: Kubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
OK, i think I have an idea as to what is going on.. I think postfix is not linked with procmail properly and it is not executing .procmailrc file each time a mail comes through. it is simply being sent to squirrelmail. so heres the part of the postfix/main.cf file that links it to procmail:
Code:
mailbox_command = /usr/bin/procmail -Y -a $DOMAIN DEFAULT=$HOME/Maildir
MAILDIR= $HOME/Maildir
first, is this all it takes for the linkage.. If this is done correctly, here's what i think happens.. correct me if I'm wrong.
1. Mail comes into postfix, which sends it to /usr/bin/procmail and runs the procmail command. It assumes that the mail is sent, therefore does not do anything else (therefore, there should NOT be a nything in squirrelmail)
2. Procmail takes this and it executes $HOME/.procmailrc, which checks the email for the following conditions:
Code:
:0:
* ^Subject:.*test
$HOME/Maildir/IN.testing/

:0:
* < 256000
$HOME/Maildir/
Lets say that the second condition (<25600) is met, then it gets sent to $HOME/Maildir/ where it will get stored.

If none of the conditions are met, then it sends back to postfix which sends it to squirrelmail.

Thats what I understand about this mechanism so far... Please correct me if I am wrong. THANK YOU soo much for you help so far.. I have been trying this for 3 days

Last edited by Chiragrs; 05-18-2007 at 02:40 PM.
 
Old 05-18-2007, 02:46 PM   #18
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
As far as I can see, squirrelmail can't do mbox, so we'll go with normal mailboxes.
Code:
#Set on when debugging
VERBOSE=on

MAILDIR=$HOME/Maildir

#directory for storing procmail log and rc files.
PMDIR=$HOME/.procmail

LOGFILE=$HOME/.procmail/log

:0:
* ^Subject:.*test
$MAILDIR/testing

:0:
$MAILDIR/new
should put emails with test in the subject into an mbox at ~/Maildir/testing and everything else into ~/Maildir/new .

Could you try that, and see if mail ends up in the mailboxes?

If there's a problem with the procmail config, mail usually ends up in /var/spool/mail/<username> . I'd check there for any missing mail.

Last edited by ilikejam; 05-18-2007 at 02:49 PM.
 
Old 05-18-2007, 02:58 PM   #19
Chiragrs
Member
 
Registered: May 2007
Distribution: Kubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
No, not working.. they all end up in squirrelmail, which is in /var/mail/virtual/mail/

I think there is something wrong with the linking between procmail and postfix..

Do I have to change anything in postfix's master.cf file?

Last edited by Chiragrs; 05-18-2007 at 03:07 PM.
 
Old 05-18-2007, 03:13 PM   #20
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Hmmm. /var/mail/virtual/mail/

It seems that you are using virtual users. Are you aware of this?

procmail doesn't work with virtual users to deliver to local mailboxes, as the local users don't exist.

You can use procmail for filtering when using virtual users, but it's not so straightforward:
http://www.goblet.net/spamkill/

Dave
 
Old 05-18-2007, 03:16 PM   #21
Chiragrs
Member
 
Registered: May 2007
Distribution: Kubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
oo, yea I was aware, but wasn't sure what that meant. How do I not use virtual users?? All my user database is organized in mysql
 
Old 05-18-2007, 03:20 PM   #22
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Unless you want to create a unix user for each virtual user, then there's not much you can do with procmail (apart from operations which can be applied to everyone's mail, as in the link in my last post).

What is it you're trying to achieve with procmail anyway?
 
Old 05-18-2007, 03:28 PM   #23
digitalnerds
Member
 
Registered: May 2007
Distribution: Debian
Posts: 103

Rep: Reputation: 15
Why would you bother to spam filter with procmail when you could use amavis?!
 
Old 05-18-2007, 03:57 PM   #24
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Quote:
Originally Posted by digitalnerds
Why would you bother to spam filter with procmail when you could use amavis?!
Code:
[0 dave@cronus ~]$ yum deplist amavisd-new | grep provider: | sort | awk '{print $2}' | uniq
amavisd-new.noarch
arj.i386
bash.i386
binutils.i386
bzip2.i386
cabextract.i386
clamav-server.i386
cpio.i386
crontabs.noarch
exim.i386
file.i386
freeze.i386
gzip.i386
lzop.i386
mod_perl.i386
nomarch.i386
perl-Archive-Tar.noarch
perl-Archive-Zip.noarch
perl-Authen-SASL.noarch
perl-BerkeleyDB.i386
perl-Compress-Zlib.i386
perl-Convert-TNEF.noarch
perl-Convert-UUlib.i386
perl-DBD-MySQL.i386
perl-DBD-SQLite.i386
perl-DBI.i386
perl.i386
perl-IO-stringy.noarch
perl-LDAP.noarch
perl-Mail-SPF-Query.noarch
perl-MailTools.noarch
perl-MIME-tools.noarch
perl-Net-DNS.i386
perl-Net-Server.noarch
perl-Razor-Agent.i386
perl-Unix-Syslog.i386
perl-URI.noarch
postfix.i386
sendmail.i386
spamassassin.i386
ssmtp.i386
tmpwatch.i386
Code:
[0 dave@cronus ~]$ yum deplist procmail | grep provider: | sort | awk '{print $2}' | uniq
bash.i386
glibc.i386
glibc.i686
That answer your question?
 
Old 05-18-2007, 04:15 PM   #25
digitalnerds
Member
 
Registered: May 2007
Distribution: Debian
Posts: 103

Rep: Reputation: 15
Righty .. extra packages and i agree with you. However i used to stress procmail quite alot until i got amavis up. As long as you can afford to spend some resources on it it's ok.

Regards
Andy
 
Old 05-22-2007, 10:31 AM   #26
Chiragrs
Member
 
Registered: May 2007
Distribution: Kubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
One step closer

OK, I commented out all the lines that have to do with virtual, for example "virtual_mailbox_base", "virtual_alias_maps", etc.. and now the mail is being sent to command /usr/bin/procmail. However, the mail is being lost after that. When I do the command
Code:
procmail -m
It says that I have missing rc files. However, I have an rc file:
$HOME/.procmailrc

Where is procmail looking at to check for rc files??

Please help.. I am sooo close
 
Old 05-22-2007, 03:11 PM   #27
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
The mail probably ended up in /var/mail/<username> (since that's procmail's default directory).

Did you send the email to your own user?

Also, why are you running procmail -m ?

Dave
 
Old 05-23-2007, 09:11 AM   #28
Chiragrs
Member
 
Registered: May 2007
Distribution: Kubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
procmail -m was merely from trial and error.. For the command "procmail", it did not do anything, but for "procmail -m" it was executing the .procmailrc file..
Now, the log file for procmail is working, so I know where the mail ends up.. They are all ending up in my $MAILDIR
However, I am unable to view it on my MUA. I am using squirrelmail. How do I configure it such that it is able to see the mail coming in through procmail?
 
Old 05-23-2007, 10:40 AM   #29
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
squirrelmail is just a front-end to your IMAP server (just like Thunderbird, or Evolution) - you're probably running an IMAP server like 'dovecot', 'courier' or 'uw-imapd' or something similar. You'll have to configure this server to look in the right place for user mail.

Dave
 
Old 05-23-2007, 11:36 AM   #30
Chiragrs
Member
 
Registered: May 2007
Distribution: Kubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
ok.. thank you. I am using courier-IMAP
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Procmail : Cat from External File joseph Programming 3 12-11-2006 07:37 AM
procmail config file overwritten?? lmcilwain Linux - Software 2 09-21-2006 08:56 AM
any ideas to reduce log file size or make log file size managed? George2 Programming 2 08-13-2006 06:55 AM
.forwards file with procmail problem kzar Linux - General 1 06-09-2004 11:17 AM
Procmail and file permissions J_Szucs Linux - Newbie 0 08-15-2002 02:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:15 PM.

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