Author Topic: Configuration smtp_user & smtp_pass  (Read 1852 times)

Offline inomi13

  • Newbie
  • *
  • Posts: 3
Configuration smtp_user & smtp_pass
« on: October 07, 2023, 02:10:27 PM »
On my development server (Centos 7 + Postfix + Dovecot). I set it up in the dovecote Disable_plaintext_auth = no, auth_mechanisms = plain login. I have a default configuration and smpt runs on port 25 and imap runs on port 143. Could someone explain to me why smpt works without entering the user password? is fine?

On my server I have only one domain and unix users so now I can login to roundcube via user and I don't must write domain but how to do  require write domain name ?

« Last Edit: October 07, 2023, 02:15:24 PM by inomi13 »

Offline Dmitry42

  • Full Member
  • ***
  • Posts: 232
Re: Configuration smtp_user & smtp_pass
« Reply #1 on: October 08, 2023, 08:27:02 AM »
it depends from your SMTP server settings. I think by default its open for all.
It you use POSTFIX - check (google about and examples) /etc/postfix/main.cf for any settings and restrictions.

Offline inomi13

  • Newbie
  • *
  • Posts: 3
Re: Configuration smtp_user & smtp_pass
« Reply #2 on: October 08, 2023, 02:15:30 PM »
Thanks for you advise.  I have installed certificate SSL on domain main.example.com so when I have added below imap configuration test is ok and roundcube works. enter image description here When I write username and password I can login but I don't know why I don't have to write full username with domain ?

Second of my problem is after login I see user in domain mail.example.com but I want to domain example.com. When I add parametr in config.inc.php $config['username_domain'] ='example.com'; then I can't be able to log to roundcube.
« Last Edit: October 09, 2023, 10:38:03 AM by inomi13 »

Offline Dmitry42

  • Full Member
  • ***
  • Posts: 232
Re: Configuration smtp_user & smtp_pass
« Reply #3 on: October 09, 2023, 02:20:16 PM »
Quote
When I write username and password I can login but I don't know why I don't have to write full username with domain ?


It's depend from your IMAP server settings. I think by default your IMAP server setting just used name without domain part, so RC can login to IMAP just by name.

-----------

Quote
Second of my problem is after login I see user in domain mail.example.com but I want to domain example.com. When I add parametr in config.inc.php $config['username_domain'] ='example.com'; then I can't be able to log to roundcube.

Yes you can't login because:
You have server mail.examlpe.com with local unix users - so your users will have logins like user@mail.example.com or mail.example.com\user - that you see when you login with username.

$config['username_domain'] ='example.com' Automatically add this domain to user names for login. And  when your RC (roundcube) try login to IMAP server your login looks like: user@example.com - but its not look like existing users from step 1 (user@mail.example.com) and your IMAP not setup for using full mail name as login - so this 2 reason why you have error.

-----------

I think you need 2 next step (not sure all is correct, but may be)

1. Change OS hostname from mail.example.com to example.com - so your users will have logins like user@example.com Instead of user@mail.example.com . I hope its worked )
2. Setup your IMAP (dovecot) for login users by full name with domain only. Think it can be somewhere like /ect/dovecot/auth-system.conf.ext or similar place.

P.S.
may be better way will be find (google) tutorial "how to setup imap+smtp+dovecot server" with examples.

Offline inomi13

  • Newbie
  • *
  • Posts: 3
Re: Configuration smtp_user & smtp_pass
« Reply #4 on: October 11, 2023, 06:14:10 AM »
thanks for your advice. I have found solution of my an issue so In file /etc/dovecot/conf.d/10-auth.conf I have changed parameter to auth_username_format = %{if;%d;eq;example.com;%Ln} and now who want to login has to write exacly this domain.

This solution has one bug because who want give roundcube access to change password to unix user must add parametr $username = strstr($username, '@', true);  in /var/www/html/roundcubemail/plugins/password/drivers/chpasswd.php