Postfix: Running SMTP With TLS

Hi, enabling TLS on your postfix server is quite simple. Only enable it using following lines in your main.cf config file (usually /etc/postfix/main.cf):

  • smtpd_use_tls = yes (enable the TLS usage)
  • smtpd_tls_cert_file = /etc/pki/tls/certs/yourcertificate.crt (set your server certificate file)
  • smtpd_tls_key_file = /etc/pki/tls/private/yourkey.key (set your server key file)
  • smtpd_tls_loglevel = 1 (enable TLS logging*)
  • smtpd_tls_security = may (set TLS security level*)
  • smtpd_tls_received_header = yes (write TLS status to email header)

​*) TLS logging:
this setting's values are different in postfix v2.9 and later. for example in postfix 2.9+ the TLS handshake is logged even if the value is 0. On the other hand you need to set the value to 1 in postfix earlier to 2.9.

*) TLS security level:
may – if there is an encryption available it will be used
encrypt – means enforce the encryption. Any connection without TLS is refused

you can find more infos on the postfix website.

Installing latest VMware Tools on CentOS

You can find all VMware Tools packages on

https://packages.vmware.com/tools/esx/index.html

They provide an .exe and .iso file for windows and package repositories for different linux distributions like RHEL, CentOS, SuSE or Ubuntu.

Here an example how to setup a package repository for ESXi 4.1 and CentOS5:

  • create a repo file
    # touch /etc/yum.repos.d/vmware-tools.repo
  • then open it
    # vim /etc/yum.repos.d/vmware-tools.repo
  • and paste following text inside:
    [VMWare-tools]
    name=VMWare Tools Packages for Enterprise Linux 5 – $basearch
    baseurl=https://packages.vmware.com/tools/esx/4.1latest/rhel5/$basearch
    enabled=1
    gpgcheck=0
  • save it and close the file.
  • now you can install the vmware-tools (desktop) or vmware-tools-nox (server) package.
  • after install reboot the computer

​replace inside the baseurl "4.1latest" with your esxi version and "rhel5" with your os version.

Test SMTP AUTH using Telnet

Here is how to test SMTP authentication with telnet using terminal and openssl in Darwin or Linux:

  1. Get your user and password in base64 encoded strings (you need them in base64 because the server wants them to be like that)
    # echo 'myuser' | openssl base64
    # echo 'mypassword' | openssl base64
  2. Open a telnet conneciton susing port 25:
    # telnet myserver.domain.com 25
  3. Greet the server
    # EHLO myserver.domain.com
  4. Tell the server you want to authenticate
    # AUTH LOGIN
  5. The server now asks you in a base64 encoded string to enter user. Enter the encoded string you received for 'myuser' in point 1
  6. The server now asks you for the password, again in a base64 encoded string. Enter the encoded password received from point 1
  7. You should see a message now with authentication succeeded or authentication failed