大网数据广告活动
服务器运维问答

How do I generate Maildir/ and associated files in a user's home directory before they log in?

· 52CE 我爱测

Currently, a user's Maildir/ is not created for them until they log into the system for the first time. Is there a dovecot script I can run to make this happen before they log in to the machine? I know about /etc/skel but I'm not…

问题原文

原帖链接 · StevieD · CC BY-SA 4.0

Currently, a user's Maildir/ is not created for them until they log into the system for the first time. Is there a dovecot script I can run to make this happen before they log in to the machine? I know about /etc/skel but I'm not sure this is appropriate to use for this situation. I'd prefer to have dovect set up the correct files.

已采纳解答

原帖链接 · anx · CC BY-SA 4.0

dovecot ships a maildirmake utility for use in scripts, and doveadm mailbox does work with the -A flag to affect all users. For the former, you need to pay attention to file ownership and permissions, for the latter you need to ensure that your passdb driver gets an appropriate user list (or else you would create Maildirs for system users not intended to ever receive mail!).

I am not aware of a way to have the folders marked for autocreation also created on access via doveadm, but if its just the INBOX folder, either should work for you.

That being said, I believe there is little reason to manually create folders. If mail arrives, dovecot will create the destination mailbox (though, if sieve processes the mail, this may have to be explicitely specified). If a user logs in, all configured folders will be created according to their autocreate flag. Why would a user need to have these folders before accessing IMAP or receiving mail?

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-10-01)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。