Jump to content

[UNCONFIRMED] WHMCS Ignores Mail Settings


Recommended Posts

When sending e-mail with PHP Mail() WHMCS causes the mail to be sent using one of the host's interface aliases (eth0:0, 74.50.122.55) instead of using the primary interface (eth0, 66.232.99.54) and ignores the mail settings:

 

  • Setup -> General -> Mail: System Emails From Name
  • Setup -> General -> Mail: System Emails From Email

and, instead, uses the general settings:

 

  • Setup -> General -> Company Name
  • Setup -> General -> Email Address

e.g., Using the settings below:

 

Company Name: Rocket-Powered.com

Email Address: administrative@rocket-powered.com

System Emails From Name: Rocket-Powered.com Account Management

System Emails From Email: billing@rocket-powered.com

 

...WHMCS formats e-mail like this when sending e-mail with PHP Mail():

 

Return-Path: <gorocketpowered@www.rocket-powered.com>
Received: from www.rocket-powered.com ([[color="#FF0000"]74.50.122.55[/color]])
       by mx.google.com with ESMTPS id d47si7877211yhe.55.2013.04.11.19.26.18
       (version=TLSv1 cipher=RC4-SHA bits=128/128);
       Thu, 11 Apr 2013 19:26:18 -0700 (PDT)
Received-SPF: fail (google.com: domain of gorocketpowered@www.rocket-powered.com does not designate [color="#FF0000"]74.50.122.55[/color] as permitted sender) client-ip=[color="#FF0000"]74.50.122.55[/color];
Authentication-Results: mx.google.com;
      spf=hardfail (google.com: domain of gorocketpowered@www.rocket-powered.com does not designate [color="#FF0000"]74.50.122.55[/color] as permitted sender) smtp.mail=gorocketpowered@www.rocket-powered.com
Received: by www.rocket-powered.com (Postfix, from userid 10001)
id 59F2539412D; Fri, 12 Apr 2013 02:19:21 +0000 (UTC)
To: Fred Flintstone <epretorios@gmail.com>
Subject: Welcome
X-PHP-Originating-Script: 10001:class.phpmailer.php
Date: Fri, 12 Apr 2013 02:19:21 +0000
From: [color="#FF0000"]"Rocket-Powered.com" <administrative@rocket-powered.com>[/color]

 

Compare this to the way that Plesk formats/delivers e-mail:

[color="#00FF00"]Return-Path: <eric@rocket-powered.com>[/color]
Received: from www.rocket-powered.com (rocket-powered.com. [66.232.99.54])
       by mx.google.com with ESMTPS id c48si6686004yhj.222.2013.04.12.13.56.33
       (version=TLSv1 cipher=RC4-SHA bits=128/128);
       Fri, 12 Apr 2013 13:56:33 -0700 (PDT)
Received-SPF: pass (google.com: domain of [color="#00FF00"]eric@rocket-powered.com[/color] designates [color="#00FF00"]66.232.99.54[/color] as permitted sender) client-ip=[color="#00FF00"]66.232.99.54;[/color]
Authentication-Results: mx.google.com;
      spf=pass (google.com: domain of [color="#00FF00"]eric@rocket-powered.com[/color] designates [color="#00FF00"]66.232.99.54[/color] as permitted sender) smtp.mail=eric@rocket-powered.com
X-No-Auth: unauthenticated sender
DomainKey-Signature: a=rsa-sha1;  q=dns; c=nofws;
 s=default; d=rocket-powered.com;
 b=yUzpQWetFXIGUtHXub+a2SiufglDPhSpEhM2ct+d7zoeJ4ewcpQnAxZA3tspizPurgffR7w/Q7PC7YJ5bVaOBTlQF6ZOzOWkEpcuqSSED/NwEOC9T/JhKHnFFrM/AIWz;
 h=Received:From:To:Reply-To:Date:Content-Transfer-Encoding:X-Mailer:Mime-Version:Content-Type:Subject:Message-Id;
