Search My Blog

Thursday, January 14, 2010

Email Server - Caos Linux Wiki

Email Server

From Caos Linux Wiki

Jump to: navigation, search

Contents

[hide]

[edit] Email Services

[edit] Postfix (default)

Postfix comes with Caos as the default MTA. It comes on most installs of Caos, but if for some reason you find that it isn't installed, you can install it with the following command:

$ sudo smart install postfix 

Once installed you should edit the files in /etc/postfix to match your site installation. Some required fields will be:

  • inet_interfaces: This should be set to all.
  • mydestination: This is a list of all hostnames and domains that Postfix will receive email for.

Lastly you will need to start/restart the postfix service using the commands:

$ sudo /etc/init.d/postfix restart $ sudo /sbin/chkconfig postfix on 

[edit] IMAP Support

Caos uses Dovecot for IMAP support. To install Dovecot run the following command:

$ sudo smart install dovecot $ sudo /etc/init.d/dovecot restart $ sudo /sbin/chkconfig dovecot on 

Once installed edit /etc/dovecot.conf to your liking. Here is a template that we usually start off with:

# IMAPS support only protocols = imaps  # It's nice to have separate log files for Dovecot. You could do this # by changing syslog configuration also, but this is easier. log_path = /var/log/dovecot.log info_log_path = /var/log/dovecot-info.log  # Mailbox locations mail_location = mbox:~/Mail:INBOX=/var/mail/%u  # Group to enable temporarily for privileged operations. mail_privileged_group = mail  # If you're using POP3, you'll need this: pop3_uidl_format = %08Xu%08Xv  # Authentication configuration: auth_verbose = yes  auth default {  mechanisms = plain login   passdb passwd-file {     args = /etc/mail/passwd   }   userdb passwd-file {     args = /etc/passwd   }   socket listen {     client {       path = /var/spool/postfix/private/auth       mode = 0660       user = postfix       #group = postfix     }   } } 

Once you have updated your configuration file, you must restart the dovecot service:

$ sudo /etc/init.d/dovecot restart 

This configuration specifies that IMAP users are system users and the passwords are stored in /etc/mail/passwd (again, just to reiterate, user's passwords are NOT their system passwords). The format is:

username:{PLAIN}mypassword 

You can encrypt the password by using the command line tool dovecotpw, and use the encrypted string as the password.


[edit] Using Dovecot to authenticate SMTP relaying

Once you have properly configured Dovecot, you can have Postfix authenticate users relay access (e.g. sending emails). Add the following to /etc/postfix/main.cf

smtpd_sasl_auth_enable = yes smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth 

Once you have updated your postfix configuration file, you must restart the postfix service:

$ sudo /etc/init.d/postfix restart 

Go there...
http://wiki.caoslinux.org/Email_Server

No comments: