geekvenue.net

Welcome to Chucktips Hardware HELP WITH DEAD OS Installing FreeBSD Miscellaneous
 faq
 search
 add article
 cool-stuff
 how-to
 main
 tips


HOWTO: Setup Postfix Mailer
Sendmail Posted by Santhosh Joseph on Monday January 21, @06:28AM
from the dept.
Setup your machine as mail server

Here's a simple way to setup your machine as e-mail server. For receiving mails though, you need POP/IMAP Servers like qpopper. For the sake of brevity and to avoid confusion, this howto deals with only the sending part. Setting up qpopper on a LAN and fetching mails from outside world etc. will be dealt with later (any volunteers ?). I have choosen source-code installation method

As with other chucktips posts, this howto is intended for the uninitiated.

It is assumed that you have FreeBSD installed and have a dial-up connection to the Internet (Cable, DSL etc. are perfectly acceptable). Here, Mail Server means the machine where this installation is done. Mail client means a software such as Kmail on the same machine or on a different machine on the LAN (with any OS )

Warning : If you have another MTA (like sendmail, qmail etc.) running, do take necessary precautions and please read the relevent portion of the postfix manual before you proceed !

Pre-Installation

Make sure that the hostname has been specified in rc.conf file.

# ee /etc/rc.conf

For eg. mine looks like :

hostname="bsdbox.bsdfarm.den"

In the same file, ensure that sendmail_enable is set to "YES" :

sendmail_enable="YES"

Installation

Download the postfix source code (postfix-1.1.0.tar.gz - 1.1MB), from mirrors on http://www.postfix.com

Login as root and open a terminal window and move to the directory where postfix-1.1.0.tar.gz is and type

# tar -zxvf postfix-1.1.0.tar.gz

# cd postfix-1.1.0

# make

Create a group - 'postdrop' followed by a user - 'postfix'. Do not assign a password to this account. We will use FreeBSD's sysinstall utility for the purpose (you can use any method of your choice).

# /stand/sysinstall

Select Configure -> User Management -> Group Add

Add the group name as postdrop and select OK.

Next, Select Configure -> User Management -> User

Add the Login ID as postfix and select OK.

Ignore any warnings.

Go back to the directory where the postfix sources are and type

# make install

This will be followed by series of questions. Accept the defaults by pressing the enter key. At the end of the installation, you'll be asked to configure /etc/postfix/main.cf. For now, ignore it an type

# /usr/bin/newaliases

If you are on a dial up line (like me), your mail has to be queued on the server until the next connection is made to the Internet. This means that postfix should not attempt to send the mail to the remote destination as soon as it receives it (i.e, when the send button of the mail client is clicked). On a dial-up connection , the mail has to be send from the server to it's destination, only after the internet connection has been established.

For this, edit /etc/postfix/main.cf and add this line:

defer_transports = smtp (not required for 'Internet - always connected situations' like, Cable, DSL etc)

Postfix is now ready to roll. Start the postfix mailer system by typing :

# postfix start

Note :Postfix will start automatically on next reboot.

Testing

Open your favorite mail client and set the smtp server as localhost (if on the server machine else give the ip number of server machine) at port 25. Type a test message, say your yahoo! id and click send. Your mail client would indicate that the mail has been sent. Actually, it's been queued on your machine and has not been send yet. To send all queued messages, connect to the Internet and as root and type :

# sendmail -q

Note: I prefer setting the /usr/sbin/sendmail permission to 'root only execute'

Your mail should now be sent to your indicated email address.

Check the manual for more advanced configuration.

Do post your comments and feed back.







<  |  >

 

Related Links
  • Articles on Sendmail
  • Also by Santhosh Joseph
  • Contact author

    Lilliput Mini USB Computer Monitor

    If you have ever wanted to learn about Cisco Routers, check out my new book "Cisco Routers for the Small Business" - it's Cisco CLI for the Regular Guy!

  • Sponsors

    The Fine Print: The following comments are owned by whoever posted them.
    ( Add a Reply )

    Re: HOWTO: Setup Postfix Mailer
    by justin on Monday February 11, @08:46PM
    im not too sure why you have to have:
    sendmail_enable="YES"
    I thought the whole point to postfix was to completely replace sendmail.... I have mine set to sendmail_enable="NO". So it doesnt start on a reboot.
    [ Add a Reply to this ]
    • Re: HOWTO: Setup Postfix Mailer
      by Santhosh Joseph on Wednesday February 13, @08:59PM

      Postfix aims to be a sendmail replacement that is mostly sendmail compatible from the user's point of view.

      The intention of setting sendmail_enable="YES" is to make sure that postfix is started automatically on next reboot.

      For more on that : http://archives.neohapsis.com/archives/postfix/2001-07/0381.html


      [ Reply to this ]
      • Re: HOWTO: Setup Postfix Mailer
        by Neil on Friday March 08, @02:06AM

        That's great, and I've got it to work. However, I can only send email... I now want to set up a remote service so I can also pop it remotely.

        How can I do this? And I have multiple users on my server, how can they seperately get at their email without seeing each others?

        Thanks


        [ Reply to this ]
        • Re: HOWTO: Setup Postfix Mailer
          by tyler on Thursday April 04, @04:32PM

          You need to get a POP server - I use VM-POP3D - do a search and you can probably find it... you set it up to work with postfix and then you can receive email. here a great tutorial for you i think will solve your problem:

          http://cagelink.com/~tjr/postfix/

          • Tyler.


          [ Reply to this ]
    Re: HOWTO: Setup Postfix Mailer
    by Phil Brooks on Monday September 30, @02:29PM
    Hello, i cannot seem to get my email form to work with postfix, yea its just one of those crapy form mailers like "matts scripts" but for the time being it would be real usefull to get it working. Im running Linux Redhat 7.3 and Postfix when I to send an email using the form it displays the error "Method Not Allowed" pleeeeaase help me! Phil
    [ Add a Reply to this ]
    Re: HOWTO: Setup Postfix Mailer
    by carlos on Wednesday January 15, @04:33AM
    Hi,
    using NetBSD 1.6, postfix-2.0.0.2
    i installed using pkgsrc -> make install
    then postfix start
    then sendmail -q
    and got a mailwrapper.core core dump.

    mailer.conf configs point to /usr/libexec/sendmai/sendmail

    So, how do I swap sendmail for postfix, correctly?

    I must have made a mistake here, but where?

    regards,
    Carlos.
    [ Add a Reply to this ]
    • netbsd -did you set the /etc/mailer.conf 2postfix?
      by ajo on Friday May 09, @01:25AM
      It could be your mailer wrapper thinks he schould
      stille use sendmail...
      [ Reply to this ]
    Re: HOWTO: Setup Postfix Mailer
    by Parvez on Monday May 12, @10:33PM
    I install postfix and i can send mail outside but i cannot configure it to retrieve mail locally through ximian or outlook. Please reply soon
    [ Add a Reply to this ]
    Postfix Catch All?
    by Andrew Knifel on Wednesday August 27, @02:56AM
    How can O eliminate the CATCH ALL box in Postfix. I get spam that appears to be coming from my system. Thanks
    [ Add a Reply to this ]
    Re: HOWTO: Setup Postfix Mailer
    by Nitesh Naik on Monday April 11, @11:04AM
    hi santhosh Thanks for the tutorial. i will be thankful if i get the steps for sending mails between two computers one acting as client and other as server. i want HOWTO configure postfix for this requirement. please reply early bye
    [ Add a Reply to this ]
    The Fine Print: The following comments are owned by whoever posted them.
    ( Article Reply )

    "You never know how many friends you have until you own a Condo on the beach." -- Jason's Postulate

    Powered by Zope  Powered by Apache  Squishdot Powered
    All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest ©2001 Jason Neumann.
    [ main | post article | search ]