[Imapsync] Use pure perl code for XOAUTH2 authmech
This commit is contained in:
		| @@ -21,6 +21,7 @@ RUN groupadd -g 5000 vmail \ | |||||||
|   && touch /etc/default/locale \ |   && touch /etc/default/locale \ | ||||||
|   && apt-get update \ |   && apt-get update \ | ||||||
|   && apt-get -y --no-install-recommends install \ |   && apt-get -y --no-install-recommends install \ | ||||||
|  |   build-essential \ | ||||||
|   apt-transport-https \ |   apt-transport-https \ | ||||||
|   ca-certificates \ |   ca-certificates \ | ||||||
|   cpanminus \ |   cpanminus \ | ||||||
| @@ -61,6 +62,7 @@ RUN groupadd -g 5000 vmail \ | |||||||
|   libproc-processtable-perl \ |   libproc-processtable-perl \ | ||||||
|   libreadonly-perl \ |   libreadonly-perl \ | ||||||
|   libregexp-common-perl \ |   libregexp-common-perl \ | ||||||
|  |   libssl-dev \ | ||||||
|   libsys-meminfo-perl \ |   libsys-meminfo-perl \ | ||||||
|   libterm-readkey-perl \ |   libterm-readkey-perl \ | ||||||
|   libtest-deep-perl \ |   libtest-deep-perl \ | ||||||
| @@ -110,6 +112,8 @@ RUN groupadd -g 5000 vmail \ | |||||||
|   && apt-get autoclean \ |   && apt-get autoclean \ | ||||||
|   && rm -rf /var/lib/apt/lists/* \ |   && rm -rf /var/lib/apt/lists/* \ | ||||||
|   && rm -rf /tmp/* /var/tmp/* /root/.cache/ |   && rm -rf /tmp/* /var/tmp/* /root/.cache/ | ||||||
|  | # imapsync dependencies | ||||||
|  | RUN cpan Crypt::OpenSSL::PKCS12 | ||||||
|  |  | ||||||
| COPY trim_logs.sh /usr/local/bin/trim_logs.sh | COPY trim_logs.sh /usr/local/bin/trim_logs.sh | ||||||
| COPY clean_q_aged.sh /usr/local/bin/clean_q_aged.sh | COPY clean_q_aged.sh /usr/local/bin/clean_q_aged.sh | ||||||
|   | |||||||
| @@ -8492,6 +8492,7 @@ sub xoauth2 | |||||||
|         require HTML::Entities ; |         require HTML::Entities ; | ||||||
|         require JSON ; |         require JSON ; | ||||||
|         require JSON::WebToken::Crypt::RSA ; |         require JSON::WebToken::Crypt::RSA ; | ||||||
|  |         require Crypt::OpenSSL::PKCS12; | ||||||
|         require Crypt::OpenSSL::RSA ; |         require Crypt::OpenSSL::RSA ; | ||||||
|         require Encode::Byte ; |         require Encode::Byte ; | ||||||
|         require IO::Socket::SSL ; |         require IO::Socket::SSL ; | ||||||
| @@ -8532,8 +8533,9 @@ sub xoauth2 | |||||||
|  |  | ||||||
|             $sync->{ debug } and myprint( "Service account: $iss\nKey file: $keyfile\nKey password: $keypass\n"); |             $sync->{ debug } and myprint( "Service account: $iss\nKey file: $keyfile\nKey password: $keypass\n"); | ||||||
|  |  | ||||||
|             # Get private key from p12 file (would be better in perl...) |             # Get private key from p12 file | ||||||
|             $key = `openssl pkcs12 -in "$keyfile" -nodes -nocerts -passin pass:$keypass -nomacver`; |             my $pkcs12 = Crypt::OpenSSL::PKCS12->new_from_file($keyfile); | ||||||
|  |             $key = $pkcs12->private_key($keypass); | ||||||
|  |  | ||||||
|             $sync->{ debug } and myprint( "Private key:\n$key\n"); |             $sync->{ debug } and myprint( "Private key:\n$key\n"); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -216,7 +216,7 @@ services: | |||||||
|             - sogo |             - sogo | ||||||
|  |  | ||||||
|     dovecot-mailcow: |     dovecot-mailcow: | ||||||
|       image: mailcow/dovecot:1.22 |       image: mailcow/dovecot:1.23 | ||||||
|       depends_on: |       depends_on: | ||||||
|         - mysql-mailcow |         - mysql-mailcow | ||||||
|       dns: |       dns: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user