Received: from localhost (localhost [127.0.0.1])
by www.rocket-powered.com (Postfix) with ESMTP id A786B394136
for <epretorios@gmail.com>; Fri, 12 Apr 2013 20:49:34 +0000 (UTC)
From: Eric Pretorious <eric@rocket-powered.com>
To: Fred Flintstone <epretorios@gmail.com>
Reply-To: Eric Pretorious <eric@rocket-powered.com>
Date: Fri, 12 Apr 2013 20:49:34 +0000
Content-Transfer-Encoding: 8bit
X-Mailer: PHP/5.3.10
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Subject: <www.rocket-powered.com> Notification of the customer creation.

 

REFERENCE

http://php.net/manual/en/function.mail.php

Link to comment
Share on other sites

Looking more closely at the first complaint:

 

When sending e-mail with PHP Mail() WHMCS causes the mail to be sent using one of the host's interface aliases (eth0:0, 74.50.122.55) instead of using the primary interface (eth0, 66.232.99.54)...

...and examining the headers more closely:

 

Return-Path: <gorocketpowered@www.rocket-powered.com>
Received: from www.rocket-powered.com ([[color="#FF0000"]74.50.122.55[/color]])
       by mx.google.com with ESMTPS id d47si7877211yhe.55.2013.04.11.19.26.18
       (version=TLSv1 cipher=RC4-SHA bits=128/128);
       Thu, 11 Apr 2013 19:26:18 -0700 (PDT)
Received-SPF: fail (google.com: domain of gorocketpowered@www.rocket-powered.com does not designate [color="#FF0000"]74.50.122.55[/color] as permitted sender) client-ip=[color="#FF0000"]74.50.122.55[/color];
Authentication-Results: mx.google.com;
      spf=hardfail (google.com: domain of gorocketpowered@www.rocket-powered.com does not designate [color="#FF0000"]74.50.122.55[/color] as permitted sender) smtp.mail=gorocketpowered@www.rocket-powered.com
[b]Received: by www.rocket-powered.com (Postfix, from userid 10001)
id 59F2539412D; Fri, 12 Apr 2013 02:19:21 +0000 (UTC)[/b]
To: Fred Flintstone <epretorios@gmail.com>
Subject: Welcome
X-PHP-Originating-Script: 10001:class.phpmailer.php
Date: Fri, 12 Apr 2013 02:19:21 +0000
From: [color="#FF0000"]"Rocket-Powered.com" <administrative@rocket-powered.com>[/color]

 

[color="#00FF00"]Return-Path: <eric@rocket-powered.com>[/color]
Received: from www.rocket-powered.com (rocket-powered.com. [66.232.99.54])
       by mx.google.com with ESMTPS id c48si6686004yhj.222.2013.04.12.13.56.33
       (version=TLSv1 cipher=RC4-SHA bits=128/128);
       Fri, 12 Apr 2013 13:56:33 -0700 (PDT)
Received-SPF: pass (google.com: domain of [color="#00FF00"]eric@rocket-powered.com[/color] designates [color="#00FF00"]66.232.99.54[/color] as permitted sender) client-ip=[color="#00FF00"]66.232.99.54;[/color]
Authentication-Results: mx.google.com;
      spf=pass (google.com: domain of [color="#00FF00"]eric@rocket-powered.com[/color] designates [color="#00FF00"]66.232.99.54[/color] as permitted sender) smtp.mail=eric@rocket-powered.com
X-No-Auth: unauthenticated sender
DomainKey-Signature: a=rsa-sha1;  q=dns; c=nofws;
 s=default; d=rocket-powered.com;
 b=yUzpQWetFXIGUtHXub+a2SiufglDPhSpEhM2ct+d7zoeJ4ewcpQnAxZA3tspizPurgffR7w/Q7PC7YJ5bVaOBTlQF6ZOzOWkEpcuqSSED/NwEOC9T/JhKHnFFrM/AIWz;
 h=Received:From:To:Reply-To:Date:Content-Transfer-Encoding:X-Mailer:Mime-Version:Content-Type:Subject:Message-Id;
