Roundcube Community Forum

Third Party Contributions => Old Style Plug-Ins => Topic started by: nejko on June 15, 2008, 06:07:06 PM

Title: PostfixAdmin bridge
Post by: nejko on June 15, 2008, 06:07:06 PM
Hello,

I have written a patchset for RoundCube, to integrate PostfixAdmin's functions:
password change, vacation, forwarding - and also to copy user's full name from
postfixadmin's db when creating the default identity.

You can get my code here: http://nejc.skoberne.net/rcpfa .

I hope you'll find it useful. Send bugs and feature requests to skoberne.net>.

Bye,
Nejc
Title: PostfixAdmin bridge
Post by: guilichou on July 28, 2008, 06:58:40 AM
I didn't get it to work at all...

The first problem of your patch is that it implies that the postfix database and RC database are one unique database... Which isn't my case...

And when I dumped my RC database in the postfix database... it doesn't seem to work. I did look as the parameters you added in the main.inc.php but didn't change anything...
When I change the vacation message, I get a blank page...
Title: PostfixAdmin bridge
Post by: nejko on July 28, 2008, 08:07:52 AM
Hey,

Quote from: guilichou;13123

The first problem of your patch is that it implies that the postfix database and RC database are one unique database... Which isn't my case...


I assumed that most users use PostfixAdmin and Roundcube together this way. You can also add support for a separate database, of course. Patches are welcome.

Quote from: guilichou;13123

And when I dumped my RC database in the postfix database... it doesn't seem to work. I did look as the parameters you added in the main.inc.php but didn't change anything...
When I change the vacation message, I get a blank page...


It works for me and many other people, so it is likely to be a problem with your setup. Saying "it doesn't seem to work" is completely helpless since I can't guess what errors did you get. If you could paste the errors you get in Apache error log file, the chances of getting help would increase. Getting blank page usually means something went wrong with a PHP script. It's perfectly possible you hit a bug since your configuration might be unusual.

Also, this morning (GMT+1) I released RCPFA 1.0.3, which fixes two annoying bugs. Check the project's page.

Oh, and what versions of software do you use?

Bye,
Nejc
Title: PostfixAdmin bridge
Post by: STiAT on July 28, 2008, 11:18:09 AM
This one is far from perfect.
-> It requires that the rc and pa dbs are the same (?)
-> It requires that the login name actually is the e-mail address (why? just because pa wants it like this?)
-> In 1.0.3, I can't get it working at all - the newly gained tabs do not do anything at all in 0.2rc

Seems like it needs some fixing ...
Title: PostfixAdmin bridge
Post by: nejko on July 28, 2008, 12:11:59 PM
Quote from: STiAT;13128
This one is far from perfect.


I agree. But, we can make it better together, right?

Quote from: STiAT;13128
-> It requires that the rc and pa dbs are the same (?)


Actually, after patching, you can configure the database which PostfixAdmin uses in db.inc.php:

// PEAR database DNS for read/write operations on PostfixAdmin database
$rcmail_config['pfa_db_dsnw'] = 'mysql://postfixadmin:mail2c0kq@localhost/postfix';

Quote from: STiAT;13128
-> It requires that the login name actually is the e-mail address (why? just because pa wants it like this?)


Yes. What behaviour would you expect?

Quote from: STiAT;13128
-> In 1.0.3, I can't get it working at all - the newly gained tabs do not do anything at all in 0.2rc


0.2rc? Am I missing something here? The latest official release is 0.2-alpha? As the project's page says, it works with 0.2-alpha and some latest SVN revisions (but not the latest).

Quote from: STiAT;13128
Seems like it needs some fixing ...


I am interested in fixing it and providing a better link between RC and PA and it is great if you want to help me.

Thanks,
Nejc
Title: Berkeley DB
Post by: jcip on July 28, 2008, 10:00:30 PM
Do you think it might be possible to modify this script to work with a Berkley DB based postfix install?  I believe that's what a vanilla OS X based mail server uses, I could be mistaken however.  I'd love to replace Squirrel Mail and have this functionality added in roundcube.
Title: PostfixAdmin bridge
Post by: nejko on July 29, 2008, 02:19:14 AM
Quote from: jcip;13134
Do you think it might be possible to modify this script to work with a Berkley DB based postfix install?  I believe that's what a vanilla OS X based mail server uses, I could be mistaken however.  I'd love to replace Squirrel Mail and have this functionality added in roundcube.


Hello, actually RCPFA only needs PostfixAdmin's database. Do you have MySQL database for PostfixAdmin? If not, what db do you use for PostfixAdmin (not Postfix)?

Bye,
Nejc
Title: PostfixAdmin bridge
Post by: guilichou on July 29, 2008, 01:08:11 PM
Totally ready to help to improve the plugin!

Nevertheless, I can't get anything from the apache log... what parameter do use?
I have:
        LogLevel emerg (I tried warn, error)
        ErrorLog        /var/log/apache2/log-mailbeta.log
        CustomLog       /var/log/apache2/log-mailbeta.log combined

Thanks
Title: PostfixAdmin bridge
Post by: nejko on July 29, 2008, 01:20:59 PM
Quote from: guilichou;13148
Totally ready to help to improve the plugin!

Nevertheless, I can't get anything from the apache log... what parameter do use?
I have:
        LogLevel emerg (I tried warn, error)
        ErrorLog        /var/log/apache2/log-mailbeta.log
        CustomLog       /var/log/apache2/log-mailbeta.log combined


Make sure you have "log_errors = On" in php.ini. Try writing ErrorLog to another file than CustomLog. The error should appear in the ErrorLog.

Bye,
Nejc
Title: PostfixAdmin bridge
Post by: guilichou on July 29, 2008, 04:14:33 PM
Followed your instructions, but i still couldn't get any interesting info out in the log files... i'll try and search the web to try and get more infos...
Title: PostfixAdmin bridge
Post by: STiAT on August 02, 2008, 06:05:03 AM
@nejko:
I meant 0.2alpha actually. The buttons just never get active in the last version, and I havn't found the reason in the code yet.

Of course we can improve it.

The behaviour I'd expect is actually being able to provide a list of fields of a table which shall be taken for login.
In example, I configured roundcube and dovecot, so the users can either use their mail address OR a username to login (I simply used the name field in postfixadmin).

The reason for this is, that I'll one day disable mail logins. The reason is simple: Being able to be hacked just needs 2 informations: The e-mail and the password. Most likely, the guys trying to hack an address have the mail address of the user they'd like to log in to. If i disable the mail address, and just have a username to login, he'd need to hack two different informations, and has quite endless possibilities, and never knows the right account.

The patches seem to work properly (for the plugin side of view). Still, the plugin isn't functional. Allthough, as I said I'm still looking where the problem is located.

For the database: I've already found that there is a configuration, and adobted it. Allthough - still not working ;-).

// STi
Title: works great
Post by: denis123 on August 20, 2008, 08:26:21 AM
Great patchset. works just fine. Thanks.
Title: PostfixAdmin bridge
Post by: raffe1234 on October 09, 2008, 05:04:23 PM
To get it to work, I needed to patch index.php manually (I think it has changed since the release of pfa patch).

Before it showed the new tabs, but when I clicked on them I just got to the "Settings" tab.

After the change, it worked OK.

After this code:
Code: [Select]
// allow 5 "redirects" to another action
$redirects = 0; $incstep = null;
while ($redirects < 5) {
  $stepfile = !empty($action_map[$RCMAIL->task][$RCMAIL->action]) ?
    $action_map[$RCMAIL->task][$RCMAIL->action] : strtr($RCMAIL->action, '-', '_') . '.inc';
   
  // try to include the step file
  if (is_file(($incfile = 'program/steps/'.$RCMAIL->task.'/'.$stepfile))) {
    include($incfile);
    $redirects++;
  }
  else {
    break;
  }
}

I put this code (the code is from index.php.diff)
Code: [Select]
 // >> pfa patch
  if ($RCMAIL->action=='vacation' || $RCMAIL->action=='save-vacation')
  {
    if ($RCMAIL->config->get('pfa_enable_vacation'))
      include('program/steps/settings/pfa_vacation.inc');
    else
 $OUTPUT->show_message('vacationdisabled', 'error');
  }
 
  if ($RCMAIL->action=='password' || $RCMAIL->action=='save-password')
  {
    if ($RCMAIL->config->get('pfa_enable_password'))
      include('program/steps/settings/pfa_password.inc');  
    else
 $OUTPUT->show_message('passworddisabled', 'error');
  }

  if ($RCMAIL->action=='forwarding' || $RCMAIL->action=='save-forwarding')
  {
    if ($RCMAIL->config->get('pfa_enable_forwarding'))
      include('program/steps/settings/pfa_forwarding.inc');
    else
 $OUTPUT->show_message('forwardingdisabled', 'error');
  }
  // << pfa patch
Title: PostfixAdmin bridge
Post by: gyrex on October 17, 2008, 03:58:23 AM
Hi,

I'm running 0.2 beta and i've added this code to index.php. Unfortunately it's not working as expected though.

I can see the vacation password and forwarding tabs but when I click on them nothing happens. Has anyone been able to get this to work with the pfa patch?

Any help would be greatly appreciated!
Title: PostfixAdmin bridge
Post by: gyrex on October 17, 2008, 04:10:28 AM
Sorry - the page was cached for some reason!!! It's all working now!

Many thanks!
Title: LDAP integration
Post by: JavierF on November 07, 2008, 03:35:35 PM
Hi Folks,

Sorry to dredge this thread up from the dead, but I've put together something that folks might find handy.

First, many thanks to whomever put together the RCPFA patches, and of course to the entire RC team.

I was excited when I saw this, as vacations and forwarding are operations I found myself needing to implement for our users.  However, my setup doesn't really have room for PostFix Admin; I'm using Postfix and Dovecot with LDAP as a back-end for authentication and storage of things like forwarding addresses and vacation messages.

To that end, utilizing the extra functionality provided by RCPFA and based on the object/function calls in pfa_*.inc, I wrote a quick-n-dirty "PFA" class that can be dropped in to func.inc to provide LDAP interaction.

Please excuse the messy code; I'm sure some of this could be tightened up significantly.  I'm more of a perl hacker than a PHP one.

Code: [Select]

// Define a class called 'pfa' to handle vacations and forwards
class pfa {
  var $ldaprdn = 'cn=admin,dc=domain,dc=com';
  var $ldappass = 'secret';
  var $ldapbase = 'ou=mail,dc=domain,dc=com';

  function update_vacation($u, $a, $s, $t) {
    if ($a == 1) { $a = &quot;TRUE&quot;; } else { $a = &quot;FALSE&quot;; }

    $ldap = ldap_connect(&quot;localhost&quot;)
or die(&quot;could not connect to ldap server&quot;);

    if ($ldap) {
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
$ldapbind = ldap_bind($ldap, $this->ldaprdn, $this->ldappass);
        $sr = ldap_search($ldap, $this->ldapbase, &quot;(&(objectClass=VirtualMailAccount)(mail=$u))&quot;);
$ent = ldap_get_entries($ldap, $sr);
$dn = $ent[0][&quot;dn&quot;];
$userdata = array();
$userdata[&quot;vacationActive&quot;] = $a;
$userdata[&quot;vacationInfo&quot;] = $t;
ldap_modify($ldap, $dn, $userdata) or die(&quot;Unable to modify:&quot; . ldap_error($ldap));
ldap_close($ldap);
return true;
    } else {
return false;
    }

  }

  function get_vacation($u) {
   
    // Fetch current values from LDAP
    $ldap = ldap_connect(&quot;localhost&quot;) or die (&quot;No LDAP connect&quot;);
    ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
    $ldapbind = ldap_bind($ldap, $this->ldaprdn, $this->ldappass);
    $filter = &quot;(&(objectClass=VirtualMailAccount)(mail=$u))&quot;;
    $results = array(&quot;vacationActive&quot;, &quot;vacationInfo&quot;);
    $sr = ldap_search($ldap, $this->ldapbase, $filter, $results);
    $entries = ldap_get_entries($ldap, $sr);
   
    $active = $entries[0][&quot;vacationactive&quot;][0];
    $text = $entries[0][&quot;vacationinfo&quot;][0];
   
    if ($active == &quot;TRUE&quot;) { $active = 1; } else { $active = 0; }
 
    $retval['active'] = $active;
    $retval['subject'] = ''; // Subject not implemented in my LDAP
    $retval['body'] = $text;

    ldap_unbind($ldap);
    return $retval;
  }

  function update_forwarding($u, $alias, $local) {
    $alias = rtrim($alias);
   
    // $alias will be a string with \ns. If it is empty, set forwardActive to false.
    // otherwise set forwardActive=true.
    // if Local is true, be sure to tack on their local mail address to the
    // array when it goes into LDAP.

    // If $alias is empty we need to disable forwarding; likewise if it is non-empty
    // we need to ensure forwarding is enabled.
    if (strlen($alias) < 5) {
$forwarding = &quot;FALSE&quot;;
    } else {
$forwarding = &quot;TRUE&quot;;
    }

    $fwds = explode(&quot;\n&quot;, $alias);

    // If we get 'true' for $local, then we need to tack on the user's email address.
    if ($local == &quot;true&quot;) {
      $fwds[] = $u;
    }

    $ldap = ldap_connect(&quot;localhost&quot;)
        or die(&quot;could not connect to ldap server&quot;);

    if ($ldap) {
        ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
        $ldapbind = ldap_bind($ldap, $this->ldaprdn, $this->ldappass);
        $sr = ldap_search($ldap, $this->ldapbase, &quot;(&(objectClass=VirtualMailAccount)(mail=$u))&quot;);
        $ent = ldap_get_entries($ldap, $sr);
        $dn = $ent[0][&quot;dn&quot;];
        $userdata = array();
if ($forwarding == &quot;TRUE&quot;) { $userdata[&quot;mailForward&quot;] = $fwds; }
$userdata[&quot;forwardActive&quot;] = $forwarding;
        ldap_modify($ldap, $dn, $userdata) or die(&quot;Unable to modify:&quot; . ldap_error($ldap));
        ldap_close($ldap);
        return true;
    } else {
        return false;
    }

  }

  function get_forwarding($u) {
    // LDAP fetching for forwarding stuff

    $ldap = ldap_connect(&quot;localhost&quot;) or die (&quot;No LDAP connect&quot;);
    ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
    $ldapbind = ldap_bind($ldap, $this->ldaprdn, $this->ldappass);
    $filter = &quot;(&(objectClass=VirtualMailAccount)(mail=$u))&quot;;
    $results = array(&quot;mailForward&quot;, &quot;forwardActive&quot;);
    $sr = ldap_search($ldap, $this->ldapbase, $filter, $results);
    $entries = ldap_get_entries($ldap, $sr);

    $local = false;
    $fwds = &quot;&quot;;

    if ($entries[0][&quot;forwardactive&quot;][0] == &quot;FALSE&quot;) {
$retval['aliases'] = '';
$retval['local'] = true;
ldap_unbind($ldap);
return $retval;
    }

    foreach ($entries[0][&quot;mailforward&quot;] as $address) {
if ($address == $u) {
 $local = true;
}
elseif (is_int($address)) { continue; }
else {
 $fwds .= $address . &quot;\n&quot;;
}
    }

    // Kill any lingering \ns at the end
    $fwds = rtrim($fwds);
    ldap_unbind($ldap);
    $retval['aliases'] = $fwds;
    $retval['local'] = $local;

    return $retval;
  }  

}


And for reference, here's what a record in my LDAP schema would look like:

Code: [Select]

accountActive: TRUE
cn: jrandom
delete: FALSE
gidNumber: 100
mail: jrandomhacker@local.domain
mailbox: jrandomhacker
uid: jrandomhacker@local.domain
uidNumber: 1234
userPassword:: {SSHA}foobarbaz
username: jrandomhacker
objectClass: VirtualMailAccount
objectClass: top
objectClass: shadowAccount
objectClass: posixAccount
gecos: J. Random Hacker
vacationActive: FALSE
vacationInfo: Not here, go away.
mailForward: username@remote.domain
forwardActive: FALSE


