diff -up dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/main.c.nolibotp dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/main.c
--- dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/main.c.nolibotp	2025-03-28 12:32:27.000000000 +0100
+++ dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/main.c	2025-06-05 22:36:50.148155427 +0200
@@ -20,8 +20,6 @@
 #include "password-scheme.h"
 #include "passdb-cache.h"
 #include "mech.h"
-#include "otp.h"
-#include "mech-otp-common.h"
 #include "auth.h"
 #include "auth-penalty.h"
 #include "auth-token.h"
@@ -272,7 +270,6 @@ static void main_deinit(void)
 
 	auth_policy_deinit();
 	mech_register_deinit(&mech_reg);
-	mech_otp_deinit();
 	db_oauth2_deinit();
 	mech_deinit(global_auth_settings);
 	settings_free(global_auth_settings);
diff -up dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/mech.c.nolibotp dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/mech.c
--- dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/mech.c.nolibotp	2025-03-28 12:32:27.000000000 +0100
+++ dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/mech.c	2025-06-05 22:36:50.148435422 +0200
@@ -71,7 +71,6 @@ extern const struct mech_module mech_apo
 extern const struct mech_module mech_cram_md5;
 extern const struct mech_module mech_digest_md5;
 extern const struct mech_module mech_external;
-extern const struct mech_module mech_otp;
 extern const struct mech_module mech_scram_sha1;
 extern const struct mech_module mech_scram_sha1_plus;
 extern const struct mech_module mech_scram_sha256;
@@ -217,7 +216,6 @@ void mech_init(const struct auth_setting
 		mech_register_module(&mech_gssapi_spnego);
 #endif
 	}
-	mech_register_module(&mech_otp);
 	mech_register_module(&mech_scram_sha1);
 	mech_register_module(&mech_scram_sha1_plus);
 	mech_register_module(&mech_scram_sha256);
@@ -247,7 +245,6 @@ void mech_deinit(const struct auth_setti
 		mech_unregister_module(&mech_gssapi_spnego);
 #endif
 	}
-	mech_unregister_module(&mech_otp);
 	mech_unregister_module(&mech_scram_sha1);
 	mech_unregister_module(&mech_scram_sha1_plus);
 	mech_unregister_module(&mech_scram_sha256);
diff -up dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/test-auth.c.nolibotp dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/test-auth.c
--- dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/test-auth.c.nolibotp	2025-06-05 23:11:23.428522162 +0200
+++ dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/test-auth.c	2025-06-05 23:11:23.443511259 +0200
@@ -72,7 +72,6 @@ void test_auth_init(void)
 void test_auth_deinit(void)
 {
 	auth_penalty_deinit(&auth_penalty);
-	mech_otp_deinit();
 	db_oauth2_deinit();
 	auths_deinit();
 	auth_token_deinit();
diff -up dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/test-mech.c.nolibotp dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/test-mech.c
--- dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/test-mech.c.nolibotp	2025-03-28 12:32:27.000000000 +0100
+++ dovecot-2.4.1-build/dovecot-2.4.1-4/src/auth/test-mech.c	2025-06-05 22:36:50.148639214 +0200
@@ -24,7 +24,6 @@ extern const struct mech_module mech_dig
 extern const struct mech_module mech_external;
 extern const struct mech_module mech_login;
 extern const struct mech_module mech_oauthbearer;
-extern const struct mech_module mech_otp;
 extern const struct mech_module mech_plain;
 extern const struct mech_module mech_scram_sha1;
 extern const struct mech_module mech_scram_sha256;
@@ -60,10 +59,7 @@ request_handler_reply_mock_callback(stru
 
 	if (request->passdb_result == PASSDB_RESULT_OK)
 		request->failed = FALSE;
-	else if (request->mech == &mech_otp) {
-		if (null_strcmp(request->fields.user, "otp_phase_2") == 0)
-			request->failed = FALSE;
-	} else if (request->mech == &mech_oauthbearer) {
+	else if (request->mech == &mech_oauthbearer) {
 	}
 };
 
@@ -181,10 +177,6 @@ static void test_mechs(void)
 		{&mech_plain, UCHAR_LEN("\0testuser\0testpass"), "testuser", NULL, TRUE, FALSE, FALSE},
 		{&mech_plain, UCHAR_LEN("normaluser\0masteruser\0masterpass"), "masteruser", NULL, TRUE, FALSE, FALSE},
 		{&mech_plain, UCHAR_LEN("normaluser\0normaluser\0masterpass"), "normaluser", NULL, TRUE, FALSE, FALSE},
-		{&mech_otp, UCHAR_LEN("hex:5Bf0 75d9 959d 036f"), "otp_phase_2", NULL, TRUE, TRUE, FALSE},
-		{&mech_otp, UCHAR_LEN("word:BOND FOGY DRAB NE RISE MART"), "otp_phase_2", NULL, TRUE, TRUE, FALSE},
-		{&mech_otp, UCHAR_LEN("init-hex:f6bd 6b33 89b8 7203:md5 499 ke6118:23d1 b253 5ae0 2b7e"), "otp_phase_2", NULL, TRUE, TRUE, FALSE},
-		{&mech_otp, UCHAR_LEN("init-word:END KERN BALM NICK EROS WAVY:md5 499 ke1235:BABY FAIN OILY NIL TIDY DADE"), "otp_phase_2", NULL , TRUE, TRUE, FALSE},
 		{&mech_oauthbearer, UCHAR_LEN("n,a=testuser,p=cHJvb2Y=,f=nonstandart\x01host=server\x01port=143\x01""auth=Bearer vF9dft4qmTc2Nvb3RlckBhbHRhdmlzdGEuY29tCg==\x01\x01"), "testuser", NULL, FALSE, TRUE, FALSE},
 		{&mech_scram_sha1, UCHAR_LEN("n,,n=testuser,r=rOprNGfwEbeRWgbNEkqO"), "testuser", NULL, TRUE, FALSE, FALSE},
 		{&mech_scram_sha256, UCHAR_LEN("n,,n=testuser,r=rOprNGfwEbeRWgbNEkqO"), "testuser",  NULL, TRUE, FALSE, FALSE},
@@ -199,8 +191,6 @@ static void test_mechs(void)
 		{&mech_external, UCHAR_LEN(""), "testuser", NULL, FALSE, TRUE, FALSE},
 		{&mech_external, UCHAR_LEN(""), NULL, NULL, FALSE, FALSE, FALSE},
 		{&mech_login, UCHAR_LEN(""), NULL, NULL, FALSE, FALSE, FALSE},
-		{&mech_otp, UCHAR_LEN(""), NULL, "invalid input", FALSE, FALSE, FALSE},
-		{&mech_otp, UCHAR_LEN(""), "testuser", "invalid input", FALSE, FALSE, FALSE},
 		{&mech_plain, UCHAR_LEN(""), NULL, NULL, FALSE, FALSE, FALSE},
 		{&mech_oauthbearer, UCHAR_LEN(""), NULL, NULL, FALSE, FALSE, FALSE},
 		{&mech_xoauth2, UCHAR_LEN(""), NULL, NULL, FALSE, FALSE, FALSE},
@@ -212,7 +202,6 @@ static void test_mechs(void)
 		{&mech_apop, UCHAR_LEN("1.1.1\0testuser\0tooshort"), NULL, NULL, FALSE, FALSE, FALSE},
 		{&mech_apop, UCHAR_LEN("1.1.1\0testuser\0responseoflen16-"), NULL, NULL, FALSE, FALSE, FALSE},
 		{&mech_apop, UCHAR_LEN("1.1.1"), NULL, NULL, FALSE, FALSE, FALSE},
-		{&mech_otp, UCHAR_LEN("somebody\0testuser"), "testuser", "unsupported response type", FALSE, TRUE, FALSE},
 		{&mech_cram_md5, UCHAR_LEN("testuser\0response"), "testuser", NULL, FALSE, FALSE, FALSE},
 		{&mech_plain, UCHAR_LEN("testuser\0"), "testuser", NULL, FALSE, FALSE, FALSE},
 
@@ -254,9 +243,7 @@ static void test_mechs(void)
 		{&mech_plain, UCHAR_LEN("\0fa\0il\0ing\0withthis"), NULL, NULL, FALSE, FALSE, FALSE},
 		{&mech_plain, UCHAR_LEN("failingwiththis"), NULL, NULL, FALSE, FALSE, FALSE},
 		{&mech_plain, UCHAR_LEN("failing\0withthis"), NULL, NULL, FALSE, FALSE, FALSE},
-		{&mech_otp, UCHAR_LEN("someb\0ody\0testuser"), NULL, "invalid input", FALSE, FALSE, FALSE},
 		/* phase 2 */
-		{&mech_otp, UCHAR_LEN("someb\0ody\0testuser"), "testuser", "unsupported response type", FALSE, TRUE, FALSE},
 		{&mech_scram_sha1, UCHAR_LEN("c=biws,r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j,p=v0X8v3Bz2T0CJGbJQyF0X+HI4Ts="), NULL, NULL, FALSE, FALSE, FALSE},
 		{&mech_scram_sha1, UCHAR_LEN("iws0X8v3Bz2T0CJGbJQyF0X+HI4Ts=,,,,"), NULL, NULL, FALSE, FALSE, FALSE},
 		{&mech_scram_sha1, UCHAR_LEN("n,a=masteruser,,"), NULL, NULL, FALSE, FALSE, FALSE},
diff -up dovecot-2.4.1-build/dovecot-2.4.1-4/src/lib-auth/password-scheme.c.nolibotp dovecot-2.4.1-build/dovecot-2.4.1-4/src/lib-auth/password-scheme.c
--- dovecot-2.4.1-build/dovecot-2.4.1-4/src/lib-auth/password-scheme.c.nolibotp	2025-06-05 22:36:50.142606171 +0200
+++ dovecot-2.4.1-build/dovecot-2.4.1-4/src/lib-auth/password-scheme.c	2025-06-05 22:36:50.148822418 +0200
@@ -13,7 +13,6 @@
 #include "randgen.h"
 #include "sha1.h"
 #include "sha2.h"
-#include "otp.h"
 #include "str.h"
 #include "password-scheme.h"
 #include "password-scheme-private.h"
@@ -701,33 +700,6 @@ plain_md5_generate(const char *plaintext
 	*size_r = MD5_RESULTLEN;
 }
 
-static int otp_verify(const char *plaintext, const struct password_generate_params *params ATTR_UNUSED,
-		      const unsigned char *raw_password, size_t size,
-		      const char **error_r)
-{
-	const char *password, *generated;
-
-	password = t_strndup(raw_password, size);
-	if (password_generate_otp(plaintext, password, UINT_MAX, &generated) < 0) {
-		*error_r = "Invalid OTP data in passdb";
-		return -1;
-	}
-
-	return strcasecmp(password, generated) == 0 ? 1 : 0;
-}
-
-static void
-otp_generate(const char *plaintext, const struct password_generate_params *params ATTR_UNUSED,
-	     const unsigned char **raw_password_r, size_t *size_r)
-{
-	const char *password;
-
-	if (password_generate_otp(plaintext, NULL, OTP_HASH_SHA1, &password) < 0)
-		i_unreached();
-	*raw_password_r = (const unsigned char *)password;
-	*size_r = strlen(password);
-}
-
 static const struct password_scheme builtin_schemes[] = {
 	{
 		.name = "MD5",
@@ -891,13 +863,6 @@ static const struct password_scheme buil
 		.password_generate = plain_md5_generate,
 	},
 	{
-		.name = "OTP",
-		.default_encoding = PW_ENCODING_NONE,
-		.raw_password_len = 0,
-		.password_verify = otp_verify,
-		.password_generate = otp_generate,
-	},
-	{
 		.name = "PBKDF2",
 		.default_encoding = PW_ENCODING_NONE,
 		.raw_password_len = 0,
diff -up dovecot-2.4.1-build/dovecot-2.4.1-4/src/lib-auth/password-scheme.h.nolibotp dovecot-2.4.1-build/dovecot-2.4.1-4/src/lib-auth/password-scheme.h
--- dovecot-2.4.1-build/dovecot-2.4.1-4/src/lib-auth/password-scheme.h.nolibotp	2025-03-28 12:32:27.000000000 +0100
+++ dovecot-2.4.1-build/dovecot-2.4.1-4/src/lib-auth/password-scheme.h	2025-06-05 22:36:50.148942954 +0200
@@ -98,9 +98,6 @@ void password_set_encryption_rounds(unsi
 /* INTERNAL: */
 const char *password_generate_salt(size_t len);
 const char *password_generate_md5_crypt(const char *pw, const char *salt);
-int password_generate_otp(const char *pw, const char *state_data,
-			  unsigned int algo, const char **result_r)
-	ATTR_NULL(2);
 
 int scram_scheme_parse(const struct hash_method *hmethod, const char *name,
 		       const unsigned char *credentials, size_t size,
diff -up dovecot-2.4.1-build/dovecot-2.4.1-4/src/lib-auth/test-password-scheme.c.nolibotp dovecot-2.4.1-build/dovecot-2.4.1-4/src/lib-auth/test-password-scheme.c
--- dovecot-2.4.1-build/dovecot-2.4.1-4/src/lib-auth/test-password-scheme.c.nolibotp	2025-03-28 12:32:27.000000000 +0100
+++ dovecot-2.4.1-build/dovecot-2.4.1-4/src/lib-auth/test-password-scheme.c	2025-06-05 22:36:50.149077275 +0200
@@ -107,7 +107,6 @@ static void test_password_schemes(void)
 	test_password_scheme("SHA512", "{SHA512}7iaw3Ur350mqGo7jwQrpkj9hiYB3Lkc/iBml1JQODbJ6wYX4oOHV+E+IvIh/1nsUNzLDBMxfqa2Ob1f1ACio/w==", "test");
 	test_password_scheme("SSHA", "{SSHA}H/zrDv8FXUu1JmwvVYijfrYEF34jVZcO", "test");
 	test_password_scheme("MD5-CRYPT", "{MD5-CRYPT}$1$GgvxyNz8$OjZhLh4P.gF1lxYEbLZ3e/", "test");
-	test_password_scheme("OTP", "{OTP}sha1 1024 ae6b49aa481f7233 f69fc7f98b8fbf54", "test");
 	test_password_scheme("PBKDF2", "{PBKDF2}$1$bUnT4Pl7yFtYX0KU$5000$50a83cafdc517b9f46519415e53c6a858908680a", "test");
 	test_password_scheme("CRAM-MD5", "{CRAM-MD5}e02d374fde0dc75a17a557039a3a5338c7743304777dccd376f332bee68d2cf6", "test");
 	test_password_scheme("DIGEST-MD5", "{DIGEST-MD5}77c1a8c437c9b08ba2f460fe5d58db5d", "test");
