This type of barking is categorized as territorial barking. It isn’t the easiest type of barking to cure, but it can be done. Of course, yelling just makes it worse as the dog thinks you are joining him in scaring away the delivery person.
Most dogs, will bark a number of times when they hear someone approaching. If that someone retreats, the dog stops barking. If that someone continues to approach the house the barking will increase in both duration and intensity.
The immediate task is to understand that the dog needs to learn a “quiet” command and that command needs to be given when the dog stops barking and before he starts barking again. You have to capture the gap or pause between barking episodes to train.
This exercise takes the help of a friend. The set up is as follows: a friend begins to walk towards the house and when the dog begins to bark, friend stands still. You, with your dog are equipped with toy/clicker and treats. The moment the dogs begins to wind down, give the command of “quiet” In a soft voice, offer to play with the toy or use your clicker to mark the behavior followed by offering a treat with more verbal praise. The barking should cease for a few seconds to a minute because the friend is standing still and you are distracting the dog. The barking will begin when your friend moves either closer to the house or further away. Repeat the exercise 2 – 3 times a day for four or five days.
Timing with this exercise is critical. The training must occur in the lull between barking episodes. You don’t want the dog to get the idea that his barking is what is causing the person to go away. Whenever the dog barks unnecessarily, repeating the exercise of “quiet”, distraction, praise, treat, more praise will reinforce the learning process.
I want to thank John Rogerson for this training variation that builds on the communication between dog and owner.