On Sun, 03 Oct, 2004 at 10:17:29 +0000, C Hamel wrote:
On Sunday 2004 October 3 07:03, Jon Clausen wrote:
The use of variables in the pipe is something I picked up in some howto or other. It complicated the initial setup, but now I'm happy with it. Although a large part of that complication stemmed from me wanting to set up Postfix, Procmail, Spamassassin and Cyrus all in one go, neither of which I knew very well at the time :P
Pipes is something I need to understand better than I do. I use simple pipes (like | less & | grep <item>) w/o totally understanding how they work. Guess I'll ry this example & see what happens. :-)
Well... Pipes may not be appropriate for what you want to achieve here, but... The concept itself is very simple: command1 | command2 basically executes `command1` and takes whatever output this produces, and feeds it to `command2`. Pretty simple. Now, in reality it *is* a bit more complex than that, but that's another subject.
(While we're on the subj... I was hopig to also get the process using Mailder rather than mbox, and putting msgs in KMail's inbox, etc. Had it working, once, then it busted & I don't know what I did. Guess that's another post; right?)
Probably :) In any case I may as well explain why pipes is the right thing for me (and incidentally why they might not be for you): My system is set up so that incoming mail is passed from Postfix -> Procmail For processing Procmail -> SpamAssassin For Spam-classification SpamAssassin -> Procmail For further processing (including user procmailrcs) Procmail -> Cyrus For final delivery Now, it's in this final step, where the user procmailrc contains the pipe that feeds it's data (each message) to $IMAPCOMMAND $Destination $IMAPCOMMAND contains "/usr/lib/cyrus/bin/deliver -a $USER -q -m" and $Destination contains something like "user.SLE" which all tells *Cyrus* what to do with the message. The reason for all this is that I'm *accessing* my mail through (Cyrus) IMAP only. And Cyrus takes care of all the 'housekeeping', including where to put the actual file in the filesystem, and subsequent manipulations like moving msgs around and deleting them and so on. Under this scheme each message is still just a file, but *I* don't own it, *Cyrus* does. And in fact *I* (the user) haven't got read-priviliges in the area where Cyrus keeps the messages (/var/spool/imap/user/) And so: Unless you have some sort of MDA to take care of final delivery, you probably don't want to pipe anything anywhere. Just let Procmail write the file in your ~/Mail/inbox/new - or wherever Kmail expects to see new messages (I don't know. I haven't used Kmail in quite a while, and never like that...) Hope I'm not confusing you with all this, but it seemed prudent to explain why I'm using pipes, and why it might not be appropriate for you /Jon -- Just say "know!"