In previous articles I got into how to setup Postfix and Dovecot using MySQL for management. Well this time round a question rose about creating a blackhole. Which is basically a catch all e-mail address that dumps all mail coming in.
Doing this in the MySql setup created before should be relatively easy. First of modify the ‘/etc/aliasses‘ file and add ‘devnull: /dev/null‘. This will add a virtual debian user called devnull to the system. Keep in mind this alias is not yet active. To activate it run: newaliases. This will compile the file and load it into the memory.
Now open either PostfixAdmin or MySql and add an alias from ‘@domain.com’ to ‘devnull’. Which will catch all e-mail sent to domain.com and store it into the file belonging to user devnull, which in our case is the blackhole
.
Please be carefull, as all mail sent to the domain will be dropped unless either an alias or a mailbox is defined for the domain.
As is normal with Microsoft they released some minor updates a couple of days back for Windows Vista. Since I usually don’t install updates I don’t have a lot of trouble from Microsoft with broken software. However there is one tool that seems to update automatically.
This tool is called Windows Defender, which automatically downloads new definition files every day. That should not be a problem, normally. However the last update caused the file host to be marked as unsafe if modified. Which is a big problem!
Let me tell you why, some programs like MediaPortal and MySql use the alias localhost to connect to their own services. In a normal system you wouldn’t even notice this, but this last update removed the line below from the host file. Thus disabling these applications from connecting succesfully.
127.0.0.1 localhost
For me this caused MediaPortal to stop functioning, no longer was I able to watch TV or get the schedule. All I got was some obscure System.Net.SocketException from MediaPortal. However after readding the missing line to the host file everything was working again.
So long time fix for the issue, disable Windows Defender.;)
I noticed something when I went through the posts I created on this blog. I have been raving for and against Ajax in several posts. Ranging from whether or not you should include Ajax for usability, how to work with Ajax in combination with forms and my personal favorite if you should use Ajax at all. Please keep in mind that this last post is really old already and probably a bit outdated.
Looking through all of these posts I noticed that even though I talked quite some bit about Ajax I never actually gave any examples of how to implement it. So today I will correct this mistake
It’s probably best to first give a very brief explanation of what Ajax is and how you could use it to create more dynamic and user interactive web pages. So what is Ajax actually. Well in a nutshell it’s a JavaScript implementation of communicating between the browser and the web server without having to reload an Internet page.
You can create a good impression of how it works by thinking about this as follows. In an traditional website each action a user takes will cause the browser to call a page on the web server. The web server then generates the full HTML for that page and returns it to the browser. This is visible to the user as the page they are looking at will ‘refresh’. Ajax is a technique to call the web server without reloading a page or redirecting to a new page. Hence fetching new content to an already displayed page in the browser. See the image below for a graphical overview of the communication between the browser and the web server during a typical Ajax call.

This gives you the change to greatly enhance your existing website with new features. Loading in content area’s on the fly. Submitting forms to the server without having to redirect the user, you name it and you can do it with Ajax. There are some limitations, but most of those are covered in my initial articles on this blog.
One of the first things I should probably try and explain is that every browser seems to have a different way of implementing the Ajax object. On its own this is not a big issue, but you need to keep track of this fact when you build some form of Ajax functionality in your website.
So creating the Ajax object needed to perform these calls to the web site has to be done with some try and catch work. Below is an example of how to create the Ajax object, supported by most of the popular browsers. In the example we first try and create the Ajax object for the Internet Explorer, which uses ActiveX objects.
try
{
// try to allocate the ActiveX object used by Internet Explorer
this.xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
this.xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
this.xmlHttp = false;
}
}
if (!this.xmlHttp && typeof XMLHttpRequest!='undefined')
{
// fallback for Firefox and other Mozilla based clients
this.xmlHttp = new XMLHttpRequest();
}
After executing this code (keep in mind it is JavaScript so put it in a script block in the HTML) you should have the Ajax object available in this.xmlHttp. It may be useful to know a little more about the object functions before continuing the example. The Ajax object has the following functions:
After initializing the Ajax object you can perform any call to the webserver you’d like. The example below will show you how to open an web page and display the result into a message box. What the content is that is returned is not relevant for the functioning of the example.
this.xmlHttp.open('GET', 'http://www.example.com/page.html', false);
this.xmlHttp.onreadystatechange = function()
{
if (self.xmlHttp.readyState == 4)
{
alert(self.xmlHttp.responseText);
}
}
this.xmlHttp.send(null);
As you can see this is a very basic example, but it does show exactly how to use the Ajax technology. You can apply this logic for loading in new content on the fly, or just preloading some stuff.