Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Mail sent by user nobody being discarded


geoffreywalton

Recommended Posts

Hi

 

I am getting the error message below on a shared server when sending an email from the admin area and on the site.

 

 

This message was created automatically by mail delivery software.

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:

 [email protected]
   Mail sent by user nobody being discarded due to sender restrictions in
WHM->Tweak Settings

------ This is a copy of the message, including all the headers. ------

Return-path: <[email protected]>
Received: from nobody by vms.yyy.com with local (Exim 4.68)
       (envelope-from <[email protected]>)
       id 1IjWBe-0001TY-QO
       for [email protected]; Sun, 21 Oct 2007 09:29:30 +0100
Received: Sales <[email protected]>
To: [email protected]
Subject: Test message
From: Sales <[email protected]>
Reply-To: Sales <[email protected]>
X-Sender: Sales <[email protected]>
Message-ID: <[email protected]>
MIME-Version: 1.0
X-Mailer: PHP4
X-Priority: 3

 

Looks like they have this setting turned on in cpanel for the server

 

Prevent the user 'nobody' from sending out mail to remote addresses - Prevents the 'nobody' user from sending email outside a php/cgi script's domain.

 

See http://www.cpanel.net/docs/whm/Tweak_Settings.htm

 

I have tried changing email.php in admin/includes/classes and includes/classes from

 

if (EMAIL_TRANSPORT == 'smtp') {
return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers));
} else {
return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers));
}

 

to

 

if (EMAIL_TRANSPORT == 'smtp') {
return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers),'-f' . $from_addr);
} else {
return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers),'-f' . $from_addr);
}

 

see http://www.forest.net/support/faqs/code_tricks/000422.php

 

Have also used .STORE_OWNER_EMAIL_ADDRESS, mentioned somewhere in this forum, and .$from in place of $from_addr in the above.

 

Still get the error when using smtp and sendmail.

 

I have also installed pear and passed over, using a test script, the following header fields

 

include('Mail.php');

$headers['To'] = '[email protected]';
$headers['Subject'] = 'Test message';
$body = 'Test message no '.(rand(1,1000));
$recipients = '[email protected]';

$headers['Received'] = 'Sales <[email protected]>';
$headers['From'] = xxx.com';
$headers['Reply-To'] = 'Sales <xxx.com>';
$headers['X-Sender'] = 'Sales <xxx.com>';
$headers['Return-Path'] = '<[email protected]>';
$headers['Message-ID'] = '<[email protected]>';
$headers['MIME-Version'] = '1.0';
$headers['X-Mailer'] = 'PHP4'; 
$headers['X-Priority'] = '3';

 

Still get the same result.

 

Anybody got ant thoughts.

 

Thanks

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Didn't get any "ant" thoughts so soldiered on.

 

Think this all came from contrib 4736, added this to both, email.php files.

 

Send email portion changed to

 

$pear_body = $this->output;

 

switch (EMAIL_TRANSPORT) {

case 'sendmail':

$pear_params['sendmail_path'] = EMAIL_SENDMAIL_PATH;

$pear_params['sendmail_args'] = EMAIL_SENDMAIL_ARGS;

$pear_mail_object =& Mail::factory('sendmail', $pear_params);

break;

case 'smtp':

$pear_params["host"] = EMAIL_SMTP_HOST;

$pear_params["port"] = EMAIL_SMTP_PORT;

if (EMAIL_SMTP_AUTH) {

$pear_params["auth"] = true;

$pear_params["username"] = EMAIL_SMTP_USERNAME;

$pear_params["password"] = EMAIL_SMTP_PASSWORD;

}

$pear_mail_object =& Mail::factory('smtp', $pear_params);

break;

}

return $pear_mail_object->send($pear_recipients, $pear_headers, $pear_body);

 

Depending on how you install pear, I used go-pear.php, the path to the include files need to be set up, so added this to both, email.php files.

 

 

ini_set(

"include_path", (

ini_get("include_path").".:/home/xxx/public_html/pear/PEAR/"

)

);

 

Also needed to add .htacess protection to the pear admin page.

 

Finally in the extra admin options provided by 4736 ,have to set the host to local hoat, username also has to include domain name

 

Send HTML or Text Invoices to Customers true

Default E-Mailed HTML Invoice Template invoice.php

E-Mail Transport Method smtp

E-Mail Linefeeds CRLF

Use MIME HTML When Sending Emails false

Verify E-Mail Addresses Through DNS true

Send E-Mails true

Sendmail Path /usr/sbin/sendmail

Sendmail Arguments -i -t

SMTP Host localhost

SMTP Port 25

Use SMTP Authentication true

SMTP Username [email protected]

SMTP Password kgbgkFFF or

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

  • 2 weeks later...
Didn't get any "ant" thoughts so soldiered on.

 

Think this all came from contrib 4736, added this to both, email.php files.

 

Send email portion changed to

 

$pear_body = $this->output;

 

switch (EMAIL_TRANSPORT) {

case 'sendmail':

$pear_params['sendmail_path'] = EMAIL_SENDMAIL_PATH;

$pear_params['sendmail_args'] = EMAIL_SENDMAIL_ARGS;

$pear_mail_object =& Mail::factory('sendmail', $pear_params);

break;

case 'smtp':

$pear_params["host"] = EMAIL_SMTP_HOST;

$pear_params["port"] = EMAIL_SMTP_PORT;

if (EMAIL_SMTP_AUTH) {

$pear_params["auth"] = true;

$pear_params["username"] = EMAIL_SMTP_USERNAME;

$pear_params["password"] = EMAIL_SMTP_PASSWORD;

}

$pear_mail_object =& Mail::factory('smtp', $pear_params);

break;

}

return $pear_mail_object->send($pear_recipients, $pear_headers, $pear_body);

 

Depending on how you install pear, I used go-pear.php, the path to the include files need to be set up, so added this to both, email.php files.

ini_set(

"include_path", (

ini_get("include_path").".:/home/xxx/public_html/pear/PEAR/"

)

);

 

Also needed to add .htacess protection to the pear admin page.

 

Finally in the extra admin options provided by 4736 ,have to set the host to local hoat, username also has to include domain name

 

Send HTML or Text Invoices to Customers true

Default E-Mailed HTML Invoice Template invoice.php

E-Mail Transport Method smtp

E-Mail Linefeeds CRLF

Use MIME HTML When Sending Emails false

Verify E-Mail Addresses Through DNS true

Send E-Mails true

Sendmail Path /usr/sbin/sendmail

Sendmail Arguments -i -t

SMTP Host localhost

SMTP Port 25

Use SMTP Authentication true

SMTP Username [email protected]

SMTP Password kgbgkFFF or

 

what server your domain on , : windows or Unix/ Linux ?

 

first thing you need to know your server ,

then follow the instruction on this link ,

 

http://www.oscommerce.info/kb/osCommerce/A...nfiguration/180

 

this will solve the problem , at least did it for me,

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...