Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: making it possible for each user to set any string as his IMAP/SMTP user name #458

Closed
yasuhirokimura opened this issue Jul 18, 2022 · 9 comments

Comments

@yasuhirokimura
Copy link

yasuhirokimura commented Jul 18, 2022

Currently there is an assumption about user names of IMAP and SMTP that they are either mail address itself ([email protected]) or user part of it (foo). But there are cases that don't meet it. While "Custion Login Mapping" extension can handle some of such cases, it also set the restriction that both user names must be same. As a result, SnappyMail can't handle following case.

  1. User names of IMAP and SMTP are different.
  2. At lease one of them is neither mail address itself nor user part of it.

Actually I have faced such case about mail address of open source project that I'm a member of. So I'd like to request new feature that makes it possible for each user to set any string as his IMAP/SMTP user name.

@the-djmaze
Copy link
Owner

To solve the issue (and different password for SMTP) i think this should solve that:

  1. Admin -> Domains -> Domain -> SMTP: add checkbox "ask username/password"
  2. When sending message: popup ask the username/password (when not known yet)
  3. On success: store username/password encrypted

@yasuhirokimura
Copy link
Author

To solve the issue (and different password for SMTP) i think this should solve that:

  1. Admin -> Domains -> Domain -> SMTP: add checkbox "ask username/password"
  2. When sending message: popup ask the username/password (when not known yet)
  3. On success: store username/password encrypted

This is also necessary for IMAP as it is possible that user name of IMAP isn't either mail address itself or user part of it.

@the-djmaze
Copy link
Owner

This is also necessary for IMAP as it is possible that user name of IMAP isn't either mail address itself or user part of it.

That's not possible because the login is the IMAP login

@yasuhirokimura
Copy link
Author

yasuhirokimura commented Aug 2, 2022

That's not possible because the login is the IMAP login

Then how about providing following steps?

  1. Admin -> Domains -> Domain -> IMAP: add checkbox "ask username/password"
  2. On login page user types email address and password.
  3. If it is first time user logins with the specified emal address and checkbox of step 1 is enabled, ask for user name providing email address itself as default value (It may be better if it is configurable on admin control panel which email address itself or user part of it is used as default value).
  4. Try IMAP login with user name and password provided by step 2 and 3.
  5. If step 4 succeeds, then save email address and user name, and use them next time user logins with same email address.
  6. Otherwise return to step 2.

@the-djmaze
Copy link
Owner

Thinking about this, it could be made possible as plugin.
The plugin (just like de two factor plugin) add an input field to the login screen to handle this.

@ionoci
Copy link

ionoci commented Dec 7, 2022

Hi,
I got the same issue. My mail hoster uses two different logins for imap and for smtp. They are not corresponiding to the email adress. It looks like this:
Adress: [email protected]
Imap User: a12345_xyz
Smtp User: a12345_xyz@mail

Any Idea how I may manage this?
Thanks in advance and thanks for this nice webmailer.

Io

@the-djmaze
Copy link
Owner

Hi, I got the same issue.
Imap User: a12345_xyz
Smtp User: a12345_xyz@mail

That's not the same issue.
Admin -> Domains -> Domain -> Imap: Use short login

@the-djmaze
Copy link
Owner

the-djmaze commented Feb 1, 2023

Added a new plugin named "Login Override" for next v2.25.2
It has two mapping options: IMAP and SMTP

Each line in the field will be like [email protected]:user1:password1

  • [email protected] the currently used email address to login with
  • user1 when set it will be used for IMAP or SMTP login
  • password1 when set it will be used for IMAP or SMTP login

[email protected]::password1 will use the default login name
[email protected]:user1: will use the default login password

Why v2.25.2? Well i've modified the config options system to allow storing encrypted values.
As the mapping contains sensitive login credentials it will be stored encrypted.

@the-djmaze
Copy link
Owner

I've made some example plugin for an SMTP settings page for users.
Maybe it helps.

smtp-settings.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants