Would that not be akin to a nologin shell? Set the user home to /var/postfix/virtual/example.net/usename on creation.
useradd -d /var/postfix/virtual/example.net/username -s /sbin/nologin username Personally I prefer /home/example.net/username but. Bypassing creating a link from /home/username to the /var.... User can then be verfied by the system for mails but can't actually access the system. Dovecot/postfix reads the home dir and delivers mail where required. Again I'm sure there are other more experienced admins..... On 2 January 2026 19:35:39 GMT, David Myers via dovecot <[email protected]> wrote: 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/example.net/[user <[1]http://example.net/user>Name] ). 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 <[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/main.cf: ``` virtual_mailbox_domains = 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: ``` [email protected] example.net/user ``` Which means that rather than being set up as a linux user with a /home directory, [email protected] should have a virtual mailbox in /var/postfix/virtual/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: 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/mail.example.com/fullchain.pem dh_file = /usr/share/dovecot/dh.pem key_file = /etc/letsencrypt/live/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/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 -- [email protected] To unsubscribe send an email to [email protected] References Visible links 1. http://example.net/user
_______________________________________________ dovecot mailing list -- [email protected] To unsubscribe send an email to [email protected]
