Ok, I there's several different issues at play here, so lets eliminate the red herrings and focus on the problem.
When you try to use SMTP - it doesn't connect.
When you try to use the local mailer it has the wrong email address.
So first, lets ignore the SMTP method.
So, using the local mailer, punBB injects the email via PHPs mail() function via its own pun_mail() wrapper function in includes.email.php
Depending on your PHP install *AND* the mail injection program that is used this MAY result in the SMTP envelope address using the From: address you specify - otherwise it MAY end up as the user@host that the webserver runs as - regardless of any admin options you set in punBB.
So, the question now is - What emailer is running on the punBB webserver?
Also, what is the sendmail_path = line in your php.ini
Finally, can you post as sample header from an email that is delivered via this route?
Given these answers, I am sure I can point you in the right direction.
Paul.
[addition] Rickard: you might like to change the email.php from:
function pun_mail($to, $subject, $message, $from = '')
to
function pun_mail($to, $subject, $message, $from = '', $extra='')
and the call from:
mail($to, $subject, $message, $headers);
to
mail($to, $subject, $message, $headers, $extra);
to prepare the code to be able to pass "-f [adminemail]" in the extra arg for some webservers.
Other MTAs such as QMAIL, you have to use: (iirc)
putenv('QMAILSUSER=sendername');
putenv('QMAILSHOST=senderhost');
before you call the mail();