Return-Path settings. qmail-send program. Unreturnable address rejected.

    Ive bought a VPS hosting with 2-IP addresses. (Plesk Control Panel)

1st IP address is set to domain -> (external DNS not assigned)
( will not be resolved )

2nd address is my original online server with proper DNS settings.

My plesk control panel is showing both this domain &
- Mail service has been enabled for
- Mail service has been disabled for

Inside I have PHP website which uses mail() function.

Im setting the and From: ReplyTo: to and this is working fine.
But the Return-Path which is set automatically by the server becomes

Mail is sent sucessfully & received in most cases. But some gives the error attached in code.
Because the Domain of sender address does not exist.

How to fix this or atleast change this Return-Path to
Hi. This is the qmail-send program at
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

Connected to but sender was rejected.
Remote host said: 553 5.1.8 <>... Unreturnable address rejected

--- Below this line is a copy of the message.

Return-Path: <>
Received: (qmail 10186 invoked by uid 23); 3 Sep 2010 11:64:25 +0900
Date: 3 Sep 2010 11:64:25 +0900
Subject: =?UTF-8?B?aXdpbmUuanAg44GU5rOo5paH44GC44KK44GM44Go44GG44GU44GW44GE?=  =?UTF-8?B?44G+44GZ44CA44GK5oyv6L6844G/5L6d6aC8?=

Open in new window

Who is Participating?
Daniel McAllisterConnect With a Mentor President, IT4SOHO, LLCCommented:
The issue is two-fold... but first, let's get some things straight:

- DNS resolves hostnames with A records, and SEPARATELY routes EMAIL with MX records. A domain's DNS service can specify an MX record either as an A record, or with an IP address directly (you're not supposed to have an MX record point to a CNAME DNS entry, as it breaks some mail programs).

So, if InterfaceA is what you call and it has an IP address of and InterfaceB is what you call and it has IP address Now, what you've described above is that only the IP address has been "advertised" as the server address, but you're trying to make sure that e-mail passes over the interface.

If that is all true, then here are my observations:

1) Receivers from "" cannot reply because there is no DNS entry for the domain -- you need to either:"
  A) fix your DNS for to include a domain of, or
  B) fix your QMAIL setting so that the defaulthost (and me) values are just instead of, or
  C) fix your call to the mail() function so that you use a non-default (anonymous@hostname) FROM value

NOTE: Some recipients WILL be able to reply because the mail servers CHEAT -- recognizing that the message is a REPLY, it gets the IP address of the server from the replied-to message header instead of DNS's MX record (which, as discussed above, won't work).

2) Some recipients won't accept mail from "" because their SPAM blockers recognize that the domain name isn't valid (there isn't even an A record for, much less an MX record for it!)

Fortunately, the fixes are the same for both! Once you make the domain that is being SENT in the from field a "real" domain (either by fixing DNS or by fixing your send function), then those SPAM blockers should start letting your messages through.

I hope this helps....

BToTheAToTheBABAAuthor Commented:
- Mail service has been enabled for
- Mail service has been disabled for

If I change this the other way, Mail send stops working completely.
Because my mail server & accounts are managed separately by

So will receive any email sent to

BToTheAToTheBABAAuthor Commented:
>  C) fix your call to the mail() function so that you use a non-default (anonymous@hostname) FROM value

From & ReplyTo were initilized before.

But there is also a attibute called "Return-Path" which i set to same value as "From" value.

I know the difference between From & ReplyTo.

But still I don't know the purpose of "Return-Path".
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.