A dog is by nature a protector of his territory. In the case of household dogs your home, or the dogs’ home, is the dogs’ territory and he is trying to protect it. So when a mailman walks up to your doorstep with a package it is natural for your dog to look at the mailman as a threat.
The dog tries to communicate that the mailman that he is not welcomed and tries to scare him away. Since the mailman only wants to deliver his letters and then move he was leaving anyway. Since the dog did not know that the mailman was living no matter what the dog did he is now proud of being able to protect the house.
The next time a mailman comes to your home the dog has more confident in his ability to scare him away. He will bark a little higher because he knows he can handle the situation. The mailman will also start to communicate more fear towards the dog, and the dog will be even more proud of himself.
When this continues to escalate over time the dog will become more and more aggressive. He will also feel more comfortable attacking other uniformed persons like the police, other delivery personnel and even people in suites.
It is important that your dog understands that he has no reason to bark towards your mailman as soon as possible. You have to let him understand that the mailman is not a threat, but a nice person that has no interest in harming the dog or the house itself. If you let this happen or you are not home when this happen you may risk ending up with a dog that will try to attack uniformed people all the time.
A thing you can do to control your dogs’ anger towards mailmen and let him understand that the mailman is not a threat is to take the dog out with you and let him meet the mailman. Of cause you need to be careful, but let the dog see that the mailman is a friend. If the mailman wants to and you think it is safe, late the mailman pet your dog a little and let the dog get to know him. This will make wonders alone. You can also slip a little treat to the mailman and have him give it to the dog.