Hello,
IMAP/SMTP usernames on my server are in form user_domain.tld. When
this user first time log in to RoundCube, new identy for him is
created with default e-mail adress in form user_domain.tld@localhost,
which is unfortunately not accepted by SMTP server (because this user
does not exist). So my question is, if there is any way to change this
behavior (just pick IMAP username and substitute _ by @).
Thank you very much for your help.
Martin
Just set $rcmail_config['username_domain'] to the domain in /config/main.inc.php.
It depends on your rc config and your mail server.
Most mail servers work with aliases.
So the server knows "user" is "
[email protected]".
Take a look at your mail server how it handles this.
Rgds.
skaero: Thank you for your reply. I think, that this did not help, because with this change e-mail addresses will be in form username_domain.tld@
, am I right? Additionally, my server is handling multiple domains.
oldschool: Thank you for your reply too. My server is configured to accept all localhost relaying (without authentication), but e-mail address in FROM must exist in its database, so e-mail addresses must be in correct form, otherwise MTA will refuse to handle it. I think, that this is the correct behaviour.
I really need to overwrite IMAP login which is in form username_domain.tld to [email protected]. I am able to write some PHP code that will make this overwrite thing, but writing whole plugin (using hooks and etc) is out of my universe. So if there is someone who was so kind and write skeleton of plugin that will bypass creating new user, it would be very grateful. Or is there any other way to do this?
Thank you very much
Hi!
Take a look at the rc sql database.
There's an alias for each user.
Maybe it could help you...
Rgds.
oldschool: Yes, I can change e-mail address directly in database, but it have to be done via external script or manually and this solution is not very clean...
It is very difficult to help when the running system is unknown...
Take a look at the "virtuser_file"-plugin.
I use it, too.
Rgds.
You can set $rcmail_config['username_domain'] with the following options:
%h - user's IMAP hostname
%n - http hostname ($_SERVER['SERVER_NAME'])
%d - domain (http hostname without the first part)
%z - IMAP domain (IMAP hostname without the first part)