Roundcube Community Forum

Third Party Contributions => Old Style Plug-Ins => Topic started by: ZabbensX on January 23, 2008, 07:44:04 AM

Title: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: ZabbensX on January 23, 2008, 07:44:04 AM
Hi @ all,

i had developt the Forwad Tab and the Vacation Assistant Tab,
there is also a Password Change Tab i dont know exactly how did the work,
but thanks so far :)

In the Attachment there are the Files for all 3 Tabs,
to run the Password Change Tab both Databases have to be on one sql Server
You have to set the Permissions right ;)
In the passwd.inc you have to set up the right Database in the SQL Statement.

The Vacation and Forward Tab uses the COM interface from the hmailserver,
so you have to enable com in you php.ini

In the fwd.inc and the away.inc you have to set the adminpassword of the hmailserver,
and the host where hmailserver is running, mostly localhost...
The setting have to be done twice in each file.

I give no WARANTY on the Patch, so make a backup of your webmail Folder.
If you have some Questions, write in this Thread, so anyone can profit.

Greetings

ZX
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: Thunderstorm on January 23, 2008, 08:30:01 PM
Hiya

Awesome thank you, added some functions to my clients for hmail :)
Just to let you know on the password page the text area labels are set for

"curpasswd" "conpasswd" etc

I change mine to read "Current Password" etc etc

anyway perfect after setting up and testing :)

Thank you
Peter
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: MacOfTheEast on January 24, 2008, 06:25:52 AM
Quote from: ZabbensX
The Vacation and Forward Tab uses the COM interface from the hmailserver,
so you have to enable com in you php.ini
Too bad, then, as the php com extensions are only available to winDOZE users :'(

MOTE
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: ZabbensX on January 24, 2008, 10:54:08 AM
Try it with SQL instead of the COM System...

When there is a SQL Databse it might work so?

Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: ZabbensX on January 24, 2008, 11:09:17 AM
Quote from: Thunderstorm
Hiya

Awesome thank you, added some functions to my clients for hmail :)
Just to let you know on the password page the text area labels are set for

"curpasswd" "conpasswd" etc

I change mine to read "Current Password" etc etc

anyway perfect after setting up and testing :)

Thank you
Peter

I put the wrong label / messages files in the Archiv, sorry ???
I replaced the Files and uploaded them again, now it should be fine...

Greetings

ZX
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: ajn on February 03, 2008, 03:36:02 PM
Thank you! Works just perfect! ;)
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: rosali on February 06, 2008, 12:06:59 PM
I'm wondering why you don't just include PHPWebAdmin. It is shipped with hMailServer and it has all the features you have coded new and much more.

In addition it is possible to run PHPWebAdmin on a separate host. If you use the code here, you must run RoundCube on the (Windows)Box where hMailServer resides.

If someone is interested in how I have integrated PHPWebAdmin into RoundCube (Tab in Personal Settings, inherit Authentication, suitable styling), just drop a note here or contact me via Private Message.

Please no mis-understanding, no critics for the great job here!

-Roland
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: jbaitz on February 21, 2008, 09:00:25 AM
Roland,

I would be interested in the steps you took to integrate PHPWebAdmin into RC for Hmail.  We are currently testing a new mailsetup and would like to see what options this gives us.

Thanks

Justin
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: rosali on February 28, 2008, 12:47:50 PM
@ jbaitz and joe.davis (mailed me via PM)

I do not have an instruction just for hmailserver PHPWebAdmin integration because I made a lot of changes ...

You can download the whole stuff @ http://liebl.ath.cx/dl/hMailServer/

Please consider that you have to modify the database structure as adviced in myroundcube_screenies.doc.

Key features of my modified RoundCube are:

* Sign up Users (CAPTCHA support) by web
* IDNA Domains/Users
* Password Tools
* Spam Filter Interface, Report Ham/Spam messages
* PHPWebadmin integration
* Google Ads support
* GoogieSpell Tunnel
* Advanced Addressbook
* Disallow spoofing Identies
* Lockout Tool for too many invalid logins or hack attempts
* Message Flags, Select Range, Invert Selection
* maybe there is more ...

... all the stuff is customizable by the config files.

NOTICE: Totally beta stuff, but productive on my site since 2 weeks without major issues.

-Roland
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: giuseppe on February 28, 2008, 03:54:49 PM
I have compiled a sql script to make necessary database modifications for these plug-ins.

Code: [Select]
CREATE TABLE `accesscontrol` (
`id` int(10) unsigned,
`ip` varchar(15),
`host` varchar(128),
`sess_id` varchar(40),
`user_id` int(10),
`username` varchar(128),
`datetime` datetime,
`task` varchar(128),
`action` varchar(128),
`status` int(1),
`totalhits` int(10),
`hitslastmin` int(10),
`invalid_login` int(10)
);
ALTER TABLE `contacts` ADD `type` int(1);
ALTER TABLE `contacts` ADD `address` varchar(128);
ALTER TABLE `contacts` ADD `academic_title` varchar(128);
ALTER TABLE `contacts` ADD `nickname` varchar(128);
ALTER TABLE `contacts` ADD `email_2` varchar(128);
ALTER TABLE `contacts` ADD `email_3` varchar(128);
ALTER TABLE `contacts` ADD `street` varchar(128);
ALTER TABLE `contacts` ADD `number` varchar(128);
ALTER TABLE `contacts` ADD `zip` varchar(128);
ALTER TABLE `contacts` ADD `city` varchar(128);
ALTER TABLE `contacts` ADD `state` varchar(128);
ALTER TABLE `contacts` ADD `country_code` varchar(128);
ALTER TABLE `contacts` ADD `phone` varchar(128);
ALTER TABLE `contacts` ADD `fax` varchar(128);
ALTER TABLE `contacts` ADD `mobile` varchar(128);
ALTER TABLE `contacts` ADD `birthday` varchar(10);
ALTER TABLE `contacts` ADD `anniversary` varchar(10);
ALTER TABLE `contacts` ADD `gender` int(1);
ALTER TABLE `contacts` ADD `additional_information` longtext;
ALTER TABLE `identities` ADD `password` text;
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: rosali on March 01, 2008, 02:01:21 AM
Thanks for the DB update code.

Did the stuff work for you? If you are a PHP coder, are you interested in joining MyRoundCube project?

-Roland

Quote
Quote from: ZabbensX on January 23, 2008, 01:44:04 pm
The Vacation and Forward Tab uses the COM interface from the hmailserver,
so you have to enable com in you php.ini
Too bad, then, as the php com extensions are only available to winDOZE users

P.S.: You can run the Remote Administration section (Folder PHPWebadmin) on the host where hMailServer resides. RoundCube can run on a different host. So my modifications will still work for Linux RC setups because I do not use the Windows hMailServer COM API.
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: giuseppe on March 01, 2008, 05:45:35 PM
Yep, the code worked for me except the email verification. When I click on the "Verify now" button, an error stating "Failed to send message" appears at the top of the page. I checked the rc logs but couldn't find a full description of the error.

I am not much of a PHP developer. My PHP knowledge doesn't go much further than tweaking code. I would be more than happy to help you test and tweak the features of your project. I can also help with documentation.

Thanks,
Joe
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: rosali on March 02, 2008, 02:21:58 AM
I'm going to fly to Tenerife ... I'll contact you as soon as I'm back. I hate documentation and would be glad if you help.

Regarding the error:

Make sure that you have defined an appropriate user/password in the config file!

-Roland
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: kevinb on March 02, 2008, 02:35:36 PM
Just downloaded Roland's mods and installed and ran the update script posted for the DB structure, however when I run RC, after logging in properly, it displays tons of error messages on the screen, all pertaining to inserting message information, ie: to address, from address, subject, etc, into a table in the RC database called "messages", however I do not have that in my DB and the update script posted does not create or reference that table either. Does anyone have the layout for it so I can see if that fixes my problem? TIA all.

Kevin
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: rosali on March 04, 2008, 12:07:32 PM
Kevin,

Greetings from Tenerife :) Are you sure to have RC DB structure from RC2 ?

I have modified these tables:

* identities (new col password)
* accesscontrol (completely new)
* contacts (a lot of new cols)

Table messages was not modified ...

-Roland
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: kevinb on March 04, 2008, 12:41:27 PM
Hey Rol, hope you're enjoying Tenerife. I'm not sure I have RC2. I'll check their site. I actually installed it a few months back so I may not. Thanks! I'll let you know how I make out.

Kev
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: Greta on March 07, 2008, 01:00:44 PM
Hi Roland,

