Linux/Sendmail question

Posted by: andy

Linux/Sendmail question - 13/05/2003 15:04

I screwed up my procmailrc file earlier today, resulting in all my mail for the last 11 hours ending up bypassing all my normal filters and being dumped in a single mail file. I don't really want to wade through 170 messages putting them in the right place.

I'm quite sure there is a way that I can take the 170 messages in the mail file and reinject them into sendmail/procmail and have the mail system pretend that they have just arrived normally over SMTP.

The question is, how? I have no idea how to actually do it, though I suspect it might involve using formail.

Anyone know how to do it ?
Posted by: ricin

Re: Linux/Sendmail question - 13/05/2003 15:27

That would be, I believe, something like this:


formail -es procmail < mailfile


Of course, you might need some other switches in there.

...I think...
Posted by: andy

Re: Linux/Sendmail question - 13/05/2003 15:37

What an earth would I do without this BBS ?

That worked perfectly, thanks. You need to work on your response time though, my question went unanswered for nearly half an hour...

Come on people, you know we can do better
Posted by: ricin

Re: Linux/Sendmail question - 13/05/2003 15:40

No problem. Actually, I read it just after you posted it, then continued reading other posts, and eventually came back to answer. I figured someone else would have answered it by the time I got back around; guess not.
Posted by: andy

Re: Linux/Sendmail question - 13/05/2003 15:54

I think it's about time we clubbed together and bought Tony some Linux books, that would improve the repsonse times for questions like this...

Posted by: muzza

Re: Linux/Sendmail question - 14/05/2003 02:17

Yeah, Then he'd be telling us how to do everything!
Posted by: drakino

Re: Linux/Sendmail question - 21/05/2003 15:56

Any easy way to feed maildir messages back through procmail?
Posted by: djc

Re: Linux/Sendmail question - 21/05/2003 16:59

the maildir format simply stores one message, including the header, per file. assuming the files still have all of the appropriate headers (like "From " (no colon), Return-Path:, and Delivered-To:) you should be able to pipe them right through procmail:

cd Maildir/cur ; ls * | xargs -n 1 procmail /path/to/procfile

--dan.
Posted by: wfaulk

Re: Linux/Sendmail question - 21/05/2003 17:19

Or, if they really are formatted that way, and the aforementioned ``formail'' command worked:
cd Maildir/cur

cat * | formail -es procmail
Edit: Oh. Nevermind. I now see that that does pretty much exactly the same thing you said but with more potentiality for error. I should see what these commands do before I start telling people how to use them.