I was wondering if this was a good use case for the creation of a user
   without a dedicated home directory.
   The user will not be able to 'log in' in the traditional way, but they
   would have an entry in /etc/passwd. Then you would only need to create a
   link from /home/user into your selected location (in your instance
   /var/postfix/virtual/[1]example.net/[userName] ).
   please note : this isn't something that I have done, but I'm sure there
   are other more experienced admins on this list that will pipe up if this
   is not a good solution, and explain why its not, and propose alternatives.

   Le mer. 31 dec. 2025 `a 09:55, animerrill--- via dovecot
   <[2][email protected]> a ecrit :

     > I simply define my virtual domains in Postfix:
     > ==============================
     > VIRTUAL DOMAINS
     > ==============================
     >
     > virtual_alias_domains = new.domain
     > virtual_alias_maps = hash:/etc/postfix/virtual
     > Then, in /etc/postfix/virtual, I add the alias:
     > [email protected]   newuser
     > And that's it.
     > Could you share your doveconf -n?

     That set up is different than what I am trying to achieve. You have a
     virtual alias set up, which redirects mail from an email address to an
     arbitrary linux user. I am trying to avoid creating linux users for
     every email account, which is why I need to be able to use dovecot's
     multiple authentication database feature to facilitate virtual
     mailboxes. Here is that section from my /etc/postfix/[3]main.cf:

     ```
     virtual_mailbox_domains = [4]example.net
     virtual_uid_maps = static:1001
     virtual_gid_maps = static:1001
     virtual_mailbox_base = /var/postfix/virtual
     virtual_mailbox_maps = hash:/etc/postfix/virtual/recipients
     virtual_alias_maps = hash:/etc/postfix/virtual/aliases
     virtual_alias_domains = hash:/etc/postfix/virtual/domains
     ```

     Then the mailbox is defined in /etc/postfix/virtual/recipients:

     ```
     [5][email protected]    [6]example.net/user
     ```

     Which means that rather than being set up as a linux user with a /home
     directory, [7][email protected] should have a virtual mailbox in
     /var/postfix/virtual/[8]example.net/user. This actually works as far as
     postfix is concerned, and as the root user I can peek in that folder to
     see a message sent to it from my personal email account. Then here is
     `doveconf -n`:

     ```
     # 2.4.1-4 (7d8c0e5759): /etc/dovecot/dovecot.conf
     # Pigeonhole version 2.4.1-4 (0a86619f)
     # OS: Linux 6.12.57+deb13-amd64 x86_64 Debian 13.2
     # Hostname: [9]example.com
     dovecot_config_version = 2.4.1
     auth_mechanisms = plain login
     auth_username_format = %{user}
     dovecot_storage_version = 2.4.1
     mail_driver = sdbox
     mail_inbox_path = ~/Mail/Inbox
     mail_path = ~/Mail
     protocols = imap
     ssl = required
     ssl_server {
       cert_file = /etc/letsencrypt/live/[10]mail.example.com/fullchain.pem
       dh_file = /usr/share/dovecot/dh.pem
       key_file = /etc/letsencrypt/live/[11]mail.example.com/privkey.pem
       prefer_ciphers = server
     }
     userdb passwd-file {
       passwd_file_path = /etc/dovecot/passwd/%{user | domain}
     }
     userdb passwd {
     }
     passdb passwd-file {
       passwd_file_path = /etc/dovecot/passwd/%{user | domain}
     }
     passdb pam {
     }
     namespace inbox {
       inbox = yes
       mailbox Drafts {
         auto = subscribe
         special_use = "\\Drafts"
       }
       mailbox Junk {
         auto = subscribe
         autoexpunge = 30d
         special_use = "\\Junk"
       }
       mailbox Sent {
         auto = subscribe
         special_use = "\\Sent"
       }
       mailbox Trash {
         special_use = "\\Trash"
       }
       mailbox Archive {
         special_use = "\\Archive"
       }
     }
     service auth {
       unix_listener /var/spool/postfix/private/auth {
         group = postfix
         mode = 0660
         user = postfix
       }
     }
     protocol lda {
       mail_plugins = sieve
     }
     protocol lmtp {
       mail_plugins = sieve
     }
     protocol pop3 {
       pop3_no_flag_updates = yes
       pop3_uidl_format = UID%{uid}-%{uidvalidity}
     }
     sieve_script default {
     }
     ```

     Basically the problem is that this virtual mailbox user has a mailbox
     that receives mail, but the user cannot log onto their account with an
     email client. My guess is that I either have misconfigured the `userdb`
     and/or `passdb` entries in the dovecot.conf file, or the passwd-file at
     /etc/dovecot/passwd/[12]example.net I created is not formatted
     correctly, because the ultimate problem is that the system cannot
     authenticate the user when they attempt to connect via imap/smtp. From
     all of the documentation and help threads referenced in my first
     message, I cannot tell what I've done wrong and I'm at a total loss.

     Thanks for the prompt reply. This is my first time using one of these
     mail lists, so I did not see you responded right away.
     _______________________________________________
     dovecot mailing list -- [13][email protected]
     To unsubscribe send an email to [14][email protected]

References

   Visible links
   1. http://example.net/user
   2. mailto:[email protected]
   3. http://main.cf/
   4. http://example.net/
   5. mailto:[email protected]
   6. http://example.net/user
   7. mailto:[email protected]
   8. http://example.net/user
   9. http://example.com/
  10. http://mail.example.com/fullchain.pem
  11. http://mail.example.com/privkey.pem
  12. http://example.net/
  13. mailto:[email protected]
  14. mailto:[email protected]
_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to