Saturday, September 27, 2008

Processing mail with procmail

Sometimes I change my procmail rules and I want to force procmail to process my inbox again with these new rules. The inbox is usually in mbox format, therefore I have to split it to particular emails.

In this case I use formail which splits inbox to particular messages and calls specified program to serve each message independently.

Process allready received mail with procmail rules again:
formail -s procmail < $MAIL

Wednesday, September 10, 2008

AJAX Exception: Permission denied

While experimenting with AJAX via iFrame, I received following exception:

Error: Permission denied to get property Window.document

It was caught while accessing iFrame's body from the main page by the following way:
document.getElementById(frameId).contentWindow.document.body;

The problem was that I loaded some foreign site into my iFrame and then I triend to access it's body object.

Firefox prevents Javascript from accessing objects (like window's document) of sites different from the original document site. The solution is to place both the main page and content of the iFrame to the same server site.