RE: [SOGo] Help to setup autoconfig and autodiscover

2022-01-10 Thread Kai-Uwe Rommel - ARS
Hello Philippe,
what I posted here was just my setup except that I replaced my domain/server 
names
with your generic sample name. You will need to debug this now yourself in your 
environment.
Perhaps you overlooked something (such as necessary name change).
I had collected all this from various sources on the Internet a couple of years 
ago,
there was no single source. Therefore I thought I could post that all together 
here.
I can confirm that the setup still works fine for auto configuring Thunderbird 
from my server.

Kai-Uwe Rommel

From: users-requ...@sogo.nu  On Behalf Of HYVERNAT 
Philippe
Sent: Monday, January 10, 2022 10:12 AM
To: Kai-Uwe Rommel - ARS (kai-uwe.rom...@ars.de) 
Subject: Re: [SOGo] Help to setup autoconfig and autodiscover


Hello,

Thanks a lot for your details

so i try only with thunderbird,

i created an host autoconfig.domain.com and put the file 
www/mail/config-v1.1.xml

i can access with my browser to port 80  
http://autoconfig.domain.com/mail/config-v1.1.xml

When i try to create an account to thunderbird. in my firewall i can see the 
access, and everything is ok but Thunderbird say that config is not found ???

i have Apache24 php81.

Shall i activate xml on the server ? and how ?

Thanks a lot

ARS Computer und Consulting GmbH, www.ars.de
ein Unternehmen der TIMETOACT Group
Garmischer Straße 7, 80339 München, Deutschland

ARS - The Art of Software Engineering
Software Engineering, Technologieberatung, IBM Software, IBM Lizenzmanagement 
Services

Handelsregister München, HRB 101829, USt-ID: DE 155 068 909
Geschäftsführer: Joachim Gucker, Stefan Schäffer, Michael Arbesmeier
Datenschutzerklärung: https://web.ars.de/datenschutz/
-- 
users@sogo.nu
https://inverse.ca/sogo/lists

Re: [SOGo] Help to setup autoconfig and autodiscover

2022-01-10 Thread HYVERNAT Philippe

Hello,

Thanks a lot for your details

so i try only with thunderbird,

i created an host autoconfig.domain.com and put the file 
www/mail/config-v1.1.xml


i can access with my browser to port 80 
http://autoconfig.domain.com/mail/config-v1.1.xml



When i try to create an account to thunderbird. in my firewall i can see 
the access, and everything is ok but Thunderbird say that config is not 
found ???


i have Apache24 php81.

Shall i activate xml on the server ? and how ?

Thanks a lot


Le 06/01/2022 à 22:14, Kai-Uwe Rommel - ARS (kai-uwe.rom...@ars.de) a 
écrit :


First, you need to set up DNS for your domain:

  * CNAME of autoconfig for your web server
  * CNAME of autodiscover for your web server
  * SRV record of _autodiscover._tcp

So it should look like:

_autodiscover._tcp SRV  10 0 443 webmail.domain.com.

autoconfig CNAME webmail.domain.com.

autodiscover CNAME webmail.domain.com.

On the web server you then need

  * enable PHP
  * a couple of aliases:

Alias /autodiscover/autodiscover.xml "/var/www/html/autodiscover.php"

Alias /Autodiscover/Autodiscover.xml "/var/www/html/autodiscover.php"

Alias /AutoDiscover/AutoDiscover.xml "/var/www/html/autodiscover.php"

Alias /ios "/var/www/html/mailsetup.php"

  * then those autodiscover.php and mailsetup.php files
  * and this mail/config-v1.1.xml:





    

    domain.com

    eMail @ domain.com 

domain.com

    

    webmail.domain.com

    993

SSL

password-cleartext

%EMAILLOCALPART%

    

    

    webmail.domain.com

    465

SSL

password-cleartext

%EMAILLOCALPART%

    

    https://webmail.domain.com 
>


    WebMail-Interface zu domain.com

    WebMail interface for domain.com

    

    



The autodiscover.php is a bit lengthy:

http://technet.microsoft.com/en-us/library/cc511507.aspx

// Get contents of request made to Autodiscover.

$request = file_get_contents("php://input");

preg_match("/\(.*?)\<\/EMailAddress\>/", $request, 
$email_address);


preg_match("/\(.*?)@(.*?)\<\/EMailAddress\>/", 
$request, $email_name);


/*** Begin Configuration ***/

// ActiveSync URL.

$_CONFIG['MobileSync']['Url'] = 
https://webmail.domain.com/Microsoft-Server-ActiveSync;


// IMAP configuration settings.

$_CONFIG['IMAP']['Server'] = "webmail.domain.com";

$_CONFIG['IMAP']['Port'] = "993";

$_CONFIG['IMAP']['SSL'] = "on";

$_CONFIG['IMAP']['SPA'] = "off";

$_CONFIG['IMAP']['AuthRequired'] = "on";

$_CONFIG['IMAP']['DomainRequired'] = "off";

$_CONFIG['IMAP']['LoginName'] = $email_name[1];

// SMTP configuration settings.

$_CONFIG['SMTP']['Server'] = "webmail.domain.com";

$_CONFIG['SMTP']['Port'] = "465";

$_CONFIG['SMTP']['SSL'] = "on";

$_CONFIG['SMTP']['SPA'] = "off";

$_CONFIG['SMTP']['AuthRequired'] = "on";

$_CONFIG['SMTP']['DomainRequired'] = "off";

$_CONFIG['SMTP']['LoginName'] = $email_name[1];

/*** End Configuration ***/

// XML document heading.

header("Content-Type: text/xml");

echo "\n";

// Get the schema from the request.

preg_match("/\(.*?)\<\/AcceptableResponseSchema\>/", 
$request, $schema);


// Determine the type of device requesting Autodiscover.

if (preg_match("/\/mobilesync\//", $schema[1]))

{

    // Mobile device.

    ?>

    xmlns=http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006>


    

de:de

    





    

    





MobileSync

   





   

    

    

    

    

    xmlns=http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006>


    

    

   email

settings

        // Loop through each 
configured protocol.


while(list($protocol, $settings) = each($_CONFIG))

    {

// Skip ActiveSync protocol.

  if ($protocol == "MobileSync") continue;

    ?>





   $value\n";

}

    ?>







    

    

    

    xmlns=http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006>


    

    


600

  Invalid Request



    

    

    

    

And the mailsetup.php for iOS devices:



$cmdline = "/usr/bin/openssl smime -sign -in 
/var/www/html/apple/$timestamp -out 
/var/www/html/apple/$timestamp.signed -signer 
/etc/pki/dovecot/dovecot.cer -inkey 
/etc/pki/dovecot/private/dovecot.pem -certfile 
/etc/pki/dovecot/intermediate.cer -nodetach -outform der";


$output = exec($cmdline);


Re: [SOGo] Help to setup autoconfig and autodiscover

2022-01-07 Thread Kees van Vloten



Hello,

Thank you for your answer, i try this.

Best regards

Le 06/01/2022 à 22:14, Kai-Uwe Rommel - ARS (kai-uwe.rom...@ars.de) a 
écrit :


First, you need to set up DNS for your domain:

  * CNAME of autoconfig for your web server
  * CNAME of autodiscover for your web server
  * SRV record of _autodiscover._tcp

So it should look like:

_autodiscover._tcp SRV  10 0 443 webmail.domain.com.

autoconfig CNAME webmail.domain.com.

autodiscover CNAME webmail.domain.com.

On the web server you then need

  * enable PHP
  * a couple of aliases:

Alias /autodiscover/autodiscover.xml "/var/www/html/autodiscover.php"

Alias /Autodiscover/Autodiscover.xml "/var/www/html/autodiscover.php"

Alias /AutoDiscover/AutoDiscover.xml "/var/www/html/autodiscover.php"

Alias /ios "/var/www/html/mailsetup.php"

  * then those autodiscover.php and mailsetup.php files
  * and this mail/config-v1.1.xml:





    

domain.com

    eMail @ domain.com 

domain.com

    

    webmail.domain.com

993

SSL

password-cleartext

%EMAILLOCALPART%

    

    

    webmail.domain.com

465

SSL

password-cleartext

%EMAILLOCALPART%

    

    https://webmail.domain.com 
>


    WebMail-Interface zu domain.com

    WebMail interface for domain.com

    

    



The autodiscover.php is a bit lengthy:

http://technet.microsoft.com/en-us/library/cc511507.aspx

// Get contents of request made to Autodiscover.

$request = file_get_contents("php://input");

preg_match("/\(.*?)\<\/EMailAddress\>/", $request, 
$email_address);


preg_match("/\(.*?)@(.*?)\<\/EMailAddress\>/", 
$request, $email_name);


/*** Begin Configuration ***/

// ActiveSync URL.

$_CONFIG['MobileSync']['Url'] = 
https://webmail.domain.com/Microsoft-Server-ActiveSync;


// IMAP configuration settings.

$_CONFIG['IMAP']['Server'] = "webmail.domain.com";

$_CONFIG['IMAP']['Port'] = "993";

$_CONFIG['IMAP']['SSL'] = "on";

$_CONFIG['IMAP']['SPA'] = "off";

$_CONFIG['IMAP']['AuthRequired'] = "on";

$_CONFIG['IMAP']['DomainRequired'] = "off";

$_CONFIG['IMAP']['LoginName'] = $email_name[1];

// SMTP configuration settings.

$_CONFIG['SMTP']['Server'] = "webmail.domain.com";

$_CONFIG['SMTP']['Port'] = "465";

$_CONFIG['SMTP']['SSL'] = "on";

$_CONFIG['SMTP']['SPA'] = "off";

$_CONFIG['SMTP']['AuthRequired'] = "on";

$_CONFIG['SMTP']['DomainRequired'] = "off";

$_CONFIG['SMTP']['LoginName'] = $email_name[1];

/*** End Configuration ***/

// XML document heading.

header("Content-Type: text/xml");

echo "\n";

// Get the schema from the request.

preg_match("/\(.*?)\<\/AcceptableResponseSchema\>/", 
$request, $schema);


// Determine the type of device requesting Autodiscover.

if (preg_match("/\/mobilesync\//", $schema[1]))

{

    // Mobile device.

    ?>

    xmlns=http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006>




de:de









  





MobileSync

   





   







    

    xmlns=http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006>






   email

settings

    





   $value\n";

}

?>











    

    xmlns=http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006>







600

  Invalid Request









    

And the mailsetup.php for iOS devices:



$cmdline = "/usr/bin/openssl smime -sign -in 
/var/www/html/apple/$timestamp -out 
/var/www/html/apple/$timestamp.signed -signer 
/etc/pki/dovecot/dovecot.cer -inkey 
/etc/pki/dovecot/private/dovecot.pem -certfile 
/etc/pki/dovecot/intermediate.cer -nodetach -outform der";


$output = exec($cmdline);

header('Content-type: application/x-apple-aspen-config; charset=utf-8');

header('Content-Disposition: attachment; 
filename="domain.mobileconfig"');


header('Content-Transfer-Encoding: binary');

ob_clean();

flush();

readfile("/var/www/html/apple/$timestamp.signed");

flush();

unlink("/var/www/html/apple/$timestamp");

unlink("/var/www/html/apple/$timestamp.signed");

?>







domain.com ActiveSync Configuration for Apple iOS












Benutzer-Name:



















And the mailsetup.mobileconfig it references:



http://www.apple.com/DTDs/PropertyList-1.0.dtd>




    

PayloadUUID

8B9C9E2E-53E7-44EC-A361-74EC8136B4CF

 PayloadDisplayName

%EMAIL%

PayloadIdentifier

domain.profile

PayloadDescription

Configures the device for use with ActiveSync for 
domain.com


PayloadOrganization

DOMAIN

PayloadVersion

1

PayloadType

 Configuration

PayloadContent

    



PayloadUUID

837AF5F3-1380-4234-BAD0-8246A644AC2E

PayloadDisplayName

%USERNAME%

PayloadDescription

Configures the device for use with ActiveSync for 
DOMAIN.


PayloadOrganization

DOMAIN

PayloadVersion

1

PayloadIdentifier

domain.email

PayloadType

com.apple.eas.account


Re: [SOGo] Help to setup autoconfig and autodiscover

2022-01-07 Thread HYVERNAT Philippe

Hello,

Thank you for your answer, i try this.

Best regards

Le 06/01/2022 à 22:14, Kai-Uwe Rommel - ARS (kai-uwe.rom...@ars.de) a 
écrit :


First, you need to set up DNS for your domain:

  * CNAME of autoconfig for your web server
  * CNAME of autodiscover for your web server
  * SRV record of _autodiscover._tcp

So it should look like:

_autodiscover._tcp SRV  10 0 443 webmail.domain.com.

autoconfig CNAME webmail.domain.com.

autodiscover CNAME webmail.domain.com.

On the web server you then need

  * enable PHP
  * a couple of aliases:

Alias /autodiscover/autodiscover.xml "/var/www/html/autodiscover.php"

Alias /Autodiscover/Autodiscover.xml "/var/www/html/autodiscover.php"

Alias /AutoDiscover/AutoDiscover.xml "/var/www/html/autodiscover.php"

Alias /ios "/var/www/html/mailsetup.php"

  * then those autodiscover.php and mailsetup.php files
  * and this mail/config-v1.1.xml:





    

    domain.com

    eMail @ domain.com 

domain.com

    

    webmail.domain.com

    993

SSL

password-cleartext

%EMAILLOCALPART%

    

    

    webmail.domain.com

    465

SSL

password-cleartext

%EMAILLOCALPART%

    

    https://webmail.domain.com 
>


    WebMail-Interface zu domain.com

    WebMail interface for domain.com

    

    



The autodiscover.php is a bit lengthy:

http://technet.microsoft.com/en-us/library/cc511507.aspx

// Get contents of request made to Autodiscover.

$request = file_get_contents("php://input");

preg_match("/\(.*?)\<\/EMailAddress\>/", $request, 
$email_address);


preg_match("/\(.*?)@(.*?)\<\/EMailAddress\>/", 
$request, $email_name);


/*** Begin Configuration ***/

// ActiveSync URL.

$_CONFIG['MobileSync']['Url'] = 
https://webmail.domain.com/Microsoft-Server-ActiveSync;


// IMAP configuration settings.

$_CONFIG['IMAP']['Server'] = "webmail.domain.com";

$_CONFIG['IMAP']['Port'] = "993";

$_CONFIG['IMAP']['SSL'] = "on";

$_CONFIG['IMAP']['SPA'] = "off";

$_CONFIG['IMAP']['AuthRequired'] = "on";

$_CONFIG['IMAP']['DomainRequired'] = "off";

$_CONFIG['IMAP']['LoginName'] = $email_name[1];

// SMTP configuration settings.

$_CONFIG['SMTP']['Server'] = "webmail.domain.com";

$_CONFIG['SMTP']['Port'] = "465";

$_CONFIG['SMTP']['SSL'] = "on";

$_CONFIG['SMTP']['SPA'] = "off";

$_CONFIG['SMTP']['AuthRequired'] = "on";

$_CONFIG['SMTP']['DomainRequired'] = "off";

$_CONFIG['SMTP']['LoginName'] = $email_name[1];

/*** End Configuration ***/

// XML document heading.

header("Content-Type: text/xml");

echo "\n";

// Get the schema from the request.

preg_match("/\(.*?)\<\/AcceptableResponseSchema\>/", 
$request, $schema);


// Determine the type of device requesting Autodiscover.

if (preg_match("/\/mobilesync\//", $schema[1]))

{

    // Mobile device.

    ?>

    xmlns=http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006>


    

de:de

    





    

    





MobileSync

   





   

    

    

    

    

    xmlns=http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006>


    

    

   email

settings

        // Loop through each 
configured protocol.


while(list($protocol, $settings) = each($_CONFIG))

    {

// Skip ActiveSync protocol.

  if ($protocol == "MobileSync") continue;

    ?>





   $value\n";

}

    ?>







    

    

    

    xmlns=http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006>


    

    


600

  Invalid Request



    

    

    

    

And the mailsetup.php for iOS devices:



$cmdline = "/usr/bin/openssl smime -sign -in 
/var/www/html/apple/$timestamp -out 
/var/www/html/apple/$timestamp.signed -signer 
/etc/pki/dovecot/dovecot.cer -inkey 
/etc/pki/dovecot/private/dovecot.pem -certfile 
/etc/pki/dovecot/intermediate.cer -nodetach -outform der";


$output = exec($cmdline);

header('Content-type: application/x-apple-aspen-config; charset=utf-8');

header('Content-Disposition: attachment; filename="domain.mobileconfig"');

header('Content-Transfer-Encoding: binary');

ob_clean();

flush();

readfile("/var/www/html/apple/$timestamp.signed");

flush();

unlink("/var/www/html/apple/$timestamp");

unlink("/var/www/html/apple/$timestamp.signed");

?>







domain.com ActiveSync Configuration for Apple iOS













RE: [SOGo] Help to setup autoconfig and autodiscover

2022-01-06 Thread Kai-Uwe Rommel - ARS
First, you need to set up DNS for your domain:

  *   CNAME of autoconfig for your web server
  *   CNAME of autodiscover for your web server
  *   SRV record of _autodiscover._tcp
So it should look like:
_autodiscover._tcp  SRV  10 0 443  webmail.domain.com.
autoconfig  CNAME webmail.domain.com.
autodiscoverCNAME webmail.domain.com.

On the web server you then need

  *   enable PHP
  *   a couple of aliases:
Alias /autodiscover/autodiscover.xml "/var/www/html/autodiscover.php"
Alias /Autodiscover/Autodiscover.xml "/var/www/html/autodiscover.php"
Alias /AutoDiscover/AutoDiscover.xml "/var/www/html/autodiscover.php"
Alias /ios "/var/www/html/mailsetup.php"

  *   then those autodiscover.php and mailsetup.php files
  *   and this mail/config-v1.1.xml:



domain.com
eMail @ domain.com 
domain.com

webmail.domain.com
993
SSL
password-cleartext
%EMAILLOCALPART%


webmail.domain.com
465
SSL
password-cleartext
%EMAILLOCALPART%

https://webmail.domain.com>
WebMail-Interface zu domain.com
WebMail interface for domain.com




The autodiscover.php is a bit lengthy:

http://technet.microsoft.com/en-us/library/cc511507.aspx

// Get contents of request made to Autodiscover.
$request = file_get_contents("php://input");
preg_match("/\(.*?)\<\/EMailAddress\>/", $request, 
$email_address);
preg_match("/\(.*?)@(.*?)\<\/EMailAddress\>/", $request, 
$email_name);

/*** Begin Configuration ***/

// ActiveSync URL.
$_CONFIG['MobileSync']['Url'] = 
https://webmail.domain.com/Microsoft-Server-ActiveSync;

// IMAP configuration settings.
$_CONFIG['IMAP']['Server'] = "webmail.domain.com";
$_CONFIG['IMAP']['Port'] = "993";
$_CONFIG['IMAP']['SSL'] = "on";
$_CONFIG['IMAP']['SPA'] = "off";
$_CONFIG['IMAP']['AuthRequired'] = "on";
$_CONFIG['IMAP']['DomainRequired'] = "off";
$_CONFIG['IMAP']['LoginName'] = $email_name[1];

// SMTP configuration settings.
$_CONFIG['SMTP']['Server'] = "webmail.domain.com";
$_CONFIG['SMTP']['Port'] = "465";
$_CONFIG['SMTP']['SSL'] = "on";
$_CONFIG['SMTP']['SPA'] = "off";
$_CONFIG['SMTP']['AuthRequired'] = "on";
$_CONFIG['SMTP']['DomainRequired'] = "off";
$_CONFIG['SMTP']['LoginName'] = $email_name[1];

/*** End Configuration ***/

// XML document heading.
header("Content-Type: text/xml");
echo "\n";

// Get the schema from the request.
preg_match("/\(.*?)\<\/AcceptableResponseSchema\>/", 
$request, $schema);

// Determine the type of device requesting Autodiscover.
if (preg_match("/\/mobilesync\//", $schema[1]))
{
// Mobile device.
?>
http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006>

de:de







MobileSync








http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006>


email
settings



$value\n";
}
?>






http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006>


600
Invalid Request






And the mailsetup.php for iOS devices:







domain.com ActiveSync Configuration for Apple iOS





Benutzer-Name:











And the mailsetup.mobileconfig it references:


http://www.apple.com/DTDs/PropertyList-1.0.dtd>


PayloadUUID
8B9C9E2E-53E7-44EC-A361-74EC8136B4CF
PayloadDisplayName
%EMAIL%
  

Re: [SOGo] Help to setup autoconfig and autodiscover

2022-01-06 Thread slavek.ba...@axis.cz
On Thursday 06 of January 2022 20:38:31 HYVERNAT Philippe wrote:
> Hello community,
>
> i don't know if it is the right feed but i want to configure autoconfig
> and autodiscover in the same web server of sogo.
>
>
> I own Postfix / Dovecot Apache 24 and sogo 5.4
>
>
> My web server is share with sogo and my setup is "webmail.domain.com"
>
>
> I find scripts examples for both thunderbird and outlook but i don't
> know *where* to place them and how configure th web server apache to
> share files.
>
>
> i use also redirection /sogo to /
>
> Thanks by advance.
>
> HYVERNAT PHILIPPE

Hi Philippe,

I recommend to look at automx2:
https://automx.org/en/

Cheers
-- 
Slávek


signature.asc
Description: This is a digitally signed message part.