Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mailinabox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mailinabox
Commits
28eaf7cb
Commit
28eaf7cb
authored
Aug 19, 2014
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixes' of github.com:jkaberg/mailinabox into jkaberg-fixes
parents
46f3d050
9a198935
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
94 deletions
+35
-94
nginx.conf
conf/nginx.conf
+2
-1
autodiscover_config.php
conf/zpush/autodiscover_config.php
+24
-0
zpush.sh
setup/zpush.sh
+4
-0
exchange-autodiscover.php
tools/exchange-autodiscover.php
+0
-92
webfinger.php
tools/webfinger.php
+5
-1
No files found.
conf/nginx.conf
View file @
28eaf7cb
...
...
@@ -61,7 +61,8 @@ server {
# Microsoft Exchange autodiscover.xml for email
location
/autodiscover/autodiscover.xml
{
include
fastcgi_params
;
fastcgi_param
SCRIPT_FILENAME
/usr/local/bin/mailinabox-exchange-autodiscover.php
;
fastcgi_param
SCRIPT_FILENAME
/usr/local/lib/z-push/autodiscover/autodiscover.php
;
fastcgi_param
PHP_VALUE
"short_open_tag=Off"
;
fastcgi_pass
php-fpm
;
}
...
...
conf/zpush/autodiscover_config.php
0 → 100644
View file @
28eaf7cb
<?php
/***********************************************
* File : config.php
* Project : Z-Push
* Descr : Autodiscover configuration file
************************************************/
// Defines the base path on the server
define
(
'BASE_PATH'
,
dirname
(
$_SERVER
[
'SCRIPT_FILENAME'
])
.
'/'
);
// The Z-Push server location for the autodiscover response
define
(
'SERVERURL'
,
'https://'
.
$_SERVER
[
'SERVER_NAME'
]
.
'/Microsoft-Server-ActiveSync'
);
define
(
'USE_FULLEMAIL_FOR_LOGIN'
,
true
);
define
(
'LOGFILEDIR'
,
'/var/log/z-push/'
);
define
(
'LOGFILE'
,
LOGFILEDIR
.
'autodiscover.log'
);
define
(
'LOGERRORFILE'
,
LOGFILEDIR
.
'autodiscover-error.log'
);
define
(
'LOGLEVEL'
,
LOGLEVEL_INFO
);
define
(
'LOGUSERLEVEL'
,
LOGLEVEL
);
// the backend data provider
define
(
'BACKEND_PROVIDER'
,
'BackendCombined'
);
?>
\ No newline at end of file
setup/zpush.sh
View file @
28eaf7cb
...
...
@@ -60,6 +60,10 @@ cp conf/zpush/backend_carddav.php /usr/local/lib/z-push/backend/carddav/config.p
rm
-f
/usr/local/lib/z-push/backend/caldav/config.php
cp
conf/zpush/backend_caldav.php /usr/local/lib/z-push/backend/caldav/config.php
# Configure Autodiscover
rm
-f
/usr/local/lib/z-push/autodiscover/config.php
cp
conf/zpush/autodiscover_config.php /usr/local/lib/z-push/autodiscover/config.php
# Some directories it will use.
mkdir
-p
/var/log/z-push
...
...
tools/exchange-autodiscover.php
deleted
100755 → 0
View file @
46f3d050
<?php
// Parse our configuration file to get the PRIMARY_HOSTNAME.
$PRIMARY_HOSTNAME
=
NULL
;
foreach
(
file
(
"/etc/mailinabox.conf"
)
as
$line
)
{
$line
=
explode
(
"="
,
rtrim
(
$line
),
2
);
if
(
$line
[
0
]
==
"PRIMARY_HOSTNAME"
)
{
$PRIMARY_HOSTNAME
=
$line
[
1
];
}
}
if
(
$PRIMARY_HOSTNAME
==
NULL
)
exit
(
"no PRIMARY_HOSTNAME"
);
// We might get two kinds of requests.
$post_body
=
file_get_contents
(
'php://input'
);
preg_match
(
'/<AcceptableResponseSchema>(.*?)<\/AcceptableResponseSchema>/'
,
$post_body
,
$match
);
$AcceptableResponseSchema
=
$match
[
1
];
if
(
$AcceptableResponseSchema
==
"http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006"
)
{
// There is no way to convey the user's login name with this?
?>
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<Autodiscover
xmlns:autodiscover=
"http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006"
>
<autodiscover:Response>
<autodiscover:Action>
<autodiscover:Settings>
<autodiscover:Server>
<autodiscover:Type>
MobileSync
</autodiscover:Type>
<autodiscover:Url>
https://
<?php
echo
$PRIMARY_HOSTNAME
?>
</autodiscover:Url>
<autodiscover:Name>
https://
<?php
echo
$PRIMARY_HOSTNAME
?>
</autodiscover:Name>
</autodiscover:Server>
</autodiscover:Settings>
</autodiscover:Action>
</autodiscover:Response>
</Autodiscover>
<?php
}
else
{
// I don't know when this is actually used. I implemented this before seeing that
// it is not what my phone wanted.
// Parse the email address out of the POST request, which
// we pass back as the login name.
preg_match
(
'/<EMailAddress>(.*?)<\/EMailAddress>/'
,
$post_body
,
$match
);
$LOGIN
=
$match
[
1
];
header
(
"Content-type: text/xml"
);
?>
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<Autodiscover
xmlns=
"http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006"
>
<Response
xmlns=
"http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a"
>
<ServiceHome>
https://
<?php
echo
$PRIMARY_HOSTNAME
?>
</ServiceHome>
<Account>
<AccountType>
email
</AccountType>
<Action>
settings
</Action>
<Protocol>
<Type>
IMAP
</Type>
<Server>
<?php
echo
$PRIMARY_HOSTNAME
?>
</Server>
<Port>
993
</Port>
<SSL>
on
</SSL>
<LoginName>
<?php
echo
$LOGIN
?>
</LoginName>
</Protocol>
<Protocol>
<Type>
SMTP
</Type>
<Server>
<?php
echo
$PRIMARY_HOSTNAME
?>
</Server>
<Port>
587
</Port>
<SSL>
on
</SSL>
<LoginName>
<?php
echo
$LOGIN
?>
</LoginName>
</Protocol>
<Protocol>
<Type>
DAV
</Type>
<Server>
https://
<?php
echo
$PRIMARY_HOSTNAME
?>
</Server>
<SSL>
on
</SSL>
<DomainRequired>
on
</DomainRequired>
<LoginName>
<?php
echo
$LOGIN
?>
</LoginName>
</Protocol>
<Protocol>
<Type>
WEB
</Type>
<Server>
https://
<?php
echo
$PRIMARY_HOSTNAME
?>
/mail
</Server>
<SSL>
on
</SSL>
</Protocol>
</Account>
</Response>
</Autodiscover>
<?php
}
?>
tools/webfinger.php
View file @
28eaf7cb
<?php
$resource
=
''
;
if
(
isset
(
$_GET
[
'resource'
])){
$resource
=
$_GET
[
'resource'
];
}
// Parse our configuration file to get the STORAGE_ROOT.
$STORAGE_ROOT
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment