What you should do is not mess with scanning /var/spool/mail/X. Instead install procmail. With procmail you can set up a script which is called each time when the messages is received (and not until the whole thing is there!).
[EMAIL PROTECTED] wrote: > Hi all! > > I've got the job to make accepting mails to an e-mail > address a bit unusual. What's unusual. I will explain. When > a mail arrives to the address it shouldn't appear in the > /var/spool/mail immediately. Because there is daemon which > scans the mailbox all the time and as soon as it sees a mail > arriving it takes it from the box and passes it to a program > which works on it and then sends the output to a database. But > when the mail starts to arrive the system starts to write > it to the disk immediately. ..And the daemon takes of , let's > say the first 15 bytes (From, mal client etc.) but not > whole letter. That's the problem because the body contains the > datas to the program. The only solution I see is to move it > temporarly to a /temp box or directory and as soon as the whole > mail arrived pass it to the accurate mailbox so the daemon could > catch it to delivery(the whole mail) to the program. Oh, yes, > and all the headers have to be untouched so the From and > Reply to and Envelope _must_ be the same as they arrived. > The ASCII art to this (as I imagine) : > > mail to [EMAIL PROTECTED] --> temporary box/dir(until closed) --> > --> [EMAIL PROTECTED] /--> daemon --> program --> DB2/ > > How can I do it with postfix (preferable) or sendmail or any other > sendmail compatible MTA > RTFMs and HOWTOs are welcomed. > Thanx, > Ago > > -- > Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] < /dev/null -- Jens B. Jorgensen [EMAIL PROTECTED]