This isn't a problem with the email notifications, this is a bug in the URL Assembling in the UBB.
I have a password protected forum, and when you direct link to a topic with a non-admin, and enter the password, it tries to goto ultimatebb.cgi/topic/5/0? instead of the topic number(replacing 5 with the forum number).
*Edit* - Here's a patch I threw together on my boards:
in Templatespublic_query_forum_pw.pl
Find
<input type="hidden" name="f" value="$in{f}" />
After it add
<input type="hidden" name="t" value="$in{t}" />
in cgi-binubb_forum.cgi
Find
&Transition($ULTIMATEBB{"ubb=$in{last};f=$in{f}"}, "$vars_wordlets{forum_pw_confirmed}", "$this_forum[1]");
Replace with
&Transition($ULTIMATEBB{"ubb=$in{last};f=$in{f};t=$in{t}"}, "$vars_wordlets{forum_pw_confirmed}", "$this_forum[1]");