Hi,

I am trying to have a virtual user list in a passwd file (without linux user) 
but it does not seem to work.  
I have been trying to make this work for days reading the dovecot documentation 
and whatever I could find online...
Note that I did not enable imap since I only use pop3s to retrieve my emails.

I also tried to follow this guide:
   https://doc.dovecot.org/configuration_manual/howto/simple_virtual_install/

Note that once this works for dovecot, I plan to have postfix use the dovecot 
auth service to authenticate the virtual users and validate mail boxes.

# cat /proc/version
Linux version 6.1.0-17-cloud-amd64 (debian-ker...@lists.debian.org) (gcc-12 
(Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP 
PREEMPT_DYNAMIC Debian 6.1.69-1 (2023-12-30)

# dovecot version
   Feb 15 15:57:26 master: Info: Dovecot v2.3.19.1 (9b53102964) starting up for 
pop3, submission, lmtp

# doveconf -n
   # 2.3.19.1 (9b53102964): /etc/dovecot/dovecot.conf
   # Pigeonhole version 0.5.19 (4eae2f79)
   # OS: Linux 6.1.0-17-cloud-amd64 x86_64 Debian 12.5
   # Hostname: 85e10e78339f
   auth_verbose = yes
   debug_log_path = /dev/stdout
   first_valid_uid = 1000
   info_log_path = /dev/stdout
   last_valid_uid = 1000
   listen = *
   log_path = /dev/stdout
   login_greeting = greeting.
   mail_debug = yes
   mail_gid = 1000
   mail_home = /srv/vmail/%d/%n
   mail_location = maildir:~/mail
   mail_uid = 1000
   namespace {
     inbox = yes
     location =
     prefix =
     separator = /
   }
   passdb {
     args = username_format=%u /path/to/passwd
     driver = passwd-file
   }
   pop3_uidl_format = %g
   protocols = pop3 submission lmtp
   service auth {
     inet_listener {
       address = <ip>
       port = 12345
     }
     user = vmail
   }
   service lmtp {
     inet_listener lmtp {
       address = <ip>
       port = 12344
     }
     user = vmail
   }
   service pop3-login {
     client_limit = 1000
     process_min_avail = 1
     service_count = 0
   }
   service submission-login {
     client_limit = 1000
     process_min_avail = 1
     service_count = 0
   }
   ssl_cert = <cert.pem
   ssl_key = # hidden, use -P to show it
   userdb {
     args = username_format=%u /path/to/passwd
     default_fields = uid=vmail gid=vmail home=/srv/vmail/%d/%n
     driver = passwd-file
   }
   verbose_proctitle = yes
   local_name site1.com {
     ssl_cert = </etc/apache2/md-ssl/domains/site1.com/pubcert.pem
     ssl_key = # hidden, use -P to show it
   }
   local_name www.site1.com {
     ssl_cert = </etc/apache2/md-ssl/domains/site1.com/pubcert.pem
     ssl_key = # hidden, use -P to show it
   }

The passwd file:
   # user:password:uid:gid:(gecos):home:(shell):extra_fields
   us...@site1.com{PLAIN}password1::::::
   us...@site2.com{PLAIN}password2::::::

This is the log I am getting when trying to create an account with Thunderbird:
   Feb 15 15:57:26 master: Info: Dovecot v2.3.19.1 (9b53102964) starting up for 
pop3, submission, lmtp
   Feb 15 17:34:45 pop3-login: Info: Disconnected: Aborted login by logging out 
(no auth attempts in 0 secs): user=<>, rip=<ip>, lip=<ip>, TLS, 
session=<cMIeC28RVOImVwz3>
   Feb 15 17:35:02 auth: Info: 
passwd-file(us...@site1.com,<ip>,<AIAjDG8RVuImVwz3>): unknown user
   Feb 15 17:35:08 auth: Info: 
passwd-file(us...@site1.com,<ip>,<AIAjDG8RVuImVwz3>): unknown user
   Feb 15 17:35:10 pop3-login: Info: Disconnected: Aborted login by logging out 
(auth failed, 2 attempts in 8 secs): user=<us...@site1.com>, method=PLAIN, 
rip=<ip>, lip=<ip>, TLS, session=<AIAjDG8RVuImVwz3>

I tried using doveadm:
   # doveadm user user1

   userdb lookup: user user1 doesn't exist
   field   value

   # doveadm user us...@site1.com

   userdb lookup: user us...@site1.com doesn't exist
   field   value

I also tried with the verbose on (removed all the 'usually intentional'):

   # doveadm -Dv user us...@site1.com
   Feb 15 17:38:17 doveadm(us...@site1.com)<137><>: Debug: auth-master: userdb 
lookup(us...@site1.com): Started userdb lookup
   Feb 15 17:38:17 doveadm(us...@site1.com)<137><>: Debug: auth-master: conn 
unix:/run/dovecot/auth-userdb: Connecting
   Feb 15 17:38:17 doveadm(us...@site1.com)<137><>: Debug: auth-master: conn 
unix:/run/dovecot/auth-userdb (pid=7,uid=0): Client connected (fd=9)
   Feb 15 17:38:17 doveadm(us...@site1.com)<137><>: Debug: auth-master: userdb 
lookup(us...@site1.com): auth USER input:
   Feb 15 17:38:17 doveadm(us...@site1.com)<137><>: Debug: auth-master: userdb 
lookup(us...@site1.com): Userdb lookup failed

   userdb lookup: user us...@site1.com doesn't exist
   Feb 15 17:38:17 Debug: auth-master: conn unix:/run/dovecot/auth-userdb 
(pid=7,uid=0): Disconnected: Connection closed (fd=9)
   field   value

I could not find a way to list either the mailboxes or virtual user list that 
dovecot is using/serving.
_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to