kamax-matrix / mxisd

Federated Matrix Identity Server
GNU Affero General Public License v3.0
224 stars 115 forks source link

Synapse as Identity Store - Error M_NOT_IMPLEMENTED: email is not a supported 3PID medium type #169

Closed Takalele closed 5 years ago

Takalele commented 5 years ago

Hi,

I have two VM's one is running the homeserver and mxisd the other is used as the reverse proxy, the homeserver's internal IP is 10.255.136.20, the reverse proxy IP is 10.255.136.30.

when i try to add an email-address i get the this message "email is not a supported 3PID medium type (Status 501)" in the riot webclient.

any ideas?

regards Takalele

logs:

Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO App - ------------- mxisd starting ------------- Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.YamlConfigLoader - Reading config from /etc/mxisd/mxisd.yaml Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.YamlConfigLoader - Loaded config from /etc/mxisd/mxisd.yaml Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.DirectoryConfig - --- Directory config --- Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.DirectoryConfig - Exclude: Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.DirectoryConfig - Homeserver: false Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.DirectoryConfig - 3PID: false Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.FirebaseConfig - --- Firebase configuration --- Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.FirebaseConfig - Enabled: false Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.InvitationConfig - --- Invite config --- Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.InvitationConfig - Resolution: {"recursive":true,"timer":1} Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.ldap.LdapConfig - --- Generic LDAP Config --- Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.ldap.LdapConfig - Enabled: false Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.RecursiveLookupBridgeConfig - --- Bridge integration lookups config --- Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.RecursiveLookupBridgeConfig - Enabled: false Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.MatrixConfig - --- Matrix config --- Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.MatrixConfig - Domain: matrix.example.tld Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.MatrixConfig - Identity: Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.MatrixConfig - Servers: {"matrix-org":["https://matrix.org"]} Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.ldap.LdapConfig - --- NetIQ eDirectory Config --- Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.ldap.LdapConfig - Enabled: false Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.threepid.notification.NotificationConfig - --- Notification config --- Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.threepid.notification.NotificationConfig - Handlers: Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.threepid.notification.NotificationConfig - email: raw Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.rest.RestBackendConfig - --- REST backend config --- Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.rest.RestBackendConfig - Enabled: false Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.SessionConfig - --- Session config --- Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.SessionConfig - Global Policy: {"validation":{"enabled":true},"unbind":{"fraudulent":{"send_warning":true}}} Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.ServerConfig - --- Server config --- Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.ServerConfig - Name: matrix.example.tld Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.ServerConfig - Port: 8090 Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.ServerConfig - Public URL: https://matrix.example.tld Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.sql.SqlConfig - --- Synapse SQL Provider config --- Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.sql.SqlConfig - Enabled: true Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.sql.SqlConfig - Type: sqlite Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.sql.SqlConfig - Has connection info? true Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.sql.SqlConfig - Auth enabled: false Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.sql.SqlConfig - Directory queries: {"name":{"type":"SELECT 1"},"threepid":{"type":"SELECT 1"}} Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.sql.SqlConfig - Identity type: mxid Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.sql.SqlConfig - 3PID mapping query: SELECT user_id AS uid FROM user_threepids WHERE medium = ? AND address = ? Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.sql.SqlConfig - Identity medium queries: {} Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.sql.SqlConfig - Profile: Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.sql.SqlConfig - Enabled: true Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.sql.SqlConfig - Display name query: SELECT displayname FROM profiles WHERE user_id = ? Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.sql.SqlConfig - Profile 3PID query: SELECT medium, address FROM user_threepids WHERE user_id = ? Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.ViewConfig - --- View config --- Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.config.ViewConfig - Session: {"local":{"on_token_submit":{}},"on_token_submit":{"failure":"classpath:/templates/session/tokenSubmitFailure.html","success":"classpath:/templates/session/tokenSubmitSuccess.html"}} Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO com.j256.ormlite.table.TableUtils - creating table 'invite_3pid' Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO com.j256.ormlite.table.TableUtils - executed create table statement changed 0 rows: CREATE TABLE IF NOT EXISTS invite_3pid (id VARCHAR , token VARCHAR NOT NULL , sender VARCHAR NOT NULL , medium VARCHAR NOT NULL , address VARCHAR NOT NULL , roomId VARCHAR NOT NULL , properties VARCHAR , PRIMARY KEY (id) ) Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO com.j256.ormlite.table.TableUtils - creating table 'session_3pid' Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO com.j256.ormlite.table.TableUtils - executed create table statement changed 0 rows: CREATE TABLE IF NOT EXISTS session_3pid (id VARCHAR , creationTime BIGINT NOT NULL , server VARCHAR NOT NULL , medium VARCHAR NOT NULL , address VARCHAR NOT NULL , secret VARCHAR NOT NULL , attempt INTEGER NOT NULL , nextLink VARCHAR , token VARCHAR NOT NULL , validated BOOLEAN , validationTime BIGINT , isRemote BOOLEAN NOT NULL , remoteServer VARCHAR , remoteId VARCHAR , remoteSecret VARCHAR , remoteAttempt INTEGER , isRemoteValidated BOOLEAN NOT NULL , PRIMARY KEY (id) ) Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO com.j256.ormlite.table.TableUtils - creating table 'as_txn' Apr 27 16:43:01 matrix mxisd[16617]: [main] INFO com.j256.ormlite.table.TableUtils - executed create table statement changed 0 rows: CREATE TABLE IF NOT EXISTS as_txn (transactionId VARCHAR , localpart VARCHAR , timestamp BIGINT NOT NULL , result VARCHAR NOT NULL , UNIQUE (transactionId,localpart) ) Apr 27 16:43:02 matrix mxisd[16617]: [MLog-Init-Reporter] INFO com.mchange.v2.log.MLog - MLog clients using slf4j logging. Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO com.mchange.v2.c3p0.C3P0Registry - Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10] Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.lookup.strategy.RecursivePriorityLookupStrategy - Found 3 providers Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.lookup.strategy.RecursivePriorityLookupStrategy - - io.kamax.mxisd.backend.sql.synapse.SynapseSqlThreePidProvider Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.lookup.strategy.RecursivePriorityLookupStrategy - - io.kamax.mxisd.lookup.provider.DnsLookupProvider Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.lookup.strategy.RecursivePriorityLookupStrategy - - io.kamax.mxisd.lookup.provider.ForwarderProvider Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.lookup.strategy.RecursivePriorityLookupStrategy - Recursive lookup enabled: true Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.lookup.strategy.RecursivePriorityLookupStrategy - 127.0.0.0/8 is allowed for recursion Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.lookup.strategy.RecursivePriorityLookupStrategy - 10.0.0.0/8 is allowed for recursion Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.lookup.strategy.RecursivePriorityLookupStrategy - 172.16.0.0/12 is allowed for recursion Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.lookup.strategy.RecursivePriorityLookupStrategy - 192.168.0.0/16 is allowed for recursion Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.lookup.strategy.RecursivePriorityLookupStrategy - ::1/128 is allowed for recursion Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.profile.ProfileManager - Profile Providers: Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.profile.ProfileManager - - SynapseSqlProfileProvider Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.notification.NotificationManager - --- Notification handler --- Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.invitation.InvitationManager - Loading saved invites Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.invitation.InvitationManager - Setting up invitation mapping refresh timer Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.directory.DirectoryManager - Directory providers: Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO io.kamax.mxisd.directory.DirectoryManager - - io.kamax.mxisd.backend.sql.synapse.SynapseSqlDirectoryProvider Apr 27 16:43:02 matrix mxisd[16617]: Apr 27, 2019 4:43:02 PM org.xnio.Xnio Apr 27 16:43:02 matrix mxisd[16617]: INFO: XNIO version 3.3.8.Final Apr 27 16:43:02 matrix mxisd[16617]: Apr 27, 2019 4:43:02 PM org.xnio.nio.NioXnio Apr 27 16:43:02 matrix mxisd[16617]: INFO: XNIO NIO Implementation Version 3.3.8.Final Apr 27 16:43:02 matrix mxisd[16617]: [main] INFO App - ------------- mxisd started ------------- Apr 27 16:43:49 matrix mxisd[16617]: [XNIO-1 task-1] INFO io.kamax.mxisd.session.SessionManager - Server 10.255.136.30 is asking to create session for io.kamax.matrix.ThreePid@9b8ade28 (Attempt #1) - Next link: null Apr 27 16:43:49 matrix mxisd[16617]: [XNIO-1 task-1] INFO io.kamax.mxisd.session.SessionManager - No existing session for io.kamax.matrix.ThreePid@9b8ade28 Apr 27 16:43:49 matrix mxisd[16617]: [XNIO-1 task-1] INFO io.kamax.mxisd.session.SessionManager - Generated new session 1556383429343 to validate io.kamax.matrix.ThreePid@9b8ade28 from server 10.255.136.30 Apr 27 16:43:49 matrix mxisd[16617]: [XNIO-1 task-1] INFO io.kamax.mxisd.session.SessionManager - Stored session 1556383429343 Apr 27 16:43:49 matrix mxisd[16617]: [XNIO-1 task-1] INFO io.kamax.mxisd.session.SessionManager - Session 1556383429343 for io.kamax.matrix.ThreePid@9b8ade28: sending validation notification Apr 27 16:43:49 matrix mxisd[16617]: [XNIO-1 task-1] INFO io.kamax.mxisd.http.undertow.handler.BasicHttpHandler - Request POST http://matrix.example.tld/_matrix/identity/api/v1/validate/email/requestToken - Error M_NOT_IMPLEMENTED: email is not a supported 3PID medium type

mxisd.yaml

matrix: domain: 'matrix.example.tld'

key: path: '/var/lib/mxisd/keys'

storage: provider: sqlite: database: '/var/lib/mxisd/mxisd.db'

synapseSql: enabled: true type: sqlite connection: /var/lib/matrix-synapse/homeserver.db

threepid: medium: email: identity: from: 'identity@example.tld' name: 'My Identity Server' connectors: smtp: host: 'mx01.example.tld' port: 25 tls: 1 generator: 'template' msisdn: connector: 'twilio' generator: 'template' dns: overwrite: homeserver: client:

notification: handler: email: 'raw'

register: policy: threepid: email: domain: whitelist:

homeserver.yaml

server_name: "matrix.example.tld"

pid_file: "/var/run/matrix-synapse.pid"

public_baseurl: https://matrix.example.tld/

listeners:

admin_contact: 'mailto:admin@example.tld'

acme:

database: name: "sqlite3" args: database: "/var/lib/matrix-synapse/homeserver.db"

log_config: "/etc/matrix-synapse/log.yaml"

media_store_path: "/var/lib/matrix-synapse/media"

uploads_path: "/var/lib/matrix-synapse/uploads"

max_upload_size: 500M

max_image_pixels: 32M

dynamic_thumbnails: true

url_preview_enabled: true

