1

Topic: sendmail: Custom Return-path

Hello,

I am having troubles with sendmail, sending mail outside my own domain name which is hosted on an external webhost.

If I try to register a new member, the forum says the email was sent, but the mail never arrives. I do get a mail that a new member registered, but that address belongs to the same domain as where the forum software is installed on.

When I contacted my webhost asking him if it could be possible that sendmail was blocked in some sort of way, he responded no, it should be working. Quote: "The usual reason this doesn't work is that the mail headers are being showing as spam". To make it even more interesting, he told me he was running a forum of his own on the same server using sendmail.

He asked me to forward the mail that I did get to compare it with one of his own mails. He examined the source and told me that he thinks it needs a better return-path.

my email address at the forums is: forum@digitalx.org

the return-path is: nobody@mars.multiwebspace.com (where multiwebspace.com is my webspace provider)
his return-path is: admin@csscreator.com

I tried to change line 86 in email.php to put in my custom return-path but with my limited php skills I failed so far (if changing line 86 is enough at all). This is what I did:

$headers = 'From: '.$from.$eol.'Return-path: forum@digitalx.org'.$eol.'Date: '.date('r').$eol.'MIME-Version: 1.0'.$eol.'Content-transfer-encoding: 8bit'.$eol.'Content-type: text/plain; charset='.$lang_common['lang_encoding'].$eol.'X-Mailer: PunBB Mailer';

This is the original:

$headers = 'From: '.$from.$eol.'Date: '.date('r').$eol.'MIME-Version: 1.0'.$eol.'Content-transfer-encoding: 8bit'.$eol.'Content-type: text/plain; charset='.$lang_common['lang_encoding'].$eol.'X-Mailer: PunBB Mailer';

I would really like to try if customizing my return-path is enough to fix my problems with sendmail. Any help is kindly appreciated, as I have been trying to get sendmail running for the last 3 days now.

Re: sendmail: Custom Return-path

I'm not sure when you get e-mails and when you don't.

"I do get a mail that a new member registered"

Huh?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3

Re: sendmail: Custom Return-path

Options -> Report new registrations

Mailing List -> forum@digitalx.org

digitalx.org is the domain name the forum software is installed on. blabla@digitalx.org is the only addresses that do work. Everything outside that domain name doesn't work.

Re: sendmail: Custom Return-path

Whoops. I forgot about that feature smile

I suggest you report that to your host. It is most likely not a PunBB problem since you seem to be the only one who is experiencing it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

5

Re: sendmail: Custom Return-path

Well I did talk to my host, and since he was running a forum of his own without problems on the same server as my website, he thought it was more a software problem. roll To be exact, a wrong Return-path as I have written in my first post.

I was just hoping that setting a custom return-path at php level (include/email.php line86 perhaps) would solve my problem.

Re: sendmail: Custom Return-path

Ask your host to check the logs instead of guessing why the e-mails aren't getting though.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

7

Re: sendmail: Custom Return-path

Problem solved.

I'll post my findings below because it is a server (apache) side setting, which could be of use for people setting up their own.

My mail log looks like this:

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error.
The following address(es) failed:  blabla@something.com
    unrouteable mail domain "something.com"

The mail address itself is not the problem, everything outside the domain where the forum is hosted will not work.

With that error, sendmail and apache keywords I started googling. There are a lot of people out there experiencing the same problem. Eventually I found an interesting post:

Since I originally started this post, I wanted to let everyone know that
I finally figured out what the problem was. It actually has nothing to
do with ZenCart or the unroutable domains I was sending mail to. It has
to do with cPanel configuration.

In cPanel, when you log in as the root user, there is an area entitled
"Tweak Settings." Within this area, there is a section for tweaking
email settings. Well, there was one particular checkbox that was checked
which basically said, "Use the 'nobody' account when sending system emails."

That was why all my mail was coming from nobody@server1.mjmmagic.com,
and this is also why 99% of the ISP's were rejecting it. Apparantly,
receiving mail from "nobody" is automatically blocked. So all I did was
uncheck this option so that mail would NOT come from the nobody account,
and now everything is working fine.

I forwarded that post to my webhost and asked if he could check that setting.

The setting my webhost found is named:

Prevent the user 'nobody' from sending out mail to remote addresses
*(php and cgi scripts generally run as nobody if you are not using
phpsuexec and suexec respectively.)*

He unchecked the box and thus allowing the user nobody@something.com (which is set at the return-path) to send mail outside the domain. The box was checked because my webhost was afraid that sending mail with the user nobody would end up in spam filters. I checked with my local isp mail account, google and hotmail and all arrive in the inbox, not  in spam filters.

Although the setting seems different from the post I found and the setting that my webhost found, everything seems to be working ok now.

The only question that remains is why my host-server sends mail with the nobody account (at the return-path) and not with the account the mail is sent from. That probably is another apache/server setting, which I hope to find an answer for in the future.

Re: sendmail: Custom Return-path

Nice to hear you solved it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

9

Re: sendmail: Custom Return-path

Well, yes. When you're trying for a week to get something to work like it should, and you solve it, you're quite happy with that. Things that need fixing, and you need another person to do that for you, can be quite frustrating.

I'll take this opportunity to thank you for sharing your work for free. I'm quite pleased with this forum software package. And I tried a lot. smile