[b]Received: from localhost (localhost [127.0.0.1])
by www.rocket-powered.com (Postfix) with ESMTP id A786B394136
for <epretorios@gmail.com>; Fri, 12 Apr 2013 20:49:34 +0000 (UTC)[/b]
From: Eric Pretorious <eric@rocket-powered.com>
To: Fred Flintstone <epretorios@gmail.com>
Reply-To: Eric Pretorious <eric@rocket-powered.com>
Date: Fri, 12 Apr 2013 20:49:34 +0000
Content-Transfer-Encoding: 8bit
X-Mailer: PHP/5.3.10
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Subject: <www.rocket-powered.com> Notification of the customer creation.

...and then comparing these to the headers of a message crafted+submitted from the CLI using the value contained in sendmail_path (i.e., /usr/sbin/sendmail -t -i):

 

[root@www ~]# cat test.msg 
To: epretorios@gmail.com
Subject: This is a bogus e-mail

This is a bogus e-mail.
[root@www ~]# sendmail -t -i < test.msg

 

Return-Path: <root@www.rocket-powered.com>
Received: from www.rocket-powered.com ([[color="#FF0000"]74.50.122.55[/color]])
       by mx.google.com with ESMTPS id c4si14411712yhe.53.2013.04.13.11.39.16
       (version=TLSv1 cipher=RC4-SHA bits=128/128);
       Sat, 13 Apr 2013 11:39:16 -0700 (PDT)
Received-SPF: fail (google.com: domain of root@www.rocket-powered.com does not designate [color="#FF0000"]74.50.122.55[/color] as permitted sender) client-ip=[color="#FF0000"]74.50.122.55[/color];
Authentication-Results: mx.google.com;
      spf=hardfail (google.com: domain of root@www.rocket-powered.com does not designate [color="#FF0000"]74.50.122.55[/color] as permitted sender) smtp.mail=root@www.rocket-powered.com
[b]Received: by www.rocket-powered.com (Postfix, from userid 0)
id CA46D39412D; Sat, 13 Apr 2013 18:32:14 +0000 (UTC)[/b]
From: bogus@gmail.com
To: epretorios@gmail.com
Subject: This is a bogus e-mail

 

...reveals that:

 

  1. submitting e-mail for delivery using /usr/sbin/sendmail is causing Postfix to use the eth0:0 interface alias instead of the interface eth0.
  2. Plesk seems to be submitting e-mail for deliver using SMTP instead of PHP Mail().

The issue with the interface selection (i.e., eth0 vs eth0:0) seems to be caused entirely by Postifx - not WHMCS.

The issue with the Sender information, however, is most definitely caused by WHMCS inserting the wrong values into the envelope header.

Link to comment
Share on other sites

  1. submitting e-mail for delivery using /usr/sbin/sendmail is causing Postfix to use the eth0:0 interface alias instead of the interface eth0.
  2. Plesk seems to be submitting e-mail for deliver using SMTP instead of PHP Mail().

'

Using SMTP to submit e-mail for delivery (Setup -> General -> Mail: Mail Type) causes Postifx to behave correctly: :lol:

 

  1. Using PHP Mail():
    Return-Path: <[color="#FF0000"]gorocketpowered[/color]@www.rocket-powered.com>
    Received: from www.rocket-powered.com ([[color="#FF0000"]74.50.122.55[/color]])
           by mx.google.com with ESMTPS id v67si15160288yhm.33.2013.04.13.17.25.01
           (version=TLSv1 cipher=RC4-SHA bits=128/128);
           Sat, 13 Apr 2013 17:25:01 -0700 (PDT)
    Received-SPF: fail (google.com: domain of [color="#FF0000"]gorocketpowered@www.rocket-powered.com[/color] does not designate [color="#FF0000"]74.50.122.55[/color] as permitted sender) client-ip=[color="#FF0000"]74.50.122.55[/color];
    Authentication-Results: mx.google.com;
          spf=hardfail (google.com: domain of [color="#FF0000"]gorocketpowered@www.rocket-powered.com[/color] does not designate [color="#FF0000"]74.50.122.55[/color] as permitted sender) smtp.mail=gorocketpowered@www.rocket-powered.com
    Received: by www.rocket-powered.com (Postfix, from userid 10001)
    id D248C39412D; Sun, 14 Apr 2013 00:17:58 +0000 (UTC)
    To: Fred Flintstone <epretorious@gmail.com>
    Subject: Welcome
    X-PHP-Originating-Script: 10001:class.phpmailer.php
    Date: Sun, 14 Apr 2013 00:17:58 +0000
    From: "Rocket-Powered.com" <administrative@rocket-powered.com>


  2. Using SMTP:
    Return-Path: <[color="#00FF00"]administrative@rocket-powered.com[/color]>
    Received: from [url]www.rocket-powered.com[/url] (rocket-powered.com. [[color="#00FF00"]66.232.99.54[/color]])
           by mx.google.com with ESMTPS id s61si9056793yhd.296.2013.04.13.17.28.36
           (version=TLSv1 cipher=RC4-SHA bits=128/128);
           Sat, 13 Apr 2013 17:28:36 -0700 (PDT)
    Received-SPF: pass (google.com: domain of [color="#00FF00"]administrative@rocket-powered.com[/color] designates [color="#00FF00"]66.232.99.54[/color] as permitted sender) client-ip=[color="#00FF00"]66.232.99.54[/color];
    Authentication-Results: mx.google.com;
          spf=pass (google.com: domain of [color="#00FF00"]administrative@rocket-powered.com[/color] designates [color="#00FF00"]66.232.99.54[/color] as permitted sender) smtp.mail=[color="#00FF00"]administrative@rocket-powered.com[/color]
    Received: from [url]www.rocket-powered.com[/url] (localhost [iPv6:::1])
    by [url]www.rocket-powered.com[/url] (Postfix) with ESMTPA id 979D23940F7
    for <epretorious@gmail.com>; Sun, 14 Apr 2013 00:21:33 +0000 (UTC)
    DomainKey-Signature: a=rsa-sha1;  q=dns; c=nofws;
     s=default; d=rocket-powered.com;
     b=Y5YVbjb5mXPJgyDkMjXdanWRCM4gdEjIdbgouOpDJ6hEAObGcaokpiidfhc29lvBezLyZL06++gL1oyd+bjrywd1I9sqlB0i5Tfjig2ufKLEizcSeyTkDWjm/jKP6TIy;
     h=Date:To:From:Reply-To:Subject:Message-ID:X-Priority:X-Mailer:MIME-Version:Content-Type;
    Date: Sun, 14 Apr 2013 00:21:33 +0000
    To: Fred Flintstone <epretorios@gmail.com>
    From: "Rocket-Powered.com" <administrative@rocket-powered.com>
    Reply-To: "Rocket-Powered.com" <administrative@rocket-powered.com>
    Subject: Welcome

HTH,

Link to comment
Share on other sites

When sending e-mail with PHP Mail() WHMCS ... ignores the mail settings:

 

  • Setup -> General -> Mail: System Emails From Name
  • Setup -> General -> Mail: System Emails From Email

 

and, instead, uses the general settings:

 

  • Setup -> General -> Company Name
  • Setup -> General -> Email Address

 

e.g., Using the settings below:

 

Company Name: Rocket-Powered.com

Email Address: administrative@rocket-powered.com

System Emails From Name: Rocket-Powered.com Account Management

System Emails From Email:billing@rocket-powered.com

 

UPDATE: Over the course of configuring+testing WHMCS, I've noticed that the New Order Notification e-mail contains the correct e-mail address:

 

