ltb-project / self-service-password

Web interface to change and reset password in an LDAP directory
https://self-service-password.readthedocs.io/en/latest/
GNU General Public License v3.0
1.17k stars 327 forks source link

SMS Truncate option doesn't appear to be working #1005

Open matmartell opened 3 weeks ago

matmartell commented 3 weeks ago

I am using version 1.7.0 and encountering an issue with the SMS number truncate option. Despite enabling this setting, it doesn't seem to trim the SMS number as expected.

Our system is connected to an LDAP database where mobile numbers are stored in the 'mobile' attribute in the format 1-555-555-5555. The relevant section of my configuration is as follows:

$smsmailto = "{sms_attribute}@txt.provider.com";
$sms_sanitize_number = true;
$sms_truncate_number = true;
$sms_truncate_number_length = 10;

sms_sanitize_number works as expected, removing hyphens (-) from the numbers. However, sms_truncate_number does not trim the number length to 10 digits. Instead of sending emails to 5555555555@txt.provider.com, it sends them to 15555555555@txt.provider.com, causing delivery to fail. Adjusting sms_truncate_number_length to other values (e.g., 9) does not seem to impact the behavior.

Modifying the LDAP mobile number format is not feasible, as it’s used consistently for email signatures.

Any insights or guidance on how to resolve this issue would be greatly appreciated. Thank you!