
Mahorfeus |

A fireball spell generates a searing explosion of flame that detonates with a low roar and deals 1d6 points of fire damage per caster level (maximum 10d6) to every creature within the area. Unattended objects also take this damage. The explosion creates almost no pressure.
You point your finger and determine the range (distance and height) at which the fireball is to burst. A glowing, pea-sized bead streaks from the pointing digit and, unless it impacts upon a material body or solid barrier prior to attaining the prescribed range, blossoms into the fireball at that point. An early impact results in an early detonation. If you attempt to send the bead through a narrow passage, such as through an arrow slit, you must "hit" the opening with a ranged touch attack, or else the bead strikes the barrier and detonates prematurely.
The fireball sets fire to combustibles and damages objects in the area. It can melt metals with low melting points, such as lead, gold, copper, silver, and bronze. If the damage caused to an interposing barrier shatters or breaks through it, the fireball may continue beyond the barrier if the area permits; otherwise it stops at the barrier just as any other spell effect does.
I believe it would explode the moment it hits the wall.

concerro |

The pea explodes upon impact.
Area 20-ft.-radius spread
....
You point your finger and determine the range (distance and height) at which the fireball is to burst. A glowing, pea-sized bead streaks from the pointing digit and, unless it impacts upon a material body or solid barrier prior to attaining the prescribed range, blossoms into the fireball at that point. An early impact results in an early detonation.
A fireball is a spread however so it might go around the corners if it can reach.
Spread: Some effects, notably clouds and fogs, spread out from a point of origin, which must be a grid intersection. The effect can extend around corners and into areas that you can't see. Figure distance by actual distance traveled, taking into account turns the spell effect takes. When determining distance for spread effects, count around walls, not through them. As with movement, do not trace diagonals across corners. You must designate the point of origin for such an effect, but you need not have line of effect (see below) to all portions of the effect.
edit:I am not saying the bead will go around the wall. I am saying that after detonating the results of the explosion might still reach the target.

cranewings |
I'd give the target a saving throw bonus for cover, depending on what good the cover was. If the wall is too long for the fire to go around or over, then no damage. Personally, I'm off the opinion that laying in a ditch when a fireball goes off should be enough to suffer zero damage. After all, the victim has to either be holding an action to get in the ditch or already laying there.
I think it is better to err on the side of the defender.