As you can see from the LDAP record and the code, I store whether or not vacation/forwarding is active with a pair of binary records, which Postfix then uses - along with the values of mailForward - to either redirect the email or send it to gnarwl for an auto-respond.

I haven't implemented password changing as there is another tool our users are meant to use for that, but you can see how it would be relatively easy to add.

Anyway, if anyone has any suggestions or questions, please let me know.
Title: RCPFA 1.0.4 released
Post by: nejko on November 19, 2008, 05:18:46 AM
Hello,

RCPFA is now compatible with RoundCube 0.2beta. See RCPFA | Nejko’s randomness (http://nejc.skoberne.net/projects/rcpfa)

Bye,
Nejc
Title: PostfixAdmin bridge
Post by: lostdragon on November 20, 2008, 06:27:22 AM
Excuse for my English...
Who be did registration for RounCube with use PostfixAdmin?
Title: PostfixAdmin bridge
Post by: nejko on November 20, 2008, 08:40:07 PM
Quote from: lostdragon;15352
Excuse for my English...
Who be did registration for RounCube with use PostfixAdmin?


I don't understand the question. I wrote the RCPFA, if that's what you're asking.

Bye,
Nejc
Title: PostfixAdmin bridge
Post by: lostdragon on December 05, 2008, 02:28:52 PM
Quote from: nejko;15361
I don't understand the question. I wrote the RCPFA, if that's what you're asking.


It is necessary to make registration of accounts, using for connection given postfixadmin
Probably so will be more correct:-[
Title: PostfixAdmin bridge
Post by: lord2y on January 06, 2009, 02:26:39 PM
Hi all.

I downloaded the latest version 1.0.4 of RCPFA and the 0.2-stable to RoundCube but the patch does not work.
The tabs are unusable.
During patch I retrive an error on file apps.js.
In the pacth file (app.js.diff) I noticed that refers to another roundcube's version; 0not to the 0.2.
Someone managed to make it work?
Thank you.
Title: PostfixAdmin bridge
Post by: twiddler on January 08, 2009, 09:25:07 AM
Quote from: lord2y;16062
Hi all.

I downloaded the latest version 1.0.4 of RCPFA and the 0.2-stable to RoundCube but the patch does not work.
The tabs are unusable.
During patch I retrive an error on file apps.js.
In the pacth file (app.js.diff) I noticed that refers to another roundcube's version; 0not to the 0.2.
Someone managed to make it work?
Thank you.


I to upgrade to stable and the plugins don't work anymore... :(
Title: PostfixAdmin bridge
Post by: ashway on January 29, 2009, 06:49:13 PM
Quote from: twiddler;16151
I to upgrade to stable and the plugins don't work anymore... :(

I have already adapted version 1.0.4 to work with RC 0.2-stable.
See attachment.

To nejko:
---------
In 0.2-stable all java scripts are shrinked with ShrinkSafe | The Dojo Toolkit (http://dojotoolkit.org/docs/shrinksafe), original files have additional extension .src.

So, there are several ways to solve this:
1. Rename app.js.src to app.js, apply patch, shrink it.
2. Use patch, that patches shrinked version of app.js. I have included it in rcpfa-104-fixed.tar.gz.
3. Deploy patched version of app.js instead of patch.

I think you should choose the way and release a bugfix version 1.0.5.
Title: PostfixAdmin bridge
Post by: schickel on January 30, 2009, 04:13:08 AM
Hi ashway,

Quote from: ashway;16779
I have already adapted version 1.0.4 to work with RC 0.2-stable.
See attachment.

...



this work for me - thanks.
Title: Rcpfa 1.0.5
Post by: nejko on January 31, 2009, 06:07:06 PM
Hey,

the 1.0.5 version makes RCPFA compatible with RC 0.2-stable. You can get it here RCPFA | Nejko's randomness (http://nejc.skoberne.net/projects/rcpfa).

Bye,
Nejc
Title: Tabs don't work in firefox
Post by: sh0x on February 18, 2009, 12:41:36 AM
Hi I'm running RCPFA 1.0.5 with RC 0.2-stable and it works great on my setup with postfixadmin, however the tabs don't seem to work in firefox. They work within IE but in firefox the tabs are there but when clicking on them nothing happens even though I can type in the url to the tabs and the page loads

Like if I change the URL to ?_task=vacation it'll load that page in firefox, but it doesn't change pages when I click the new tabs vacation, password, and forwarding.

Can someone confirm if the tabs work for them in firefox? I'm using firefox 3.0.6.

Thanks.
Title: PostfixAdmin bridge
Post by: konst on March 18, 2009, 03:48:10 AM
I have problem with patching app.js for roundcube 0.2.1 and rcpfa 1.0.5 could anyone share  patched app.js? :)
Title: PostfixAdmin bridge
Post by: iyuja on March 22, 2009, 03:53:27 PM
Quote from: nejko;16811
Hey,

the 1.0.5 version makes RCPFA compatible with RC 0.2-stable. You can get it here RCPFA | Nejko's randomness (http://nejc.skoberne.net/projects/rcpfa).

Bye,
Nejc


hi nejko, is it possible to have the non-shrinked version of the 105 patch?  i'm trying to generate a patch to use managesieve and rcpfa with roundcube, and without the .src it gets really complicated.
Title: PostfixAdmin bridge
Post by: climaxy on March 31, 2009, 03:29:20 AM
Will there also be an updated version released which is working with the current stable version 0.2.1?
I'd really like to try out this plugin!!
Title: Help me please
Post by: danilka7 on April 01, 2009, 08:28:45 AM
When RCPFA return "Vacation" I receive next mail:

=========================================================
This is the mail system at host host.name.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                  The mail system

(expanded from user@host.name>): bad address
   syntax

Final-Recipient: rfc822; user#host.name@
Original-Recipient: rfc822;user@host.name
Action: failed
Status: 5.1.3
Diagnostic-Code: X-Postfix; bad address syntax


---------- Пересылаемое сообщение ----------
From: XXX
To: user@host.name
Date: Wed, 1 Apr 2009 12:57:48 +0300
Subject: Test!
Test!
=========================================================

What am I doing wrong.
Thanks.
Title: PostfixAdmin bridge
Post by: hitchicker on April 06, 2009, 11:46:18 PM
Quote from: climaxy;18133
Will there also be an updated version released which is working with the current stable version 0.2.1?
I'd really like to try out this plugin!!

i'm install 0.2.1 and try this patch, but this don't work, have a error with a one file. :(
Title: PostfixAdmin bridge
Post by: schickel on May 08, 2009, 10:05:14 AM
Hi,

program/js/app.js could not be patched...

nejko and Andrey Sharandakov , plz take a look at this file ;)
Title: PostfixAdmin bridge
Post by: cap0ne on May 16, 2009, 02:52:10 PM
patch app.js not working :

root@/var/www/localhost/htdocs/round/rcpfa-1.0.5 # patch -d .. -p1 < diffs/app.js.diff
patching file program/js/app.js
Hunk #1 FAILED at 235.
Hunk #2 FAILED at 279.
Hunk #3 FAILED at 349.
Hunk #4 FAILED at 367.
Hunk #5 FAILED at 402.
Hunk #6 FAILED at 442.
Hunk #7 FAILED at 455.
Hunk #8 FAILED at 476.
Hunk #9 FAILED at 535.
Hunk #10 FAILED at 557.
Hunk #11 FAILED at 604.
Hunk #12 FAILED at 662.
Hunk #13 FAILED at 675.
Hunk #14 FAILED at 716.
Hunk #15 FAILED at 766.
Hunk #16 FAILED at 780.
Hunk #17 FAILED at 834.
Hunk #18 FAILED at 857.
Hunk #19 FAILED at 871.
Hunk #20 FAILED at 895.
Hunk #21 FAILED at 977.
Hunk #22 FAILED at 1049.
Hunk #23 FAILED at 1061.
Hunk #24 FAILED at 1105.
Hunk #25 FAILED at 1134.
Hunk #26 FAILED at 1147.
Hunk #27 FAILED at 1185.
Hunk #28 FAILED at 1217.
Hunk #29 FAILED at 1464.
Hunk #30 FAILED at 1488.
Hunk #31 FAILED at 1507.
Hunk #32 FAILED at 1530.
Hunk #33 FAILED at 1666.
Hunk #34 FAILED at 1737.
Hunk #35 FAILED at 1772.
Hunk #36 FAILED at 1789.
Hunk #37 FAILED at 1803.
Hunk #38 FAILED at 1840.
Hunk #39 FAILED at 1860.
Hunk #40 FAILED at 1921.
Hunk #41 FAILED at 1938.
Hunk #42 FAILED at 1961.
Hunk #43 FAILED at 1971.
Hunk #44 FAILED at 2001.
Hunk #45 FAILED at 2016.
Hunk #46 FAILED at 2047.
Hunk #47 FAILED at 2072.
Hunk #48 FAILED at 2096.
Hunk #49 FAILED at 2135.
Hunk #50 FAILED at 2151.
Hunk #51 FAILED at 2171.
Hunk #52 FAILED at 2192.
Hunk #53 FAILED at 2219.
Hunk #54 FAILED at 2269.
Hunk #55 FAILED at 2297.
Hunk #56 FAILED at 2352.
Hunk #57 FAILED at 2366.
Hunk #58 FAILED at 2434.
Hunk #59 FAILED at 2453.
Hunk #60 FAILED at 2515.
Hunk #61 FAILED at 2557.
Hunk #62 FAILED at 2577.
Hunk #63 FAILED at 2588.
Hunk #64 FAILED at 2598.
Hunk #65 FAILED at 2733.
Hunk #66 FAILED at 2756.
Hunk #67 FAILED at 2774.
Hunk #68 FAILED at 2798.
Hunk #69 FAILED at 2841.
Hunk #70 FAILED at 2870.
Hunk #71 FAILED at 2939.
Hunk #72 FAILED at 2961.
Hunk #73 FAILED at 3005.
Hunk #74 FAILED at 3032.
Hunk #75 FAILED at 3047.
Hunk #76 FAILED at 3135.
Hunk #77 FAILED at 3147.
Hunk #78 FAILED at 3181.
Hunk #79 FAILED at 3201.
Hunk #80 FAILED at 3277.
Hunk #81 FAILED at 3300.
Hunk #82 FAILED at 3350.
82 out of 82 hunks FAILED -- saving rejects to file program/js/app.js.rej

Please HELP !
Title: PostfixAdmin bridge
Post by: Shadow aok on May 16, 2009, 06:28:32 PM
Try with this app.js file.
Title: PostfixAdmin bridge
Post by: cap0ne on May 21, 2009, 04:34:17 AM
Thank you !! is work now but when i change password i recive a messages in webpage " SERVICE CURRENTLY NOT AVAILABLE! Error No. [0x01F4] "
and in logs have error
" May 21 11:32:51 lasoc roundcube: MDB2 Error: no such table (-18): _doQuery: [Error message: Could not execute statement]
May 21 11:32:51 lasoc [Last executed query: PREPARE mdb2_statement_mysql_45e3dfa1b16b62c9a6d2cb85750209577127e5527 FROM 'SELECT 1 FROM session\n     WHERE  sess_id=?']
May 21 11:32:51 lasoc [Native code: 1146]
May 21 11:32:51 lasoc [Native message: Table 'postfix.session' doesn't exist]
May 21 11:32:51 lasoc roundcube: [21-May-2009 11:32:51 +0300] DB Error: _doQuery: [Error message: Could not execute statement]
May 21 11:32:51 lasoc [Last executed query: PREPARE mdb2_statement_mysql_45e3dfa1b16b62c9a6d2cb85750209577127e5527 FROM 'SELECT 1 FROM session\n     WHERE  sess_id=?']
May 21 11:32:51 lasoc [Native code: 1146]
May 21 11:32:51 lasoc [Native message: Table 'postfix.session' doesn't exist]
May 21 11:32:51 lasoc in /var/www/localhost/htdocs/webmail/program/include/rcube_mdb2.php on line 255 (GET /?_task=settings&_action=forwarding)
"

and when i activate vaction module i recive a bad replay, my e-mail adress is razvan@lasoc.ro , i change in main.inc.php " // Vacation autoreply domain
$rcmail_config['pfa_autoreply_domain'] = ''; "....

" This is the mail system at host mail.lasoc.ro.

I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can delete your own text from the attached returned message.

                   The mail system

(expanded from ): bad address syntax

(expanded from ): Host
    or domain name not found. Name service error for name=autoreply.DOMAIN.COM
    type=A: Host not found "
Title: PostfixAdmin bridge
Post by: wiza on May 22, 2009, 05:22:57 AM
I'm have newest roundcude installed(0.2.2) and I tried --dry-run with those patches with some errors. New version of rcpfa somewhere/coming?

First I did "cat * > all.diff to get shorter paste, but anyway, this is what I got:

# patch --dry-run -d .. -p1 < diffs/all.diff
patching file program/js/app.js
Hunk #21 FAILED at 977.
Hunk #22 FAILED at 1049.
Hunk #23 FAILED at 1061.
Hunk #24 FAILED at 1105.
Hunk #25 FAILED at 1134.
Hunk #26 FAILED at 1147.
Hunk #27 FAILED at 1185.
Hunk #28 FAILED at 1217.
Hunk #29 FAILED at 1464.
Hunk #30 FAILED at 1488.
Hunk #31 FAILED at 1507.
Hunk #32 FAILED at 1530.
Hunk #33 FAILED at 1666.
Hunk #34 FAILED at 1737.
Hunk #35 FAILED at 1772.
Hunk #36 FAILED at 1789.
Hunk #37 FAILED at 1803.
Hunk #38 FAILED at 1840.
Hunk #39 FAILED at 1860.
Hunk #40 FAILED at 1921.
Hunk #41 FAILED at 1938.
Hunk #42 FAILED at 1961.
Hunk #43 FAILED at 1971.
Hunk #44 FAILED at 2001.
Hunk #45 FAILED at 2016.
Hunk #46 FAILED at 2047.
Hunk #47 FAILED at 2072.
Hunk #48 FAILED at 2096.
Hunk #49 FAILED at 2135.
Hunk #50 FAILED at 2151.
Hunk #51 FAILED at 2171.
Hunk #52 FAILED at 2192.
Hunk #53 FAILED at 2219.
Hunk #54 FAILED at 2269.
Hunk #55 FAILED at 2297.
Hunk #56 FAILED at 2352.
Hunk #57 FAILED at 2366.
Hunk #58 FAILED at 2434.
Hunk #59 FAILED at 2453.
Hunk #60 FAILED at 2515.
Hunk #61 FAILED at 2557.
Hunk #62 FAILED at 2577.
Hunk #63 FAILED at 2588.
Hunk #64 FAILED at 2598.
Hunk #65 FAILED at 2733.
Hunk #66 FAILED at 2756.
Hunk #67 FAILED at 2774.
Hunk #68 FAILED at 2798.
Hunk #69 FAILED at 2841.
Hunk #70 FAILED at 2870.
Hunk #71 FAILED at 2939.
Hunk #72 FAILED at 2961.
Hunk #73 FAILED at 3005.
Hunk #74 FAILED at 3032.
Hunk #75 FAILED at 3047.
Hunk #76 FAILED at 3135.
Hunk #77 FAILED at 3147.
Hunk #78 succeeded at 3207 (offset 26 lines).
Hunk #79 succeeded at 3227 (offset 26 lines).
Hunk #80 succeeded at 3303 (offset 26 lines).
Hunk #81 succeeded at 3326 (offset 26 lines).
Hunk #82 succeeded at 3376 (offset 26 lines).
57 out of 82 hunks FAILED -- saving rejects to file program/js/app.js.rej
patching file config/db.inc.php
Hunk #1 succeeded at 61 with fuzz 2 (offset -2 lines).
patching file program/steps/settings/func.inc
Hunk #1 succeeded at 473 with fuzz 1 (offset 101 lines).
patching file index.php
Hunk #1 succeeded at 197 (offset -5 lines).
patching file program/localization/en_US/labels.inc
Hunk #1 succeeded at 325 with fuzz 2 (offset 23 lines).
patching file program/include/main.inc
patching file config/main.inc.php
Hunk #1 succeeded at 412 with fuzz 2 (offset 35 lines).
patching file program/localization/en_US/messages.inc
Hunk #1 FAILED at 85.
1 out of 1 hunk FAILED -- saving rejects to file program/localization/en_US/messages.inc.rej
patching file program/include/rcube_user.php
Hunk #1 FAILED at 390.
1 out of 1 hunk FAILED -- saving rejects to file program/include/rcube_user.php.rej
patching file skins/default/includes/settingstabs.html
Title: PostfixAdmin bridge
Post by: Shadow aok on May 23, 2009, 04:49:55 AM
wiza, take a look at my previous post.
Quote from: Shadow aok;19054
Try with this app.js file.



Cap0ne > You're missing a session table in your postfix database.
Title: PostfixAdmin bridge
Post by: Shadow aok on May 26, 2009, 06:49:32 AM
Here's app.js patched with rcpfa for RoundCube 0.2.2. :)
Title: PostfixAdmin bridge
Post by: csibo on May 26, 2009, 08:59:53 AM
Quote from: Shadow aok;19208
Here's app.js patched with rcpfa for RoundCube 0.2.2. :)


thanks..
could you fix rcube_user.php.diff patch?
Title: PostfixAdmin bridge
Post by: Shadow aok on May 27, 2009, 03:29:18 AM
Quote from: csibo;19212
thanks..
could you fix rcube_user.php.diff patch?


Yes but not right now, i'm a little busy.
I'll do it in a few days.
Title: PostfixAdmin bridge
Post by: wiza on May 27, 2009, 03:50:56 AM
Following should work

Code: [Select]

--- rcube_user.php.orig 2009-05-27 10:47:11.000000000 +0300
+++ rcube_user.php 2009-05-26 02:40:26.000000000 +0300
@@ -380,7 +380,7 @@
       // also create new identity records
       $standard = 1;
       foreach ($email_list as $email) {
-        $dbh->query(
+/*        $dbh->query(
             &quot;INSERT INTO &quot;.get_table_name('identities').&quot;
               (user_id, del, standard, name, email)
              VALUES (?, 0, ?, ?, ?)&quot;,
@@ -388,7 +388,38 @@
     $standard,
             strip_newlines($user_name),
             preg_replace('/^@/', $user . '@', $email));
- $standard = 0;
+ $standard = 0;*/
+
+ // >> pfa patch
+ if(strip_newlines($user_name)) {
+ $name = strip_newlines($user_name);
+ } elseif($rcmail->config->get('pfa_enable_identity_sync')) {
+ $pfa = new pfa();
+ $name = $pfa->get_name($user);
+ }
+
+        if($rcmail->config->get('pfa_enable_identity_sync')) {
+ $dbh->query(
+ &quot;INSERT INTO &quot;.get_table_name('identities').&quot;
+ (user_id, del, standard, name, organization, email)
+ VALUES (?, 0, ?, ?, ?, ?)&quot;,
+ $user_id,
+ $standard,
+ $name,
+ $rcmail->config->get('pfa_default_organization'),
+ strip_newlines($user_email));
+ $standard=0;
+ } else {
+ // << pfa patch
+ $dbh->query(
+ &quot;INSERT INTO &quot;.get_table_name('identities').&quot;
+ (user_id, del, standard, email, name)
+ VALUES (?, 0, ?, ?, ?)&quot;,
+ $user_id,
+ $standard,
+ strip_newlines($user_email),
+ preg_replace('/^@/', $user . '@', $email));
+ }
       }
     }
     else
Title: PostfixAdmin bridge
Post by: csibo on May 27, 2009, 05:44:36 AM
Quote from: wiza;19228
Following should work



thanks.. it's working for me.. :)

i found two bugs:

1,

if the Vacation settings ON and i change the Forwarding settings (or just i click to the save button): the autoreply forwards setting will be erased.

2,

the settings tab isn't check the pfa_enable_vacation, pfa_enable_password and pfa_enable_forwarding settings.
Title: PostfixAdmin bridge
Post by: wiza on May 28, 2009, 04:08:57 AM
Finnish translations to PFA patch

messages.inc:
Code: [Select]

// >> pfa patch

// Enabling/disabling each function
$messages['vacationdisabled'] = 'Sinulla ei ole oikeuksia vaihtaa lomavastaajan asetuksia.';
$messages['passworddisabled'] = 'Sinulla ei ole oikeuksia vaihtaa salasanaa.';
$messages['forwardingdisabled'] = 'Sinulla ei ole oikeuksia vaihtaa edelleenohjauksen asetuksia.';

// Vacation
$messages['vacationmodified'] = 'Lomavastaajan asetukset tallennettu.';
$messages['novacation'] = 'Lomavastaaja aktivoitu, mutta viesti&auml; ei annettu.';

// Password
$messages['wrong2password'] = 'Antamasi salasanat eivät ole samat';
$messages['wrongoldpassword'] = 'Vanha salasana väärä.';
$messages['tooshortpassword'] = 'Uusi salasana liian lyhyt.';
$messages['passwordmodified'] = 'Salana vaihdettu onnistuneesti.';

// Forwarding
$messages['forwardingmodified'] = 'Edelleenohjausasetukset tallennettu.';
$messages['emptyforwarding'] = 'Ainakin yksi osoite on annettava edelleenohjausta varten.';
$messages['forwardingsyntaxerror'] = 'Ainakin yksi sähköpostiosoite ei ole oikea.';

// << pfa patch


labels.inc:
Code: [Select]
// >> pfa patch

$labels['vacation'] = 'Lomavastaaja';
$labels['titlevacation'] = 'Lomavastaajan asetukset';
$labels['activevacation'] = 'Aktivoi lomavastaaja';
$labels['subjectvacation'] = 'Lomavastaajan otsikko';
$labels['bodyvacation'] = 'Lomavastaajan viesti';

$labels['titlepassword'] = 'Vaihda salasana';
$labels['oldpassword'] = 'Syötä vanha salasana';
$labels['newpassword'] = 'Syötä uusi salasana';
$labels['new2password'] = 'Toista uusi salasana';

$labels['forwarding'] = 'Edelleenohjaus';
$labels['titleforwarding'] = 'Edelleenohjaus toisiin sähköpostiosoitteisiin';
$labels['aliasesforwarding'] = 'Edelleenohjaa postit näihin sähköpostiosoitteisiin (yksi osoite per rivi)';
$labels['localforwardingtrue'] = 'Toimita myös omaan laatikkoon';
$labels['localforwardingfalse'] = 'Toimita vain määriteltyihin osoitteisiin';

// << pfa patch
Title: PostfixAdmin bridge
Post by: Shadow aok on May 29, 2009, 04:05:37 AM
I made another version of rcube_user.php than wiza's one.
Please test it to see if you still have the two bugs.
Title: PostfixAdmin bridge
Post by: csibo on May 29, 2009, 10:39:17 AM
Quote from: Shadow aok;19296
I made another version of rcube_user.php than wiza's one.
Please test it to see if you still have the two bugs.


still have the bugs.

i think the second bug is doesn't matter. just comment out the not necessary functions in skins/default/includes/settingstabs.html...

the first bug:
in the forwarding tab if i click to the save button, it's always remove the autoreply line from the alias table goto field. autoreply line example: user#domain.tld@autoreply.domain.tld
like: peter#domain.com@autoreply.domain.com
Title: PostfixAdmin bridge
Post by: Shadow aok on May 30, 2009, 05:20:39 AM
I'll try to take a look at these two bugs.
Title: Written as a plugin...
Post by: patricktech on June 10, 2009, 05:28:30 PM
This is a great modification, however I am hoping since the next version of RC supports plugins, if this will be written as a plugin in the future so it will be easier to install and support skins etc.

Thanks, Patrick
Title: patch will not work
Post by: Jan_Kruis on August 03, 2009, 07:01:33 PM
Hi ,

I work with the 0.22 svn version but the last two patch ( app.js en rube_user.php) still not make it work.

when ik click on one of the three tab nothing happes

what can be the problem.

Regards Jan Kruis
:confused:
Title: PostfixAdmin bridge
Post by: no1jungleboy on August 23, 2009, 01:14:11 AM
for those of us who are just using the webmail version how do we delete messages from our inbox?
Title: PostfixAdmin bridge
Post by: bitmng on September 13, 2009, 10:52:27 PM
Hi all, i got a problem installing 1.5 version of rcpfa...

First, there are many errors, and i've fixed it manually using app.js and rcube_user.php in attachment on this forum..

Now i got this problem .. When i click on options, there are the three added icons by this plugin, but when i click on forwarding and vacation there is white page... and when i click on password, and i try to change my password, there is a white page too in submit...

Any suggestion?

thanks advanced
Title: PostfixAdmin bridge
Post by: bitmng on September 15, 2009, 08:14:29 PM
nobody got any suggestion?
Title: 0.2.2 version rcpfa-1.0.5 w app.js and rcube_user.php fixed
Post by: marswaco on October 16, 2009, 11:09:11 AM
i'm been working for a while with this patched version, and it worked great or at least that was what i was thinking, till this week when I realized that this version does not create new identities. Since that day, i was rechecking everything that's possible ( with or without sync with pfa; identities access level 0,1,2,and 3; permissions, etc), and redoing the patch process; and for my surprise the patch is the problem; in the original version the identities are created in the table identities and in the patch version not.
Anyone had the same issue? thanks in advance.
Title: PostfixAdmin bridge
Post by: nejko on October 17, 2009, 07:35:11 AM
I am glad to tell you, that one company decided to support the development of RCPFA 1.1, which won't be a patch anymore, but a plugin - so it will work seamlessly with the latest versions of RoundCube. The development just started, so stay tuned.
Title: PostfixAdmin bridge
Post by: marswaco on October 19, 2009, 06:17:12 PM
thanks for the info, glad to read about it; although was stuck with this problem in version 0.2.2, i could solve at least the password change, in version 0.3 with the password plugin and this page info
Roundcube and postfixadmin (http://www.prolin.pl/en/linux/3-roundcube-i-postfixadmin).
Title: PostfixAdmin bridge
Post by: Crupuk on March 29, 2010, 04:48:54 AM
Quote from: nejko;22304
I am glad to tell you, that one company decided to support the development of RCPFA 1.1, which won't be a patch anymore, but a plugin - so it will work seamlessly with the latest versions of RoundCube. The development just started, so stay tuned.


Nejko , no news ?
Title: PostfixAdmin bridge
Post by: nejko on April 02, 2010, 12:08:08 PM
Actually, not really. It didn't work out for me as planned, I had been busy with other things. Sorry. However, I plan to do this eventually. Just don't know when.