I believe that JMAP should honor autocreate and the fact that it doesn't seems to be an oversight.
On 7/22/21 3:55 PM, David Luong wrote:
Hi Ken.This is excellent news!Another JMAP related issue I'd like your comment on. I have enabled autocreate_inbox_folders in Cyrus IMAP but when the user is logged in via JMAP interface, the user's mailbox is not created. Instead, 500 Internal Server Error is returned. See log below. If I use IMAP protocol to login, the mailbox is auto created. Should JMAP behave the same way?JMAP:Jul 22 19:03:43 rms01i.example.com cyrus/http[858045]: http_auth: found matching scheme: BasicJul 22 19:03:43 rms01i.example.com cyrus/http[858045]: login: [172.25.57.162] 15554441001 Basic User logged in SESSIONID=<cyrus-1626980623-858045-1-6232473965603291866>Jul 22 19:03:43 rms01i.example.com cyrus/http[858045]: sqldb_exec(/var/lib/imap/user/q/15554441001.dav): PRAGMA foreign_keys = ON;Jul 22 19:03:43 rms01i.example.com cyrus/http[858045]: sqldb_exec(/var/lib/imap/user/q/15554441001.dav): PRAGMA secure_delete = OFF;Jul 22 19:03:43 rms01i.example.com cyrus/http[858045]: sqldb_exec(/var/lib/imap/user/q/15554441001.dav): PRAGMA temp_store = 2;Jul 22 19:03:43 rms01i.example.com cyrus/http[858045]: sqldb_exec(/var/lib/imap/user/q/15554441001.dav): PRAGMA user_version;Jul 22 19:03:43 rms01i.example.com cyrus/http[858045]: could not autoprovision calendars for userid 15554441001: Invalid userJul 22 19:03:43 rms01i.example.com cyrus/http[858045]: auth_success returned error: 500 Internal Server ErrorJul 22 19:03:43 rms01i.example.com cyrus/http[858045]: auth failed - reinitJul 22 19:03:43 rms01i.example.com cyrus/http[858045]: write_body(code = -1964266955, flags.te = 0, len = 489)Jul 22 19:03:43 rms01i.example.com cyrus/http[858045]: simple_hdr(Date: Thu, 22 Jul 2021 19:03:43 GMT)Jul 22 19:03:43 rms01i.example.com cyrus/http[858045]: simple_hdr(Connection: Upgrade)Jul 22 19:03:43 rms01i.example.com cyrus/http[858045]: simple_hdr(Upgrade: h2c)Jul 22 19:03:43 rms01i.example.com cyrus/http[858045]: simple_hdr(Vary: Accept-Encoding)Jul 22 19:03:43 rms01i.example.com cyrus/http[858045]: simple_hdr(Content-Type: text/html; charset=utf-8)Jul 22 19:03:43 rms01i.example.com cyrus/http[858045]: simple_hdr(Content-Length: 489)Jul 22 19:03:43 rms01i.example.com cyrus/http[858045]: [172.25.57.162] as "15554441001" with "curl/7.54.0" via SESSIONID=<cyrus-1626980623-858045-1-6232473965603291866>; "POST /jmap/ HTTP/1.1" => "HTTP/1.1 500 Internal Server Error" (error=The server encountered an internal error.) [timing: cmd=0.017799 net=0.000000 total=0.017799]IMAP:Jul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: accepted connectionJul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: extractor_init(0x55749ef10b90)Jul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: SASL sql plugin Parse the username 15554441001Jul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: SASL sql plugin try and connect to a hostJul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: SASL sql plugin trying to open db 'imap_dbJul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: SASL begin transactionJul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: SASL sql plugin create statement from userPasswordJul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: SASL sql plugin doing query SELECT password FROM imap_users WHERE username = '15554441001@xxxxxxxxxxxxxxxxxx';Jul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: SASL sql plugin: no result foundJul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: SASL commit transactionJul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: SASL sql plugin Parse the username 15554441001Jul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: SASL sql plugin try and connect to a hostJul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: SASL sql plugin trying to open db 'imap_dbJul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: login: pool-10-12-92-29.iot1.com [10.12.92.29] 15554441001 PLAIN User logged in SESSIONID=<cyrus-1626980690-858059-1-16985860205569064466>Jul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: autocreateinbox: autocreate inbox for user 15554441001 was calledJul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: autocreateinbox: User 15554441001, INBOX was successfully createdJul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: autocreateinbox: User 15554441001, subfolder default creation succeeded.Jul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: User 15554441001, Inbox subfolders, created 1, subscribed 0Jul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: USAGE 15554441001 user: 0.019144 sys: 0.010459Jul 22 19:04:50 rms01i.example.com cyrus/imap[858059]: extractor_destroy(0x55749ef16930)
-- Kenneth Murchison Senior Software Developer Fastmail US LLC