Because the settings.php file relies on db access settings being set in the $_SERVER variable, civicrm's command line mail sending scripts do not work. As an example and test, I created a file, test.php, in the drupal root, containing the following code:
define ('DRUPAL_ROOT', '/path/to/drupal-7.8-build-1');
chdir(DRUPAL_ROOT);
require_once 'includes/bootstrap.inc';
print "Starting bootstrap\n";
drupal_override_server_variables(array('url' => 'http://local.drupal.dev/test.php'));
drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
print "Drupal database should be loaded now\n";
On a regular drupal 7.8 install without aegir, this script worked properly. On aegir 1.5, the same script, adjusted for the platform location and site url, crashes, and an strace reveals a segfault after an attempt to load install.inc from drupal.
Placing the following values at the beginning of the script, fixes that problem for aegir:
$options['db_type'] = 'mysqli';
$options['db_host'] = 'localhost';
$options['db_port'] = '3306';
$options['db_passwd'] = 'password';
$options['db_name'] = 'database_name';
$options['db_user'] = 'user_name';
Marked as minor because there are other ways of sending mail with civi, including from the command line with curl or wget, but this will likely cause problems for any Drupal bootstrap script running the "standard" way.
I can't see a way around this problem short of patching core to include drush aware code in the bootstrap process...
Comments
Comment #1
steven jones commentedI suppose that some people might like to turn off this security feature, which is fine, and we should allow this.
Comment #2
sfyn commentedI think it would be best for this to be a per-platform and/or per-site option - that would allow provision_civicrm, for instance, to automatically turn it off if we desire to do so.
Comment #3
steven jones commentedThis could be a nice 'hidden' thing in the site context, so that people who wanted to turn it off could, but Aegir doesn't have to provide the UI for it.
Comment #4
Anonymous (not verified) commentedJust in case no-one realised: you can put this in the drushrc.php of a site and then re-verify it and it will remove the cloaking.
Note also how Nginx always turns cloaking off as it's Apache-specific stuff:
Comment #5
ergonlogicIt looks like this can already be done then.