SourceForge has been redesigned. Learn more.

#113 Enhance XMLRPC support.

Vacation (23)


Add support for reply_type, interval_time, activeFrom, activeUntil for the set_away() function.
Update returned variable names in other function calls so they match dh->init() calls.

Add authentication support for $_SESSION['username']


  • Norm Brandinger

    Norm Brandinger - 2012-05-02
  • Christian Boltz

    Christian Boltz - 2012-05-27

    From the xmlrpc.php patch:

    - public function setAway($subject, $body) {
    + public function setAway($subject, $body, $reply_type, $interval_time, $activeFrom, $activeUntil) {

    I'm not sure if changing the xmlrpc interface is a good idea - what happens if an "old" client connects and only provides subject and body?

    David, what's your opinion on this?

    (see also the recent discussion on the mailinglist - maybe we'll (have to) add another parameter for the realname)

    > Add authentication support for $_SESSION['username']

    Norm, what's the reason for / advantage of this change? (it seems unrelated to the xmlrpc interface)

  • Norm Brandinger

    Norm Brandinger - 2012-05-30

    The motivation for this patch, along with some other updates that I haven't submitted yet is to get the squirrelmail postfixadmin plugin operational. Note that at this time I do have full integration between postfixadmin and squirrelmail using the XMLRPC interface.

    I suppose that the extra parameters (or perhaps all of the parameters) for setAway() can have default values. That would make the call more backward compatible.

    For example:

    public function setAway($subject, $body, $reply_type="Auto_Reply", $interval_time=86400,
    $activeFrom="2000-01-01 00:00:00", $activeUntil="2500-12-31 23:59:59") {

    The reason for adding $_SESSION['username'] was to fix an authentication problem. On this debian system implementation, both postfixadmin AND squirrelmail are co-resident (which is what I think is the root of the problem). The first XMLRPC call appeared to succeed but subsequent calls failed with authorization errors.

    I'm running: PHP 5.3.3-7+squeeze9 with Suhosin-Patch (cli) (built: May 8 2012 10:41:34) with a mostly standard php.ini file.


  • Christian Boltz

    Christian Boltz - 2013-12-08

    I just commited the xmlrpc.php changes, with the new parameters made optional:

    public function setAway($subject, $body, $reply_type = 'One Reply', $interval_time = 0, $activeFrom = '2000-01-01', $activeUntil = '2099-12-31') {

    I did not include the $ah->result -> $ah->return changes because it's named $ah->result again in the meantime ;-)

    I also didn't include your change, because your patch fixes it at the wrong place ;-)

    The correct fix is to use $_SESSION['sessid']['username'] instead of $_SESSION['username'] (the 'sessid' is there for historic reasons[tm] ;-)

    That all said - commited to SVN trunk r1602.

    If you have more patches (for example for the squirrelmail plugin), feel free to submit them ;-)

  • Christian Boltz

    Christian Boltz - 2013-12-08
    • status: open --> closed-fixed
    • Group: --> SVN (please specify revision!)
  • Christian Boltz

    Christian Boltz - 2013-12-08

    After thinking about it (and reading some other tracker items), I decided that the reply_type parameter is superfluous (setting interval_time is the important part).

    To avoid changing the xmlrpc interface once more in the future, I just changed it to

    public function setAway($subject, $body, $reply_type = 'One Reply', $interval_time = 0, $activeFrom = '2000-01-01', $activeUntil = '2099-12-31') {

    (r1603) and hope nobody depends on an interface that officially existed for an hour ;-)


Log in to post a comment.