Links in digest emails sent by SimplifyEmail using 'localhost'

36 views
Skip to first unread message

Jon Phipps

unread,
Nov 24, 2014, 9:14:20 AM11/24/14
to lookah...@googlegroups.com
I've obviously missed a configuration setting. The links in the messages sent from my SimplifyEmail server to my email client point to 'localhost' instead of my SimplifyEmail server:
 <li>
 NYTimes.com:
 
<a href="http://localhost/message/view/3581">Books Update: What Survives</a>
 
</li>

...and I can't quite see where to change that. I assume that it's because the cron daemon think's it's running on localhost and the host for the email message has to be set manually somewhere. 

Where might this be?

Thanks

Jeff Reifman

unread,
Nov 26, 2014, 3:36:38 PM11/26/14
to lookah...@googlegroups.com
It should be configured in /var/secure/yourinifile.ini

base_url = "http://baseurl.com/"

It's also being generated from Message.php model
              if ($mailbox != $r->path_private) {
                $msg_line = getSenderNameForDigest($m['sender_id']).': <a href="'.Yii::app()->getBaseUrl(true).'/message/view/'.$m['id'].'">'.$m['subject'].'</a>';                
              } else {
                $msg_line = getSenderNameForDigest($m['sender_id']).': <a href="'.Yii::app()->getBaseUrl(true).'/privatemessage/index/">'.$m['subject'].'</a>';                

Jeff Reifman

unread,
Dec 1, 2014, 11:27:22 PM12/1/14
to lookah...@googlegroups.com

I added that setting, but it doesn't make a difference. I can confirm that the ini file is being parsed, but still:

Yii::app()->getBaseUrl(true) == ''

Jon

--

Visit our Website at http://lookahead.io

You received this message because you are subscribed to the Google Groups "Lookahead Consulting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lookahead_io...@googlegroups.com.
To post to this group, send email to lookah...@googlegroups.com.
Visit this group at http://groups.google.com/group/lookahead_io.
To view this discussion on the web visit https://groups.google.com/d/msgid/lookahead_io/7a9e3454-59b0-4246-a6d5-b2297ba9088b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jon Phipps

unread,
Dec 2, 2014, 9:24:12 AM12/2/14
to lookah...@googlegroups.com, jph...@madcreek.com
Just to elaborate a bit:
{
    wget -O /dev/null http://localhost/daemon/hourly
}
...produces links in the generated emails to 'localhost' instead of the configured domain. This makes the emails (which as you point out are the core of the system) useless for interactive maintenance. Not knowing much about Yii 1.x, it naively looks to me like the link generator in the message emails couldn't possibly use anything other than the actual baseUrl of the server processing the request, which in the above case is 'localhost'. Unless the config setting in /var/secure/filter.ini at some point overrides the app->request->baseUrl. The value of $config['base_url'] doesn't seem to be referenced anywhere in ../app/protected/config/main.php either.

Jon Phipps

unread,
Dec 3, 2014, 1:46:25 PM12/3/14
to lookah...@googlegroups.com
Jeff,

As I suspected, the DO image version of the app has the same problem. This also applies to the link in the challenge email as well.

So I took your suggestion of adding a configuration setting to /var/secure/filter.ini and altered the email messages to use 'Yii::app()->params('base_url').' instead of 'Yii::app()->getBaseUrl(true)'. This seems to have done the trick.

Jon

Jeff Reifman

unread,
Dec 8, 2014, 1:53:12 PM12/8/14
to lookah...@googlegroups.com
Thanks Jon - I'll double check the code on the image. It shouldn't require any code change to get it to work properly. Glad you got it going.
Reply all
Reply to author
Forward
0 new messages