The basic shadow mapping technique can be extended to allow for real penumbras, but a general solution will be extremely slow/expensive.
Ashaman's suggestion to use 2 shadow maps is a trade-off -- instead of the up-to-infinite depths required, it's limited to 2, which is still more information than 1 ;)
There's a general rendering technique known as "Depth Peeling", which allows you to store many layers of information per pixel, which can be applied to shadow mapping, but of course the memory and processing requires go up as you increase the amount of layers that are required.
For an example, look up "deep shadow maps", but be aware that solving this problem in general isn't easy and will involve quite a bit of research.
Another version of Ashaman's suggestion would be to render one shadow map like this, and then to move the camera "opposite" the sun (looking back towards the sun) and render a 2nd shadow map. This gives you a kind of minimum and maximum distance for occluders from the sun. You could use one map to draw really soft shadows, and the other to draw hard shadows.
In the creation of the shadow map, the camera is moved "near" the sun, looking in the same direction as the sun light is going.