url_preview_ip_range_blacklist:

max_spider_size: 100M

turn_uris: [ "turn:turn.example.tld:3478?transport=udp", "turn:turn.example.tld:3478?transport=tcp" ]

turn_shared_secret: "xyz"

turn_user_lifetime: 86400000

enable_registration: true

registrations_require_3pid:

registration_shared_secret: "xyz"

allow_guest_access: false

default_identity_server: https://matrix.example.tld

trusted_third_party_id_servers:

signing_key_path: "/etc/matrix-synapse/homeserver.signing.key"

password_config:

email: enable_notifs: false smtp_host: "localhost" smtp_port: 25 smtp_user: "exampleusername" smtp_pass: "examplepassword" require_transport_security: False notif_from: "Your Friendly %(app)s Home Server noreply@example.com" app_name: Matrix notif_template_html: notif_mail.html notif_template_text: notif_mail.txt notif_for_new_users: True riot_base_url: "https://riot.example.tld"

push: include_content: true

user_directory: enabled: true search_all_users: false

reverse proxy:

server { listen 80; server_name matrix.example.tld; return 301 https://$server_name$request_uri; }

server { listen 443 ssl; listen [::]:443 ssl; server_name matrix.example.tld;

ssl_certificate /etc/letsencrypt/live/matrix.example.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/matrix.example.tld/privkey.pem;

# If you don't wanna serve a site, comment this out
root /var/www/html;
index index.html index.htm;
client_max_body_size 1024M;

location ^/_matrix/client/r0/register/[^/]/?$ { proxy_pass http://10.255.136.20:8090; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; }

location ~* ^/_matrix/client/r0/rooms/([^/]+)/invite$ {
proxy_pass              http://10.255.136.20:8090;
proxy_set_header    Host $host;
proxy_set_header    X-Forwarded-For $remote_addr;
}

location /_matrix/identity { proxy_pass http://10.255.136.20:8090/_matrix/identity; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; }

location /_matrix {
  proxy_pass http://10.255.136.20:8008;
  proxy_set_header X-Forwarded-For $remote_addr;
}

}

maxidorius commented 5 years ago

Since you are not using multi-line code markup on the configs and all the logs, it's not possible to know with certainty but the indentation in the SMTP and/or email section is most likely wrong and those settings are not picked up.

Takalele commented 5 years ago

youre right, thank you!