What defines the bounce address?

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
frankoamiricano
Registered User
Posts: 73
Joined: Thu Apr 11, 2002 3:24 am

What defines the bounce address?

Post by frankoamiricano »

I am confused about something, I have many people using a server of mine for hosting stuff. I have a few phpBB installs as well.

Whenever a email that phpBB tries to send is not delivered and bounces, I get it. I have the admin email address set to the owners of the respective forums, yet I get the bounces.
espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Post by espicom »

If the PHP mail() function is used, the bounce address is the user that apache runs under (on non-Windows systems) plus the host name, as in "apache@www1.myhostservice.net". On Windows systems, the return address is specified in the php.ini file.

If SMTP is used, the bounce address will be set to the administrative email address set in the ACP.
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer
frankoamiricano
Registered User
Posts: 73
Joined: Thu Apr 11, 2002 3:24 am

Post by frankoamiricano »

Sorry for my ignorance, what is ACP?

Why can phpBB not add in a return-path header so we can define the bounce location without external SMTP?

Can someone tell me appropriate file to look for the code to add in the header?
espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Post by espicom »

ACP = Administrative Control Panel.

Just spent a couple hours testing a MOD for it, so I'm still in abreviation mode. Sorry!
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer
User avatar
primedomain
Former Team Member
Posts: 25944
Joined: Sat Dec 15, 2001 10:23 am

Post by primedomain »

If you cannot use SMTP, you might be able to set your specific sendmail return-to address by uploading a php.ini to the /includes directory (usually the php.ini applies only to the directory you uploaded it to, but this may be different for some hosters. In any case the setting needs to be changed for /includes, because that's the directory with emailer.php):

Code: Select all

sendmail_from = yourmail@blah.com
If this doesn't work, try the following: assuming your current setting for sendmail_path is

Code: Select all

/usr/sbin/sendmail -t -i
change it to

Code: Select all

sendmail_path = /usr/sbin/sendmail -t -i -f forumbounces@server.com
If you cannot upload a php.ini (might not always be possible with shared environment hosting), this topic might help: http://www.phpbb.com/phpBB/viewtopic.ph ... t=sendmail
frankoamiricano
Registered User
Posts: 73
Joined: Thu Apr 11, 2002 3:24 am

Post by frankoamiricano »

Thanks everyone for the help, I found the sendmail path thing did not work, I also found in my research I am not at all alone in this issue.

I discovered a fix by adding an additional header to the mail() command in emailer.php

What is confusing is that the from: and Return-Path: are both set in the phpBB code, it just does not get put into the email.

I tested it as a test case in a simple hard codes email test, linux and os x both, and I suspect almost all other systems out there just do not honor the Return-Path: header at all. You have to add it as a -femail@example.com header and it will get put in. It makes no sense, but I consider it a bug in phpBB.

This leads me to my next question, where do you report bugs and fixes to in hopes they get back into the next version?

For example, only \n is used as the line endings in the emails, thats wrong as far as I know, it should be \r\n as per RFC, a lot of email servers out there will complain about stuff like this.

My official one line fix in emailer.php is to find the line that looks like this and change it to this...

find:

Code: Select all

$result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers);
			
change:

Code: Select all

$result = @mail($this->address, $this->subject, $this->msg, $this->extra_headers,"-f" . $board_config['board_email'], '-f' . $board_config['board_email']);
Graham
Former Team Member
Posts: 8462
Joined: Tue Mar 19, 2002 7:11 pm
Location: UK
Contact:

Post by Graham »

For the time being, you don't report bugs - the bug tracker is closed until we release the beta of the next major version.
"So Long, and Thanks for All the Fish"

phpBB Useful Links: Knowledge Base | Userguide | Forum Search | MOD Database | Styles Database
My Links: Blog!
Locked

Return to “2.0.x Support Forum”