one-nda.com

Simple is Good …

setting email server di ubuntu

POSTFIX 

Install postfix : apt-get install postfix,

Basic Configuration : dpkg-reconfigure postfix,

SMTP Authentication :

The configuration parameters will be stored in /etc/postfix/main.cf file,
1. Configure Postfix to do SMTP AUTH using SASL (saslauthd):
    postconf -e ‘smtpd_sasl_local_domain =’
    postconf -e ‘smtpd_sasl_auth_enable = yes’
    postconf -e ‘smtpd_sasl_security_options = noanonymous’
    postconf -e ‘broken_sasl_auth_clients = yes’
    postconf -e ‘smtpd_recipient_restrictions =’
    permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination’
    postconf -e ‘inet_interfaces = all’,


   Open the /etc/postfix/sasl/smtpd.conf file and add the following lines to end of the  file:,

2 Next, configure the digital certificate for TLS. When asked questions, follow the instructions and answer appropriately:,

openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024 chmod 600 smtpd.key openssl req -new -key smtpd.key -out smtpd.csr openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt openssl rsa -in smtpd.key -out smtpd.key.unencrypted mv -f smtpd.key.unencrypted smtpd.key openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650 sudo mv smtpd.key /etc/ssl/private/ sudo mv smtpd.crt /etc/ssl/certs/ sudo mv cakey.pem /etc/ssl/private/ sudo mv cacert.pem /etc/ssl/certs/

3. Configure Postfix to do TLS encryption for both incoming and outgoing mail:

postconf -e ‘smtpd_tls_auth_only = no’ postconf -e ‘smtp_use_tls = yes’ postconf -e ‘smtpd_use_tls = yes’ postconf -e ‘smtp_tls_note_starttls_offer = yes’ postconf -e ‘smtpd_tls_key_file = /etc/ssl/private/smtpd.key’ postconf -e ‘smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt’ postconf -e ‘smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem’ postconf -e ‘smtpd_tls_loglevel = 1’ postconf -e ‘smtpd_tls_received_header = yes’ postconf -e ‘smtpd_tls_session_cache_timeout = 3600s’ postconf -e ‘tls_random_source = dev:/dev/urandom’ postconf -e ‘myhostname = mail.example.com’ 

/etc/init.d/postfix start, CONFIGURING SASL apt-get install libsasl2 sasl2-bin,

mkdir -p /var/spool/postfix/var/run/saslauthd rm -rf /var/run/saslauthd

To activate saslauthd, edit the file /etc/default/saslauthd, and change, or add the START variable. In order to configure saslauthd to run in the false root, add the PWDIR, PIDFILE and PARAMS variables. Finally, configure the MECHANISMS, variable to your liking. The file should look like this:   # This needs to be uncommented before saslauthd will be run # automatically START=yes PWDIR=”/var/spool/postfix/var/run/saslauthd” PARAMS=”-m ${PWDIR}” PIDFILE=”${PWDIR}/saslauthd.pid” # You must specify the authentication mechanisms you wish to use. # This defaults to “pam” for PAM support, but may also include # “shadow” or “sasldb”, like this: # MECHANISMS=”pam shadow” MECHANISMS=”pam”

dpkg-statoverride –force –update –add root sasl 755, /var/spool/postfix/var/run/saslauthd

Testing

 

/etc/init.d/saslauthd start,

telnet mail.example.com 25

 

 

EXIM4

 

apt-get install exim4 exim4-base exim4-config dpkg-reconfigure,

exim4-config

 

All the parameters you configure in the user interface are stored in /etc/exim4/update-exim4.conf.conf file. If you wish to re-configure, either you re-run the configuration wizard or manually edit this file using your favourite editor. Once you configure, you can run the following command to generate the master configuration file:

update-exim4.conf

/etc/init.d/exim4 start

 

DOVECOT SERVER

 

apt-get install dovecot-common dovecot-imapd dovecot-pop3d

 

edit the file /etc/dovecot/dovecot.conf

protocols = pop3 pop3s imap imaps

pop3_uidl_format = %08Xu%08Xv default_mail_env = maildir:~/Maildir # (for maildir), or, default_mail_env = mbox:~/mail:INBOX=/var/spool/mail/%u # (for mbox)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

POSTFIX

Install postfix : apt-get install postfix,

Basic Configuration : dpkg-reconfigure postfix,

SMTP Authentication :

The configuration parameters will be stored in /etc/postfix/main.cf file,
1. Configure Postfix to do SMTP AUTH using SASL (saslauthd):
    postconf -e ‘smtpd_sasl_local_domain =’
    postconf -e ‘smtpd_sasl_auth_enable = yes’
    postconf -e ‘smtpd_sasl_security_options = noanonymous’
    postconf -e ‘broken_sasl_auth_clients = yes’
    postconf -e ‘smtpd_recipient_restrictions =’
    permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination’
    postconf -e ‘inet_interfaces = all’,
   Open the /etc/postfix/sasl/smtpd.conf file and add the following lines to end of the  file:,

2 Next, configure the digital certificate for TLS. When asked questions, follow the instructions and answer appropriately:,

openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024 chmod 600 smtpd.key openssl req -new -key smtpd.key -out smtpd.csr openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt openssl rsa -in smtpd.key -out smtpd.key.unencrypted mv -f smtpd.key.unencrypted smtpd.key openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650 sudo mv smtpd.key /etc/ssl/private/ sudo mv smtpd.crt /etc/ssl/certs/ sudo mv cakey.pem /etc/ssl/private/ sudo mv cacert.pem /etc/ssl/certs/
3. Configure Postfix to do TLS encryption for both incoming and outgoing mail:

postconf -e ‘smtpd_tls_auth_only = no’ postconf -e ‘smtp_use_tls = yes’ postconf -e ‘smtpd_use_tls = yes’ postconf -e ‘smtp_tls_note_starttls_offer = yes’ postconf -e ‘smtpd_tls_key_file = /etc/ssl/private/smtpd.key’ postconf -e ‘smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt’ postconf -e ‘smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem’ postconf -e ‘smtpd_tls_loglevel = 1’ postconf -e ‘smtpd_tls_received_header = yes’ postconf -e ‘smtpd_tls_session_cache_timeout = 3600s’ postconf -e ‘tls_random_source = dev:/dev/urandom’ postconf -e ‘myhostname = mail.example.com’
/etc/init.d/postfix start, CONFIGURING SASL apt-get install libsasl2 sasl2-bin,

mkdir -p /var/spool/postfix/var/run/saslauthd rm -rf /var/run/saslauthd
To activate saslauthd, edit the file /etc/default/saslauthd, and change, or add the START variable. In order to configure saslauthd to run in the false root, add the PWDIR, PIDFILE and PARAMS variables. Finally, configure the MECHANISMS, variable to your liking. The file should look like this:   # This needs to be uncommented before saslauthd will be run # automatically START=yes PWDIR=”/var/spool/postfix/var/run/saslauthd” PARAMS=”-m ${PWDIR}” PIDFILE=”${PWDIR}/saslauthd.pid” # You must specify the authentication mechanisms you wish to use. # This defaults to “pam” for PAM support, but may also include # “shadow” or “sasldb”, like this: # MECHANISMS=”pam shadow” MECHANISMS=”pam”
dpkg-statoverride –force –update –add root sasl 755, /var/spool/postfix/var/run/saslauthd
Testing
 
/etc/init.d/saslauthd start,
telnet mail.example.com 25
 

 

EXIM4
 
apt-get install exim4 exim4-base exim4-config dpkg-reconfigure,
exim4-config
 
All the parameters you configure in the user interface are stored in /etc/exim4/update-exim4.conf.conf file. If you wish to re-configure, either you re-run the configuration wizard or manually edit this file using your favourite editor. Once you configure, you can run the following command to generate the master configuration file:
update-exim4.conf
/etc/init.d/exim4 start
 
DOVECOT SERVER
 
apt-get install dovecot-common dovecot-imapd dovecot-pop3d
 
edit the file /etc/dovecot/dovecot.conf
protocols = pop3 pop3s imap imaps
pop3_uidl_format = %08Xu%08Xv default_mail_env = maildir:~/Maildir # (for maildir), or, default_mail_env = mbox:~/mail:INBOX=/var/spool/mail/%u # (for mbox)

/etc/init.d/dovecot start

testing

 

bhuvan@rainbow:~$ telnet localhost pop3 Trying 127.0.0.1…, Connected to localhost.localdomain., Escape character is ‘^]’., +OK Dovecot ready.

 

DOVECOT SSL CONFIGURATION

 

edit the file /etc/dovecot/dovecot.conf

ssl_cert_file = /etc/ssl/certs/dovecot.pem, ssl_key_file = /etc/ssl/private/dovecot.pem, ssl_disable = no disable_plaintext_auth = no 

 

 

 

 

 

 

 

 

/etc/init.d/dovecot start

testing

 

bhuvan@rainbow:~$ telnet localhost pop3 Trying 127.0.0.1…, Connected to localhost.localdomain., Escape character is ‘^]’., +OK Dovecot ready.

 

DOVECOT SSL CONFIGURATION

 

edit the file /etc/dovecot/dovecot.conf ssl_cert_file = /etc/ssl/certs/dovecot.pem, ssl_key_file = /etc/ssl/private/dovecot.pem, ssl_disable = no disable_plaintext_auth = no

February 28, 2008 Posted by | ubuntu | | Leave a comment