Koozali.org: home of the SME Server

[SOLVED]Thunderbird Auto Configuration - wiki page

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
[SOLVED]Thunderbird Auto Configuration - wiki page
« on: December 16, 2013, 11:08:36 AM »
I just created a wiki page to document how allow Thunderbird autoconfiguration for anyone:

http://wiki.contribs.org/Thunderbird_Auto_Config

This allow small companies to create an Auto Configuration file for Thunderbird, just like thunderbird has to big ISP.
So you just have to answer those famous 3 questions: username, password and e-mail and get Thunderbird configurated.

Enjoy!
Jáder
...

Offline stephdl

  • *
  • 1,519
  • +0/-0
    • Linux et Geekeries
Re: [SOLVED]Thunderbird Auto Configuration - wiki page
« Reply #1 on: December 16, 2013, 11:58:23 AM »
jader good work however you should add all details on how to use it and how customise it.
thanks
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: [SOLVED]Thunderbird Auto Configuration - wiki page
« Reply #2 on: December 17, 2013, 12:08:57 PM »
I'll try to be more clear about it.
Would be nice if someone ask questions about it... so I can understand what info is missing.
The config appears to be obvious to me... just because I spent hours/ days /  months to get it working. :)
Regards

Jáder
...

Offline stephdl

  • *
  • 1,519
  • +0/-0
    • Linux et Geekeries
Re: [SOLVED]Thunderbird Auto Configuration - wiki page
« Reply #3 on: December 17, 2013, 08:23:05 PM »
simply details all steps of what you are explaining...this is an example http://wiki.contribs.org/Thunderbird_Push_Install

quick questions
where put the folder mail, in an ibay, the primary ?, a special created for the occasion.
what are permissions of this ibay
highlight variable to change in you example.
give some url to other documentation if you do not want to details more informations.
...and so long
if you are not at ease with the wiki formatting, i will do after you have done the job.

See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: [SOLVED]Thunderbird Auto Configuration - wiki page
« Reply #4 on: December 18, 2013, 05:38:13 PM »
I would ask Jader to think about templating the xml file..
I mean, it would be interesting to have this file created (and filled) for every domain we will host on SME.. alternatively, we could think about a db variable to make it optional (think about .local/.lan domains)

thank you
« Last Edit: December 19, 2013, 12:38:41 PM by Stefano »

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: [SOLVED]Thunderbird Auto Configuration - wiki page
« Reply #5 on: December 19, 2013, 12:36:10 PM »
I'll update the wiki page to show what to change.
And think about templating it.

Thanks so far for your tips.
Jáder
...

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: [SOLVED]Thunderbird Auto Configuration - wiki page
« Reply #6 on: December 19, 2013, 04:38:34 PM »
I created more detailed instructions on wiki page.
Please verify if this is enough to you understand and use it.

I need some help about templating.
I´m creating the fragment below... but it output his exact text... so I´m missing two things:
1) how go get the CompanyName as defined on LDAP (using a cut on fragment below)
2) how to get OUT part of template only when expanded.

This is the content of custom fragment:

Code: [Select]
# Prepare to access configuration databases
 my $db = esmith::ConfigDB->open_ro
     or die "Couldn't open ConfigDB\n";

# Read domain name from configuration database

my $COMPANY-NAME = system ('config show ldap|grep defaultCompany|cut -d"=" -f2`');
my $DOMAIN-NAME = $db->get_value('DomainName');

{
    $OUT .= '

<?xml version="1.0" encoding="UTF-8"?>
<clientConfig version="1.1">
  <emailProvider id="$DOMAIN-NAME">
    <domain>$DOMAIN-NAME</domain>
    <displayName>$COMPANY-NAME</displayName>
    <displayShortName>$COMPANY-NAME</displayShortName>
    <incomingServer type="imap">
      <hostname>mail.$DOMAIN-NAME</hostname>
      <port>993</port>
      <socketType>SSL</socketType>
      <authentication>password-cleartext</authentication>
      <username>%EMAILLOCALPART%</username>
    </incomingServer>
   <outgoingServer type="smtp">
     <hostname>mail.$DOMAIN-NAME</hostname>
     <port>465</port>
     <socketType>SSL</socketType>
     <authentication>password-cleartext</authentication>
     <username>%EMAILLOCALPART%</username>
   </outgoingServer>
   <documentation url="http://kundenservice.freenet.de/hilfe/email/programme/config/index.html">
     <descr lang="pt-br">Págna de configuracoes Generica</descr>
     <descr lang="en">Generic settings page</descr>
   </documentation>
   <documentation url="http://kundenservice.freenet.de/hilfe/email/programme/config/thunderbird/imap-thunderbird/imap/index.html">
     <descr lang="pt-br">Configuracoes do Thunderbird ESR para IMAP</descr>
     <descr lang="en">Thunderbird ESR IMAP settings</descr>
   </documentation>
 </emailProvider>
</clientConfig>

';

}

exit 0;


...

Offline stephdl

  • *
  • 1,519
  • +0/-0
    • Linux et Geekeries
Re: [SOLVED]Thunderbird Auto Configuration - wiki page
« Reply #7 on: December 20, 2013, 04:39:18 PM »
i do not have exactly the solution, take some minutes to go to /etc/e-smith/templates/ and to look how templates are made.

one easy example of what you want to do is http://wiki.contribs.org/Web_Application_RPM. Of course it is not the solution, but it is close.

some other ideas to explore

http://wiki.contribs.org/SME_Server:Documentation:Developers_Manual#Configuration_file_templates
http://wiki.contribs.org/Text::Template
http://wiki.contribs.org/Esmith::templates

Never give up Jader, try, search, again and again.
« Last Edit: December 20, 2013, 05:43:38 PM by stephdl »
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: [SOLVED]Thunderbird Auto Configuration - wiki page
« Reply #8 on: December 20, 2013, 06:20:21 PM »
# Prepare to access configuration databases
 my $db = esmith::ConfigDB->open_ro
     or die "Couldn't open ConfigDB\n";

You don't need to do that inside templates - the config db records are already available as ordinary perl variables. Please read the developers guide again.

Quote
my $COMPANY-NAME = system ('config show ldap|grep defaultCompany|cut -d"=" -f2`');

All you need is:

Code: [Select]
my $COMPANY_NAME = $ldap{defaultCompany};

Note that $COMPANY-NAME is not a valid variable name - that is the variable $COMPANY minus the bareword NAME. That will generate a perl error.

Quote
my $DOMAIN-NAME = $db->get_value('DomainName');

You have the same problem with the variable name here. You can't use hyphen in a variable name.

You also can just use $DomainName here anyway, where you use $DOMAIN-NAME.

Quote
{
    $OUT .= '
...

If you use single quotes - ' - then perl variables won't be interpolated into the output string - so you will have literal $DOMAIN-NAME rather than the value of the $DomainName variable.

I'd suggest you find some good basic perl tutorials on line and read them carefully multiple times.

Offline stephdl

  • *
  • 1,519
  • +0/-0
    • Linux et Geekeries
Re: [SOLVED]Thunderbird Auto Configuration - wiki page
« Reply #9 on: December 20, 2013, 06:57:20 PM »
I'd suggest you find some good basic perl tutorials on line and read them carefully multiple times.
Give back url of perl tutorials, i need too :)
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: [SOLVED]Thunderbird Auto Configuration - wiki page
« Reply #10 on: December 20, 2013, 09:30:47 PM »
Give back url of perl tutorials...

Why should I do that, when somebody else is better qualified?

http://lmgtfy.com/?q=perl+tutorial

Offline stephdl

  • *
  • 1,519
  • +0/-0
    • Linux et Geekeries
Re: [SOLVED]Thunderbird Auto Configuration - wiki page
« Reply #11 on: December 20, 2013, 11:48:57 PM »
:)
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline stephdl

  • *
  • 1,519
  • +0/-0
    • Linux et Geekeries
Re: [SOLVED]Thunderbird Auto Configuration - wiki page
« Reply #12 on: December 20, 2013, 11:50:41 PM »
i have on my todo List, to get in the developer area some tutorials on perl...but i need time or more people involved in this topic :)
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: [SOLVED]Thunderbird Auto Configuration - wiki page
« Reply #13 on: December 21, 2013, 03:24:38 PM »
I think it's done... I'll test it in a few minutes and update wiki page.
this is the fragment of template. Thanks to everyone by help me to how to learn!

Code: [Select]

[root@leopardo ~]# cat /etc/e-smith/templates-custom/home/e-smith/files/ibays/Primary/html/mail/config-v1.1.xml/Thunderbird
{
my $COMPANYNAME = $ldap{defaultCompany};
my $DOMAINNAME = $DomainName;

    $OUT .=<<FIM

<?xml version="1.0" encoding="UTF-8"?>
<clientConfig version="1.1">
  <emailProvider id="$DOMAINNAME">
    <domain>$DOMAINNAME</domain>
    <displayName>$COMPANYNAME</displayName>
    <displayShortName>$COMPANYNAME</displayShortName>
    <incomingServer type="imap">
      <hostname>mail.$DOMAINNAME</hostname>
      <port>993</port>
      <socketType>SSL</socketType>
      <authentication>password-cleartext</authentication>
      <username>%EMAILLOCALPART%</username>   
    </incomingServer>
   <outgoingServer type="smtp">
     <hostname>mail.$DOMAINNAME</hostname>
     <port>465</port>
     <socketType>SSL</socketType>
     <authentication>password-cleartext</authentication>
     <username>%EMAILLOCALPART%</username>
   </outgoingServer>
   <documentation url="http://kundenservice.freenet.de/hilfe/email/programme/config/index.html">
     <descr lang="pt-br">Páina de configuracoes Generica</descr>
     <descr lang="en">Generic settings page</descr>
   </documentation>
   <documentation url="http://kundenservice.freenet.de/hilfe/email/programme/config/thunderbird/imap-thunderbird/imap/index.html">
     <descr lang="pt-br">Configuracoes do Thunderbird ESR para IMAP</descr>
     <descr lang="en">Thunderbird ESR IMAP settings</descr>
   </documentation>
 </emailProvider>
</clientConfig>

FIM
}
...