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

Add a plugin to auto-populate the identities with all mail aliases connected to mail account #100

Open
randomcop opened this issue Jan 21, 2020 · 6 comments

Comments

@randomcop
Copy link

/* thou shallst not use other peoples sender addresses */

Hi. You wrote in the FAQ that one can make suggestions for enhancements / additional plugins.
So here I go :-)

Roundcube in its preferences section allows the logged in mail user to add additional mail aliases. Depending on the following RC settings the user has full control over his identities or only restricted access.

// Set identities access level:
// 0 - many identities with possibility to edit all params
// 1 - many identities with possibility to edit all params but not email address
// 2 - one identity with possibility to edit all params
// 3 - one identity with possibility to edit all params but not email address
// 4 - one identity with possibility to edit only signature
//$config['identities_level'] = 0;

The problem is, that when you allow your users to have "many identities with possibility to edit all params" you basically allow them to choose any mail address, that of other users without their consent, or even mail addresses which your mail server is not supposed to be an origin of - leading for your mail service to gain bad reputation.

It would be nice to have a plugin that on each login of a mail user in RC does an SQL connect/search to the ispconfig DB, fetches the configured aliases of the the user / mail account and populates the RC identities with it.

You then as admin would set identities_level to value 1, so they can edit the description/name of each auto-populated identity on their own. If an alias connected to an account is deleted, the next time the user logs in the obsolete identity is then also deleted.

I think there is demand for such a plugin.

@horfic
Copy link
Contributor

horfic commented Jul 29, 2020

Hi,
i do not want to spoil you, but thats already available in the "ispconfig3_account" like years.

You need to install it and set the plugin config parameter "identity_limit" to "true".
Also you need to set "identities_level" to "0" or "2"

This will replace the input field with a dropdown of all aliases the user is linked to

@TonyGravagno
Copy link

I was just looking for the same functionality. I mistakenly mentioned this in #110, moving notes here.

According to @horfic I set the following:

In /usr/share/roundcube/plugins/ispconfig3_account/config/config.inc.php
$config['identity_limit'] = true;

In /etc/roundcube/config.inc.php
$config['identities_level'] = 0; ... also tried 2.

Settings > Account > General shows linked addresses.
In ISPConfig, Send-As is checked in all Email Aliases, and the addresses are Active.

But in Compose, there is no dropdown list on the From field.

I restarted the server in case the configs needed to be reloaded.
I cleared browser cache for the domain.
I do not have any browser ad-blocking active for this site.
I tried both Firefox and Chrome with same results.
I do not see any issues on this open in the Roundcube repo.

I've tried debugging Roundcube but I don't see anything in /var/log/roundcube/*.

$config['debug_level'] = 1;
$config['smtp_debug'] = true;
$config['log_logins'] = true;
$config['session_debug'] = true;
$config['sql_debug'] = true;
$config['imap_debug'] = true;

On opening Compose, the sql.log shows:

SELECT * FROM identities WHERE del <> 1 AND user_id = '8' ORDER BY standard DESC, name ASC, email ASC, identity_id ASC;

There are many of these over time.

SELECT * FROM users WHERE user_id = '8';

So it looks like queries are being made but I can't say what the results are or what's happening to results after they are received.

Is my expectation incorrect?
Please verify if you see a dropdown list for linked identity/aliases.
Please recommend other details that I can check for this.
Thanks!

@Churro
Copy link
Contributor

Churro commented Dec 2, 2020

@TonyGravagno :
In many settings it is undesired that regular users can change the email address associated to their account, e.g., there is probably just one address and it shouldn't be changed. However, if you create an alias for that user in ISPconfig, you DO want the user to be able to use it. So how would tell Roundcube / the email user that another address can be used in addition?

This is what the identity_limit setting is there for. If you enable it, in Settings -> Identities you can pick an identity and then modify the email address that should be used when emails are sent using this identity. See the screenshot attached with dummy addresses for demo purposes.
2020-12-02 21_16_02-Window

So by selecting an address in this dropdown field (introduced by enabling identity_limit) you can set the email address associated with that identity, i.e., emails will be sent with the address you are selecting here.

However, Roundcube works such that you can only have multiple sender address (and choose while composing new emails) if there also multiple identities created in Roundcube. So you'd have to click the Create button on top, add another one and use the dropdown to select the desired sender addresss.

In other words: A setting that enables to pick from various email addresses configured in ISPconfig is not equivalent to automatically creating multiple identities. This feature is simply not existing so far but I can image the benefit it would add 👍

@TonyGravagno
Copy link

Ahhh, I understand now! Thank you VERY much. You're right and I've mis-posted to this thread too. Duh...

To rephrase and confirm: We are only displaying the aliases from ISPConfig, and the settings determine what we can change. Roundcube is working from identities, not aliases. I did not understand that and was expecting the aliases in the drop-down identity list during Compose. Now I understand the feature I've been hoping to see is auto-generation/sync of Roundcube identities with each ISPConfig alias.

For now I'll manually create the identities using the Create button. Later, I'll see if there is already a request for this and if not I'll create one and might try to add the feature.

@Churro
Copy link
Contributor

Churro commented Dec 2, 2020

As said, I see the motivation behind a plugin to automatically derive identities from ISPConfig aliases. The problem behind is mere semantic. Sometimes people make aliases just to be reachable by different addresses, e.g., f.lastname@.., f.l@..., support@..., and so on but do not actually intend to use this as distinct full identities in the way Roundcube understands it.

On the other hand, it would do no harm either if something like this existed because it would basically just extend the abilities and not limit them. Technically, it would be for sure doable.

@jnorell
Copy link

jnorell commented May 27, 2021

An implementation note, you might want to flag identities which were created automatically and re-check their validity periodically (at login or ??). Eg. if an alias existed in ISPConfig, was auto-created in roundcube, but later deleted in ISPConfig, it would be good to notice and clean that up.

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

5 participants