[Davical-general] Rép: Export to SquirrelMail address book

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Davical-general] Rép: Export to SquirrelMail address book

webmaster
Can't you make a squirrelmail plugin instead?

It would be better to have always same data. Sure you didn't change everyday contact and a cron job is nice to do that.

If it work il will implement this for sure. ;)

Pander <[hidden email]> a écrit :

>Hi all,
>
>The next couple of days I have some time and would really like to create
>an automated export via cron from my DAViCAL CardDAV account to my
>SquirrelMail account address book. The user story with justification is as
>follows:
>
>"AS a user of SquirrelMail and DAViCal with CardDAV
>I WOULD LIKE TO have an up to date copy of all the contacts with email
>addresses and telehone numbers
>WHEN I use my SquirrelMail address book
>IN ORDER TO have access to my contacts in a situation where I am using
>webmail and do not have access to desktop applications such as Thunderbird
>or mobile applications that have direct access to CardDAV."
>
>So far I have figured out that SquirrelMail address books are stored as a
>file. The path is
>  /var/lib/squirrelmail/data/USERNAME.abook
>with USERNAME your SquirrelMail username which usually in lower case.
>
>The file format is as follows:
>  |Nick|First|Last|Email|Info|
>where
>  Nick: required, unique and no spaces
>  First: optional
>  Last: optional
>  Email: required
>  Info: optional
>
>The export will process all contacts and create an address book entry for
>SquirellMail for each email address and/or telephone number in CardDAV via
>the following pseudocode scheme where all lower case variables are from
>CardDAV, capitalised variables are for SquirrelMail output format. Because
>preferred email and additional email can be switched around for work or
>home according to the client that manages the CardDAV data, I have chosen
>for the following approach for implementation.
>
># initialisation
>Abook = []
>First = ''
>Last = ''
>Nick = ''
>Email = ''
>Info = ''
>
># use Info for all telephone numbers
>first = True
>if mopbtel:
>  if first:
>    first = False
>  else:
>    Info += ' '
>  Info += 'M:'+ mobtel
>if hometel:
>  if first:
>    first = False
>  else:
>    Info += ' '
>  Info += 'H:'+ mobtel
>if worktel:
>  if first:
>    first = False
>  else:
>    Info += ' '
>  Info += 'W:'+ mobtel
>if faxtel:
>  if first:
>    first = False
>  else:
>    Info += ' '
>  Info += 'F:'+ mobtel
>
># entry for preferred email
>if prefemail:
>  Email = prefemail.strip()
>  if first and not last:
>    First = first.strip()
>    Nick = first.strip()
>  if not first and last:
>    Last = last.strip()
>    Nick = last.strip()
>  if first and last:
>    First = first.strip()
>    Last = last.strip()
>    Nick = first.strip().replace(' ','') + last.strip().replace(' ','')
>  else:
>    Nick = Email
>  if Nick in Abook:
>    logWarning
>  else:
>    aBook[Nick] = Nick+'|'+First+'|'+Last+'|'+Email+'|'+Info
>
># entry for other email
>Email = ''
>if addtionalemail:
>  Email = additionalemail.strip()
>  if not first and not last:
>    Nick = Email
>  Nick += 'Add'
>  if Nick in Abook:
>    logWarning
>  else:
>    aBook[Nick] = Nick+'|'+First+'|'+Last+'|'+Email+'|'+Info
>
># write address book
>for a in sorted(aBook.keys()]:
>  write aBook[key]
>
>Would anyone like to help out with this? I need help especially on how to
>iterate over the CardDAV data for a certain user (preferably from Python).
>Who is also in need of this addition to DAViCal?
>
>Regards, Pander
>
>
>------------------------------------------------------------------------------
>Try New Relic Now & We'll Send You this Cool Shirt
>New Relic is the only SaaS-based application performance monitoring service
>that delivers powerful full stack analytics. Optimize and monitor your
>browser, app, & servers with just a few lines of code. Try New Relic
>and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
>_______________________________________________
>Davical-general mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/davical-general
>
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
Davical-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/davical-general
Reply | Threaded
Open this post in threaded view
|

Re: Rép: Export to SquirrelMail address book

Pander
On 04/30/2013 07:40 PM, webmaster wrote:
> Can't you make a squirrelmail plugin instead?
>
> It would be better to have always same data. Sure you didn't change everyday contact and a cron job is nice to do that.
>
> If it work il will implement this for sure. ;)

It works:
  https://github.com/PanderMusubi/davical2abook

Daily cron will do the job of keeping up to date.

> Pander <[hidden email]> a écrit :
>
>> Hi all,
>>
>> The next couple of days I have some time and would really like to create
>> an automated export via cron from my DAViCAL CardDAV account to my
>> SquirrelMail account address book. The user story with justification is as
>> follows:
>>
>> "AS a user of SquirrelMail and DAViCal with CardDAV
>> I WOULD LIKE TO have an up to date copy of all the contacts with email
>> addresses and telehone numbers
>> WHEN I use my SquirrelMail address book
>> IN ORDER TO have access to my contacts in a situation where I am using
>> webmail and do not have access to desktop applications such as Thunderbird
>> or mobile applications that have direct access to CardDAV."
>>
>> So far I have figured out that SquirrelMail address books are stored as a
>> file. The path is
>>  /var/lib/squirrelmail/data/USERNAME.abook
>> with USERNAME your SquirrelMail username which usually in lower case.
>>
>> The file format is as follows:
>>  |Nick|First|Last|Email|Info|
>> where
>>  Nick: required, unique and no spaces
>>  First: optional
>>  Last: optional
>>  Email: required
>>  Info: optional
>>
>> The export will process all contacts and create an address book entry for
>> SquirellMail for each email address and/or telephone number in CardDAV via
>> the following pseudocode scheme where all lower case variables are from
>> CardDAV, capitalised variables are for SquirrelMail output format. Because
>> preferred email and additional email can be switched around for work or
>> home according to the client that manages the CardDAV data, I have chosen
>> for the following approach for implementation.
>>
>> # initialisation
>> Abook = []
>> First = ''
>> Last = ''
>> Nick = ''
>> Email = ''
>> Info = ''
>>
>> # use Info for all telephone numbers
>> first = True
>> if mopbtel:
>>  if first:
>>    first = False
>>  else:
>>    Info += ' '
>>  Info += 'M:'+ mobtel
>> if hometel:
>>  if first:
>>    first = False
>>  else:
>>    Info += ' '
>>  Info += 'H:'+ mobtel
>> if worktel:
>>  if first:
>>    first = False
>>  else:
>>    Info += ' '
>>  Info += 'W:'+ mobtel
>> if faxtel:
>>  if first:
>>    first = False
>>  else:
>>    Info += ' '
>>  Info += 'F:'+ mobtel
>>
>> # entry for preferred email
>> if prefemail:
>>  Email = prefemail.strip()
>>  if first and not last:
>>    First = first.strip()
>>    Nick = first.strip()
>>  if not first and last:
>>    Last = last.strip()
>>    Nick = last.strip()
>>  if first and last:
>>    First = first.strip()
>>    Last = last.strip()
>>    Nick = first.strip().replace(' ','') + last.strip().replace(' ','')
>>  else:
>>    Nick = Email
>>  if Nick in Abook:
>>    logWarning
>>  else:
>>    aBook[Nick] = Nick+'|'+First+'|'+Last+'|'+Email+'|'+Info
>>
>> # entry for other email
>> Email = ''
>> if addtionalemail:
>>  Email = additionalemail.strip()
>>  if not first and not last:
>>    Nick = Email
>>  Nick += 'Add'
>>  if Nick in Abook:
>>    logWarning
>>  else:
>>    aBook[Nick] = Nick+'|'+First+'|'+Last+'|'+Email+'|'+Info
>>
>> # write address book
>> for a in sorted(aBook.keys()]:
>>  write aBook[key]
>>
>> Would anyone like to help out with this? I need help especially on how to
>> iterate over the CardDAV data for a certain user (preferably from Python).
>> Who is also in need of this addition to DAViCal?
>>
>> Regards, Pander
>>
>>
>> ------------------------------------------------------------------------------
>> Try New Relic Now & We'll Send You this Cool Shirt
>> New Relic is the only SaaS-based application performance monitoring service
>> that delivers powerful full stack analytics. Optimize and monitor your
>> browser, app, & servers with just a few lines of code. Try New Relic
>> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
>> _______________________________________________
>> Davical-general mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/davical-general
>>


------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
Davical-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/davical-general
Reply | Threaded
Open this post in threaded view
|

Re: Export to SquirrelMail address book

Narcis Garcia - GiLUG
In reply to this post by webmaster
It's a good idea.
A SquirrelMail plugin (written in PHP) could act as CardDAV client, and
then the contacts could be both retrieved and uploaded from and to the
CardDAV server.

To develop this, I wish to have some guidelines about interacting with
CardDAV server through HTTP.

A CardDAV plugin for SquirrelMail could give a jump forward SqM.


El 30/04/13 20:46, Pander ha escrit:

> On 04/30/2013 07:40 PM, webmaster wrote:
>> Can't you make a squirrelmail plugin instead?
>>
>> It would be better to have always same data. Sure you didn't change everyday contact and a cron job is nice to do that.
>>
>> If it work il will implement this for sure. ;)
>
> It works:
>   https://github.com/PanderMusubi/davical2abook
>
> Daily cron will do the job of keeping up to date.
>
>> Pander <[hidden email]> a écrit :
>>
>>> Hi all,
>>>
>>> The next couple of days I have some time and would really like to create
>>> an automated export via cron from my DAViCAL CardDAV account to my
>>> SquirrelMail account address book. The user story with justification is as
>>> follows:
>>>
>>> "AS a user of SquirrelMail and DAViCal with CardDAV
>>> I WOULD LIKE TO have an up to date copy of all the contacts with email
>>> addresses and telehone numbers
>>> WHEN I use my SquirrelMail address book
>>> IN ORDER TO have access to my contacts in a situation where I am using
>>> webmail and do not have access to desktop applications such as Thunderbird
>>> or mobile applications that have direct access to CardDAV."
>>>
>>> So far I have figured out that SquirrelMail address books are stored as a
>>> file. The path is
>>>  /var/lib/squirrelmail/data/USERNAME.abook
>>> with USERNAME your SquirrelMail username which usually in lower case.
>>>
>>> The file format is as follows:
>>>  |Nick|First|Last|Email|Info|
>>> where
>>>  Nick: required, unique and no spaces
>>>  First: optional
>>>  Last: optional
>>>  Email: required
>>>  Info: optional
>>>
>>> The export will process all contacts and create an address book entry for
>>> SquirellMail for each email address and/or telephone number in CardDAV via
>>> the following pseudocode scheme where all lower case variables are from
>>> CardDAV, capitalised variables are for SquirrelMail output format. Because
>>> preferred email and additional email can be switched around for work or
>>> home according to the client that manages the CardDAV data, I have chosen
>>> for the following approach for implementation.
>>>
>>> # initialisation
>>> Abook = []
>>> First = ''
>>> Last = ''
>>> Nick = ''
>>> Email = ''
>>> Info = ''
>>>
>>> # use Info for all telephone numbers
>>> first = True
>>> if mopbtel:
>>>  if first:
>>>    first = False
>>>  else:
>>>    Info += ' '
>>>  Info += 'M:'+ mobtel
>>> if hometel:
>>>  if first:
>>>    first = False
>>>  else:
>>>    Info += ' '
>>>  Info += 'H:'+ mobtel
>>> if worktel:
>>>  if first:
>>>    first = False
>>>  else:
>>>    Info += ' '
>>>  Info += 'W:'+ mobtel
>>> if faxtel:
>>>  if first:
>>>    first = False
>>>  else:
>>>    Info += ' '
>>>  Info += 'F:'+ mobtel
>>>
>>> # entry for preferred email
>>> if prefemail:
>>>  Email = prefemail.strip()
>>>  if first and not last:
>>>    First = first.strip()
>>>    Nick = first.strip()
>>>  if not first and last:
>>>    Last = last.strip()
>>>    Nick = last.strip()
>>>  if first and last:
>>>    First = first.strip()
>>>    Last = last.strip()
>>>    Nick = first.strip().replace(' ','') + last.strip().replace(' ','')
>>>  else:
>>>    Nick = Email
>>>  if Nick in Abook:
>>>    logWarning
>>>  else:
>>>    aBook[Nick] = Nick+'|'+First+'|'+Last+'|'+Email+'|'+Info
>>>
>>> # entry for other email
>>> Email = ''
>>> if addtionalemail:
>>>  Email = additionalemail.strip()
>>>  if not first and not last:
>>>    Nick = Email
>>>  Nick += 'Add'
>>>  if Nick in Abook:
>>>    logWarning
>>>  else:
>>>    aBook[Nick] = Nick+'|'+First+'|'+Last+'|'+Email+'|'+Info
>>>
>>> # write address book
>>> for a in sorted(aBook.keys()]:
>>>  write aBook[key]
>>>
>>> Would anyone like to help out with this? I need help especially on how to
>>> iterate over the CardDAV data for a certain user (preferably from Python).
>>> Who is also in need of this addition to DAViCal?
>>>
>>> Regards, Pander
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Try New Relic Now & We'll Send You this Cool Shirt
>>> New Relic is the only SaaS-based application performance monitoring service
>>> that delivers powerful full stack analytics. Optimize and monitor your
>>> browser, app, & servers with just a few lines of code. Try New Relic
>>> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
>>> _______________________________________________
>>> Davical-general mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/davical-general
>>>
>
>
> ------------------------------------------------------------------------------
> Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
> Get 100% visibility into your production application - at no cost.
> Code-level diagnostics for performance bottlenecks with <2% overhead
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap1
> _______________________________________________
> Davical-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/davical-general
>

------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Davical-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/davical-general