From - Thu Apr 18 16:23:02 2013
X-Account-Key: account3
X-UIDL: UID2520-1360462421
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
X-Mozilla-Keys:                                                                                 
DomainKey-Status: good
Return-Path: <billing@rocket-powered.com>
X-Original-To: [email]administrative@rocket-powered.com[/email]
Delivered-To: [email]eric@rocket-powered.com[/email]
Received: from [url]www.rocket-powered.com[/url] (localhost [iPv6:::1])
by [url]www.rocket-powered.com[/url] (Postfix) with ESMTPA id 95B153940E0
for <administrative@rocket-powered.com>; Thu, 18 Apr 2013 05:43:35 +0000 (UTC)
DomainKey-Signature: a=rsa-sha1;  q=dns; c=nofws;
 s=default; d=rocket-powered.com;
 b=q3AOJXMzENqHbPU1ttuNnS6zDAvKRm4spRHzlj3/L8zSYj3itFn3KpFlHrBktQ8s4yqT0nGsLSrM2txxoKY2Yv+8wB0MnTaVk4wC/Nbs4mQIH0dIG7T2ryIhZEQF4H6n;
 h=Date:To:From:Subject:Message-ID:X-Priority:X-Mailer:MIME-Version:Content-Type;
Date: Thu, 18 Apr 2013 05:43:35 +0000
To: Eric Pretorious <administrative@rocket-powered.com>
[b]From: [color="#00FF00"]"Rocket-Powered.com Account Management" <billing@rocket-powered.com>[/color]
Subject: WHMCS New Order Notification[/b]
Message-ID: <6eccf4cff3f7cdf8a065af658ce03ec8@www.rocket-powered.com>
X-Priority: 3
X-Mailer: PHPMailer 5.2.4 ([url]http://code.google.com/a/apache-extras.org/p/phpmailer/[/url])
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="b1_6eccf4cff3f7cdf8a065af658ce03ec8"

 

...and that the Order Notification contains the incorrect e-mail address:

 

From - Thu Apr 18 16:23:02 2013
X-Account-Key: account3
X-UIDL: UID2521-1360462421
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
X-Mozilla-Keys:                                                                                 
DomainKey-Status: good
Return-Path: <administrative@rocket-powered.com>
X-Original-To: eric@rocket-powered.com
Delivered-To: eric@rocket-powered.com
Received: from www.rocket-powered.com (localhost [iPv6:::1])
by www.rocket-powered.com (Postfix) with ESMTPA id 1350B3940EF;
Thu, 18 Apr 2013 05:43:37 +0000 (UTC)
DomainKey-Signature: a=rsa-sha1;  q=dns; c=nofws;
 s=default; d=rocket-powered.com;
 b=iuy3nmETkQMWgD28z0sSm8QKRyDI2CNtKI5ZbMnVxqJ00PKzAgaXWyXig9AO9q/Wus0qRFvAygPlkIzUMC4oWBjvWxWz0TsKIsz2jggDaKwlGG7LK8jJF9QURPa+3O6n;
 h=Date:To:From:Reply-To:Subject:Message-ID:X-Priority:X-Mailer:MIME-Version:Content-Type;
Date: Thu, 18 Apr 2013 05:43:37 +0000
To: Justine Pretorious <justine@luckydogconsulting.net>, Eric Pretorious <eric@rocket-powered.com>
[b]From:[color="#FF0000"] "Rocket-Powered.com" <administrative@rocket-powered.com>[/color][/b]
Reply-To: "Rocket-Powered.com" <administrative@rocket-powered.com>
[b]Subject: Order Confirmation[/b]
Message-ID: <1ab2929537fec5f0c155004f1222e145@www.rocket-powered.com>
X-Priority: 3
X-Mailer: PHPMailer 5.2.4 (http://code.google.com/a/apache-extras.org/p/phpmailer/)
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="b1_1ab2929537fec5f0c155004f1222e145"

 

HTH,

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated