Results 1 to 4 of 4

Thread: Emails for tasks use link with 127.0.0.1

  1. #1
    sabrown is offline Member
    Join Date
    Feb 2007
    Posts
    5

    Unhappy Emails for tasks use link with 127.0.0.1 - despite correct site_url setting

    Emails for tasks insist on using 127.0.0.1 instead of my actual server name. This is the same for Tasks and Project Tasks.

    Emails for meeting acceptance use the correct server name.

    I have host_name and site_url set correctly to my url in config.php.

    Sugar Version: 4.5.1d
    Sugar Edition: Open Source
    Category: Activities, Projects
    Operating System: FreeBSD
    Web Server: Apache 2
    Last edited by sabrown; 2007-05-24 at 02:04 PM. Reason: clarify topic

  2. #2
    sabrown is offline Member
    Join Date
    Feb 2007
    Posts
    5

    Default Re: Emails for tasks use link with 127.0.0.1

    The code of interest seems to be in include\SugarBean.php - around Line 1577:

    Code:
    $httpHost = $_SERVER['HTTP_HOST'];
    if($colon = strpos($httpHost, ':')) 
    {
        $httpHost  = substr($httpHost, 0, $colon);
    }
    $parsedSiteUrl  = parse_url($sugar_config['site_url']);
    $host = ($parsedSiteUrl['host'] != $httpHost) ? $httpHost : $parsedSiteUrl['host'];
    This looks like to me that if the site_url is not equal to the $_SERVER['HTTP_HOST'], then the $_SERVER['HTTP_HOST'] will override - which is backwards for me...and I would think for most sites.

  3. #3
    sugarchris's Avatar
    sugarchris is offline Sugar Community Member
    Join Date
    Sep 2005
    Location
    San Francisco, CA
    Posts
    861

    Default Re: Emails for tasks use link with 127.0.0.1

    Actually, that is as-designed.

    Since you're on Apache, it's a fairly easy fix.

    Assuming you are running virtual hosts, the directive(s) you'd want to
    apply are:
    Code:
    <virtualhost *>
    ...
    ServerName mysugarinstance.com 
    ServerAlias www.mysugarinstance.com
    ...
    </virtualhost>
    The code you cite was written to allow access through NAT and other address-transforming firewalls/routers.

  4. #4
    sabrown is offline Member
    Join Date
    Feb 2007
    Posts
    5

    Default Re: Emails for tasks use link with 127.0.0.1

    I thought this would take care of it:

    Code:
    <VirtualHost *:80>
      ServerName crm.xxxxxxxxxx.com
      RewriteEngine On
      RewriteRule ^/(.*) http://127.0.0.1:80/sugarcrm/$1 [L,P]
    </VirtualHost>
    Maybe I need the server alias as well? Is the rewrite rule confusing things?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Emails table query slowness
    By rgodoy in forum Help
    Replies: 1
    Last Post: 2007-04-03, 08:23 PM
  2. Remove unsubscribe link from mass emails
    By greenleaf108 in forum Help
    Replies: 1
    Last Post: 2007-01-30, 06:29 PM
  3. Merge Contacts show sql error
    By hheckner in forum General Discussion
    Replies: 5
    Last Post: 2006-10-04, 01:57 PM
  4. How to Manage Emails?
    By patrickdight in forum General Discussion
    Replies: 5
    Last Post: 2005-10-21, 08:24 AM
  5. Outlook link emails on the fly
    By synaq in forum Feature Requests
    Replies: 1
    Last Post: 2004-12-02, 12:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •