Skip to content

Commit 0e79f2b

Browse files
authored
PHP-imap replacement (#198)
1 parent 7459652 commit 0e79f2b

File tree

12 files changed

+952
-70
lines changed

12 files changed

+952
-70
lines changed

.env

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ AUTH_REALM=SabreDAV
4848
# "Basic", "IMAP", or "LDAP"
4949
AUTH_METHOD=Basic
5050

51-
# In case of IMAP Auth, you must specify the url of the mailbox in the following format {host[:port][/flag1/flag2...]}.
52-
# See https://www.php.net/manual/en/function.imap-open.php for more details
51+
# In case of IMAP Auth, you must specify the url of the mailbox in the following format host[:port].
5352
IMAP_AUTH_URL=null
53+
IMAP_ENCRYPTION_METHOD=ssl
54+
IMAP_CERTIFICATE_VALIDATION=true
5455
IMAP_AUTH_USER_AUTOCREATE=false
5556

5657
# In case of LDAP Auth, you must specify the url of the LDAP server

.github/workflows/ci.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ jobs:
2727
steps:
2828
- name: Checkout
2929
uses: actions/checkout@v4
30-
- name: Install GD PHP extension
30+
- name: Install GD / ZIP PHP extension
3131
run: |
32-
apk add $PHPIZE_DEPS libpng-dev
32+
apk add $PHPIZE_DEPS libpng-dev libzip-dev
3333
docker-php-ext-configure gd
34-
docker-php-ext-install gd
34+
docker-php-ext-configure zip
35+
docker-php-ext-install gd zip
3536
- name: Install Composer
3637
run: wget -qO - https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
3738
- name: Validate Composer
@@ -70,16 +71,18 @@ jobs:
7071
php:
7172
- '8.2'
7273
- '8.3'
74+
- '8.4'
7375
fail-fast: false
7476
steps:
7577
- name: Checkout
7678
uses: actions/checkout@v4
77-
- name: Install MySQL / GD PHP extensions
79+
- name: Install MySQL / GD / ZIP PHP extensions
7880
run: |
79-
apk add $PHPIZE_DEPS icu-libs icu-dev libpng-dev
81+
apk add $PHPIZE_DEPS icu-libs icu-dev libpng-dev libzip-dev
8082
docker-php-ext-configure intl
8183
docker-php-ext-configure gd
82-
docker-php-ext-install pdo pdo_mysql intl gd
84+
docker-php-ext-configure zip
85+
docker-php-ext-install pdo pdo_mysql intl gd zip
8386
- name: Install Composer
8487
run: wget -qO - https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
8588
- name: Install dependencies with Composer

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,16 +248,18 @@ Or use it directly in the Apache configuration
248248
249249
### Specific environment variables for IMAP and LDAP authentication methods
250250
251-
In case you use the `IMAP` auth type, you must specify the auth url (_the "mailbox" url_) in `IMAP_AUTH_URL`. See https://www.php.net/manual/en/function.imap-open.php for more details.
251+
In case you use the `IMAP` auth type, you must specify the auth url (_the "mailbox" url_) in `IMAP_AUTH_URL` as `host:port`, the encryption method (SSL, TLS or None) and whether the certificate should be validated.
252252
253-
You should also explicitely define whether you want new authenticated to be created upon login:
253+
You should also explicitely define whether you want new authenticated users to be created upon login:
254254
255255
```shell
256-
IMAP_AUTH_URL={imap.gmail.com:993/imap/ssl/novalidate-cert}
256+
IMAP_AUTH_URL=imap.mydomain.com:993
257+
IMAP_ENCRYPTION_METHOD=ssl # ssl, tls or false
258+
IMAP_CERTIFICATE_VALIDATION=true
257259
IMAP_AUTH_USER_AUTOCREATE=true # false by default
258260
```
259261
260-
Same goes for LDAP, where you must specify the LDAP server url, the DN pattern, the Mail attribute, as well as whether you want new authenticated to be created upon login (_like for IMAP_):
262+
Same goes for LDAP, where you must specify the LDAP server url, the DN pattern, the Mail attribute, as well as whether you want new authenticated users to be created upon login (_like for IMAP_):
261263
262264
```shell
263265
LDAP_AUTH_URL=ldap://127.0.0.1:3890 # default LDAP port

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"ext-ctype": "*",
99
"ext-gd": "*",
1010
"ext-iconv": "*",
11+
"ext-zip": "*",
1112
"composer-runtime-api": "^2",
1213
"dantsu/php-osm-static-api": "^0.6.4",
1314
"doctrine/doctrine-bundle": "^2.15.1",
@@ -37,7 +38,8 @@
3738
"symfony/twig-bundle": "^7.3",
3839
"symfony/validator": "^7.3",
3940
"symfony/web-link": "^7.3",
40-
"symfony/yaml": "^7.3"
41+
"symfony/yaml": "^7.3",
42+
"webklex/php-imap": "^6.2"
4143
},
4244
"require-dev": {
4345
"doctrine/doctrine-fixtures-bundle": "^3.5",

0 commit comments

Comments
 (0)