×

Article was already bookmarked.

Postfix Configuration Settings for Ubuntu and Debian


Postfix Configuration Settings for Ubuntu and Debian

  1. Install Postfix:
    This will remove exim since there can't be two mail systems active at the same time.
    If you have a website, choose "Internet Site" when the configuration prompt ask for it.
    apt-get install postfix
    
  2. Verify mail.log to see if postfix started correctly.
    cat /var/log/mail.log
    
  3. Add your domain to the config files, so others can't abuse your mailsystem.
    postconf -e "myorigin = example.com"
    
  4. Add your hostname (computer name).
    Use command "hostname" at the command-line to display your hostname if not sure.
    postconf -e "myhostname=server1.example.com"
    
  5. Now add the domain names that your system will handle.
    postconf -e "relay_domains= example.com, example2.com, example3.com"
    
  6. Reload the Postfix server:
    postfix reload
    
  7. Test the mailserver.
    telnet localhost 25
    
  8. You should see something similar to:
    Trying 127.0.0.1...
    Connected to localhost.localdomain.
    Escape character is '^]'.
    220 server1.example.com ESMTP Postfix (Debian/GNU)
    
  9. Try sending an email:
    mail from: < you(at)youremail.com > 
    rcpt to: < user(at)example.com >
    data
    To: user(at)example.com
    From: you(at)youremail.com
    Subject: Hey my first email
    This is my first postfix email after installing and configuring it.
    It was easy.
    .
    
  10. Make sure to add an extra '.' at the end to indicate the end of the email content.
    Use "quit" to return to the regular command prompt input.


Author
Andrisoft Team
Date Created
2014-10-30 09:59:11
Date Updated
2017-11-29 22:37:57
Views
7006