CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • Command line civimail cronjob - emails have username and password in headers
Pages: [1]

Author Topic: Command line civimail cronjob - emails have username and password in headers  (Read 1177 times)

hintbw

  • I’m new here
  • *
  • Posts: 20
  • Karma: 1
    • AzTEA
Command line civimail cronjob - emails have username and password in headers
November 08, 2011, 12:00:26 pm
Does it worry anyone that emails sent out using the civimail cronjob through the command line expose a valid username and password in the Internet headers for any email that is sent?

When I look at the Internet headers for an email sent by civimail (that is run through a cli cronjob) it shows me a valid username and password.

I just wondered if I am missing something or if this is expected behavior? Even with a relatively unprivileged user (just able to access civimail) it could open the site to possible abuses couldn't it?
---
Brett

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Command line civimail cronjob - emails have username and password in headers
November 08, 2011, 12:44:00 pm

the recommended way is to run the civimail cronjob via the shell. A lot faster and more memory efficient.

For the web, the docs do mention the security issue and ask folks to send in the name and password via a POST so they dont appear in your apache log files etc

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

hintbw

  • I’m new here
  • *
  • Posts: 20
  • Karma: 1
    • AzTEA
Re: Command line civimail cronjob - emails have username and password in headers
November 08, 2011, 01:06:19 pm
I am running it as a cronjob via the shell. It reports the cronjob command with the parameters (which includes a username and password for the website). It reports the information under X-Source-Args in the Internet Headers.
---
Brett

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Command line civimail cronjob - emails have username and password in headers
November 08, 2011, 02:31:00 pm

yes, but is your shell command calling a url?

Check:

http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviMail+Installation#CiviMailInstallation-Usingtheshell

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

hintbw

  • I’m new here
  • *
  • Posts: 20
  • Karma: 1
    • AzTEA
Re: Command line civimail cronjob - emails have username and password in headers
November 08, 2011, 02:47:57 pm
I'm not a sysadmin expert (enough to mostly get things done and be a little dangerous), but I believe I have it setup for the civimail functions so that it doesn't call it via a URL, but uses PHP cli to execute the civicrm cron functions (they are in bold). I have included a sanitized version of my crontab to verify.

MAILTO="webmaster@*****.org"
0 0 * * * wget -O - -q -t 1 'http://www.*****.org/sites/all/modules/civicrm/bin/UpdateMembershipRecord.php?name=****&pass=*****&key=********'  >> /home/******/update_membership.logfile
*/15 * * * * wget -O - -q -t 1 http://www.*****.org/cron.php > /dev/null 2>&1
# This must be set to the directory where civicrm is installed.
CIVI_ROOT="/home/*******/public_html/current/sites/all/modules/civicrm"
USER=*****
#Location of the PHP Command Line Interface binary. nice -19 forces to run at a lower priority than the web server
PHP=nice -n19 /usr/local/bin/php

#line to be modified according to the informations below
PARAMS= -s*****.org -u******* -p********
#cronjob send
# m h  dom mon dow   command
*/5 * * * * cd $CIVI_ROOT;$PHP bin/civimail.cronjob.php $PARAMS
*/15 * * * * cd $CIVI_ROOT;$PHP bin/EmailProcessor.php #PARAMS
---
Brett

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Command line civimail cronjob - emails have username and password in headers
November 08, 2011, 05:48:04 pm

seems like u r calling UpdateMembershipRecord with the url which probably is displaying the name/pass

you might want to try sending it via POST rather than via GET for that url

In 4.1, we'll standardized all the cron scripts for cli execution which should make things a lot easier

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • Command line civimail cronjob - emails have username and password in headers

This forum was archived on 2017-11-26.