问题原文
原帖链接 · shavit · CC BY-SA 3.0
I've setup Postfix and Dovecot on my Ubuntu Server. My aim is to create 27 mail accounts that can receive and send mail to everywhere. I've got emails to not show up as spam in Gmail, Yahoo and Outlook. I send emails with Rainloop and everything is just fine. Except;
The system shouldn't have so many users. As I'm writing, I have 6 users on this system except for my personal sudo user and the root user. I give people access to receive and send emails by creating Linux users for them and giving them the credentials.
I can't imagine big email services like Yahoo have over ten million system users, there must be a solution lets me connect Postfix/Dovecot to a database (probably MySQL?) that has all the email users stored in instead of creating so many Linux users.
So basically, how would I setup what I wrote in the last paragraph without losing existing data? I don't have much received emails on the server, but losing data is bad practice and preventing it is always nice.
Thanks!
已采纳解答
原帖链接 · Pozzo-Balbi · CC BY-SA 3.0
Honest advice, use normal user accounts and let your Linux system authenticate the users. This is easy to manage and very secure. I don't want to say that other systems are insecure but I trust my Linux system when it comes to storing and authenticating passwords. I use these commands to create users manually. This way they can do no harm on my system.
useradd -d /home/username -g 515 -u 603 -s /sbin/nologin username
echo 12345678 | passwd user --stdin
-g 515 is your groupid for mail users
-u 603 needs to be incremeted by one for each user you create
This deletes the user
userdel -f username
Then append to the file /etc/postfix/virtual your users as
[email omitted] username
This is the part I use in master.cf
submission inet n - n - - smtpd
-o smtpd_helo_required=no
-o smtpd_tls_wrappermode=no
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o smtpd_recipient_restrictions=reject_non_fqdn_recipient,permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING
-o smtpd_sasl_type=dovecot
-o smtpd_sasl_path=private/auth
-o smtpd_sasl_security_options=noanonymous
Run the following commands after adding or removing a user
postmap /etc/postfix/virtual
service postfix restart
(The last command may be different on not RHEL clones, e.g. Ubuntu. Not sure, don't use it.). And have in your /etc/postfix/main.cf the following settings
virtual_alias_maps = hash:/etc/postfix/virtual
Don't forget to increase in dovecot the mail_max_userip_connections variable, see Dovecot ignoring maximum number of IMAP connections .
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
