Yes I had thought of that idea too ... but I have a preference for creating the home then adding in a link to the required location.
It creates the opportunity for creating an 'actual' home in the future if required.
Le ven. 2 janv. 2026 à 22:12, Chris Twinn <chris@twinn.co.uk> a écrit :
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 < dovecot@dovecot.org> 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 <http://example.net/%5Buser> <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 déc. 2025 à 09:55, animerrill--- via dovecot <dovecot@dovecot.org> a écrit :
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: newuser@new.domain 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/domainsThen the mailbox is defined in /etc/postfix/virtual/recipients:
user@example.net example.net/userWhich means that rather than being set up as a linux user with a /home directory, user@example.net 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
userdband/orpassdbentries 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 -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
Yes I had thought of that idea too ... but I have a preference for creating the home then adding in a link to the required location. It creates the opportunity for creating an 'actual' home in the future if required. Le ven. 2 janv. 2026 `a 22:12, Chris Twinn <[1]chris@twinn.co.uk> a ecrit :
Would that not be akin to a nologin shell?
Set the user home to /var/postfix/virtual/[2]example.net/usename on
creation.
useradd -d /var/postfix/virtual/[3]example.net/username -s
/sbin/nologin username
Personally I prefer /home/[4]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
<[5]dovecot@dovecot.org> 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/[6]example.net/[user <[7]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 <[8]dovecot@dovecot.org> 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: newuser@new.domain 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/[9]main.cf:
virtual_mailbox_domains = [10]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:
[11]user@example.net [12]example.net/user
Which means that rather than being set up as a linux user with a /home
directory, [13]user@example.net should have a virtual mailbox in
/var/postfix/virtual/[14]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: [15]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/[16]mail.example.com/fullchain.pem
dh_file = /usr/share/dovecot/dh.pem
key_file = /etc/letsencrypt/live/[17]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/[18]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 -- [19]dovecot@dovecot.org To unsubscribe send an email to [20]dovecot-leave@dovecot.org
References
Visible links
- mailto:chris@twinn.co.uk
- http://example.net/usename
- http://example.net/username
- http://example.net/username
- mailto:dovecot@dovecot.org
- http://example.net/%5Buser
- http://example.net/user
- mailto:dovecot@dovecot.org
- http://main.cf/
- http://example.net/
- mailto:user@example.net
- http://example.net/user
- mailto:user@example.net
- http://example.net/user
- http://example.com/
- http://mail.example.com/fullchain.pem
- http://mail.example.com/privkey.pem
- http://example.net/
- mailto:dovecot@dovecot.org
- mailto:dovecot-leave@dovecot.org