I am working on my own email client app. And currently, when a user adds a new mailbox, I make them to input IMAP server name manually (say, imap.gmail.com). By I've notices that there are mail client apps that somehow figure out the correct IMAP server name automatically.
So the question is, is there any database or something, that would take login as input and return IMAP server name as output?
If this is important, I am using Python (Django) and MySQL on the backend.
There is/was such a database, yes. Mozilla operates/operated it, for Thunderbird and I think most others copy the approaches usied in Thunderbird's source code.