Inside Out

Debugging Procmail Recipes

Three steps to nirvana:

- Modify mail fetch frequency in *.fetchmailrc* to a small value. E.g. In my .fetchmailrc, I forced fetchmail to query server every 30s:

`set daemon 30` - Set the LOGFILE and LOGABSTRACT variables in *.procmailrc*. The one liner here is, LOGFILE specified where procmail would log the rules processed and LOGABSTRACT controls the verbosity of information logged. So we modify .procmailrc to:

</p>
`  `

LOGFILE=\$HOME/.logs/procmaillog  

LOGABSTRACT=all  

<p>
</code>
  • Disable the catch-all recipe!
  • Still stuck, use printfs :-) In recipes, put in some echo "foo" >> ~/mydebug.log to check control flow.

BTW, I'm sure there are better ways to do this, /me had to send around 7-8 test mails to fix an issue! Feel free to share your recipe-debugging-tips.