Construct a virtual domain email server unrelated to the System user

Source: Internet
Author: User
Tags email account
Article Title: Construct a virtual domain email server unrelated to the System user. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Operating System: FreeBSD 4-stable
  
Update ports
  
Cvsup-gL 2-h cvsup.freebsdchina.org/usr/share/examples/cvsup/ports-supfile
  
Install the apache server
  
Cd/usr/ports/www/apache2/
Make install clean
  
Install openwebmail. Add WITH_QUOTA to prepare for the disk quota in the future.
  
Cd/usr/ports/mail/openwebmail/
Make WITH_QUOTA = yes install clean
  
Install postfix, and answer all questions during the process y
  
Cd/usr/ports/mail/postfix/
Make install clean
  
Modify:
/Etc/rc. conf
  
Join:
  
Sendmail_enable = "YES"
Sendmail_flags = "-bd"
Sendmail_pidfile = "/var/spool/postfix/pid/master. pid"
Sendmail_outbound_enable = "NO"
Sendmail_submit_enable = "NO"
  
This was prompted during the make install operation, but I forgot to configure it once, but the system still works normally and I still don't fully understand what the problem will be.
  
Install vm-pop3d
  
Cd/usr/ports/mail/vm-pop3d/
Make install clean
  
Configure postfix
  
Modify:
/Usr/local/etc/postfix/main. cf
Join
  
Virtual_alias_maps = hash:/usr/local/etc/postfix/virtual
Alias_maps = hash:/usr/local/etc/postfix/aliases
Default_privs = nobody
Allow_mail_to_commands = alias, forward, include
Allow_mail_to_files = alias, forward, include
  
The last two are very important, because the include feature in aliases is disabled by default, and this feature is used when openwebmail modifies the aliases file.
  
Modify:
/Usr/local/etc/postfix/virtual
Join:
  
Jayvan.com # At least add a tab. Otherwise, an error occurs.
Jayvan@jayvan.com jayvan.jayvan.com
  
In the above example, I add a virtual domain of jayvan.com and add the first user jayvan as the system administrator.
  
Run:
  
Cd/usr/local/etc/postfix/; postmap virtual
  
Generate virtual. db
  
Modify:
/Usr/local/etc/postfix/aliases
  
Join
  
Jayvan.jayvan.com:/var/spool/virtual/jayvan.com/jayvan
  
Run:
Cd/usr/local/etc/postfix/; postalias aliases
  
Generate aliases. db
  
Configure Automatic vm-pop3d execution
Modify:
/Etc/inetd. conf
  
Join:
  
Pop3 stream tcp nowait root/usr/local/sbin/vm-pop3d vm-pop3d-u nobody
  
  
Modify:
/Etc/rc. conf
  
Join:
Inetd_enable = "YES"
  
Of course, you can also use the rc. d script for execution.
  
Configure openwebmail to support the jayvan.com domain
Add file:
/Usr/local/www/cgi-bin/openwebmail/etc/site. conf/jayvan.com
  
The file must be a virtual domain name.
File Content:
  
Auth_module auth_vdomain.pl
Auth_withdomain yes
Mailspooldir/var/spool/virtual/jayvan.com # note that the directory name and domain name are consistent
Use_syshomedir no
Use_homedirspools no
Enable_autoreply no
Enable_setforward no
Enable_vdomain yes
Vdomain_admlist jayvan
Vdomain_maxuser 100
Vdomain_vmpop3_pwdpath/usr/local/etc/virtual # This is the vm-pop3d default directory for passwd
Vdomain_vmpop3_pwdname passwd
Vdomain_vmpop3_mailpath/var/spool/virtual
Vdomain_postfix_aliases/usr/local/etc/postfix/aliases
Vdomain_postfix_virtual/usr/local/etc/postfix/virtual
Vdomain_postfix_postalias/usr/local/sbin/postalias
Vdomain_postfix_postmap/usr/local/sbin/postmap
  
Run:
  
Mkdir-p/var/spool/virtual/jayvan.com
Chown nobody/var/spool/virtual/jayvan.com
Chgrp mail/var/spool/virtual/jayvan.com
  
Mkdir-p/usr/local/etc/virtual/jayvan.com
Touch/usr/local/etc/virtual/jayvan.com/passwd
Chmod 644/usr/local/etc/virtual/jayvan.com/passwd
  
Htpasswd/usr/local/etc/virtual/jayvan.com/passwd jayvan
  
Chmod 755/usr/local/www/cgi-bin/openwebmail/etc/users # this is very important. By default, this directory permission will cause openwebmail to be inaccessible.
  
Restart the system to start postfix and vm-pop3, and then you can use it.
You can add an email account after logging on to openwebmail with the system administrator account. Note that you must use the complete email address as an account when logging on, for example:
Jayvan@jayvan.com
  
How to make quota take effect has not been studied yet. I think this combination is good for the internal email servers of dozens of small companies. The Network Disk function of openwebmail saves the trouble of setting up personal file server sharing.
Currently, it does not seem that openwebmail can automatically set a group account. If it does not exist, this is a disadvantage. Although the automatic account registration function is very useful, it is not too great for company users of this type. Users added to openwebmail can barely meet the requirements.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.