Why do I have to set database connections for the hmail database in the db.inc.php?

Greta
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: rosali on March 08, 2008, 04:39:57 AM
e.g. for the new user sign up ...

-Roland
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: Greta on March 09, 2008, 05:54:43 AM
Ok, but when you change anything in the hmail database directly you also need to restart hmail to apply this changes. To make changes to hmail you should use DCOM. (see also http://www.hmailserver.com/forum/viewtopic.php?p=35125#35125 about this).
Version 5 of hmail it is possible to do this directly into the database. Only version 5 is at this stage only an alpha version.

Greta.
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: rosali on March 10, 2008, 04:57:11 AM
Adding users works without re-starting hmail 4.x. I don´t use DCOM because I like to have RoundCube on a different [linux] host and not on the winbox where hmail resides.

-Roland
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: Greta on March 10, 2008, 06:35:25 AM
Ok, thanks for your answer. I shall try to get this also working.
Title: Re: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: torias on March 30, 2008, 07:29:23 PM
Quote from: ZabbensX
In the fwd.inc and the away.inc you have to set the adminpassword of the hmailserver,
and the host where hmailserver is running, mostly localhost...
The setting have to be done twice in each file.

Well ... NO! The COM-Interface allows to change these values with normal user-rights, just change the COM-Init from
Code: [Select]
 $hCOMApp->Authenticate("Administrator", $admpasshmail);
to this
Code: [Select]

  $hCOMApp->Authenticate($_SESSION['username'], decrypt_passwd($_SESSION['password']));
This will use the logged on users credentials as it should be.

You could also optimize more by using this
Code: [Select]
 $obAccount = $hCOMApp->Authenticate($_SESSION['username'], decrypt_passwd($_SESSION['password']));
and drop the later $obAccount = .... and all that $domain and $obDomain stuff since you're not using it either

And last but not least for full COM-usage, change the rcmail_save_passwd function
Code: [Select]
function rcmail_save_passwd($curpasswd, $newpasswd)
{
 global $CONFIG, $_SESSION, $DB;

  //COM Objekt erstellen
  $hCOMApp = new COM("hMailServer.Application");
  $obAccount = $hCOMApp->Authenticate($_SESSION['username'], decrypt_passwd($_SESSION['password']));
   
  if ($obAccount->ValidatePassword($curpasswd)) {
    $obAccount->Password = $newpasswd;
    $obAccount->Save();
    $_SESSION['password'] = encrypt_passwd($newpasswd);
    return(1);
  }
}
Title: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: SimonSez07 on June 06, 2008, 07:03:35 PM
thanks for your updates torias

EDIT: i have updated ZabbensX's patched files so they work properly with the latest stable roundcube (0.1.1) and i have included torias's method of using com.

you can grab my patch here: http://www.sturmer.org/download/1437/hmail-roundcube.zip

Edit (2008.08.30): updated Link
Edit (2009.06.21): added new version for RC 0.2.2 (see later post)
Title: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: cjs on July 10, 2008, 10:16:51 AM
Ok, thank you very much!
Title: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: rosali on August 02, 2008, 03:03:38 AM
http://www.roundcubeforum.net/showthread.php?t=3131&highlight=hmailserver
Title: umlauts passwd function
Post by: webneo82 on August 04, 2008, 12:31:33 PM
hello,

I have found a bug in passwd function:

If the user has a password with umlauts (like ä,ö,ü) the passwd form can't handle this and response with error saving new password.

Could anybody solve that?

Many thanks!
Title: Vacation Assistent, Forward Tab, Password Tab - hMailserver
Post by: desiredforsome on February 10, 2009, 09:48:57 PM
I cannot get any of this working, I need to get these tabs working

Im running MYSQL, what do i change to make this work as well as,,, if i have to enable COM what file and where is it usualy located to edit? Im new to this hackign thing.
Title: New Version
Post by: SimonSez07 on June 22, 2009, 12:41:18 AM
Here is the plugin that has been modified for RoundCube v0.2.2.

http://www.sturmer.org/download/1478/rc-hmail_(0.2.2).zip

@webneo82: I have not looked into this bug, but I will see if anything can be done.

@desiredforsome: there is many things that can be wrong with your installation including com access not working. see the hmailserver docs for enabling com and permissions related to iis.