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 POP Server on your LAN
Miscellaneous Posted by Santhosh Joseph on Thursday April 18, @03:19AM
from the dept.

In continuation with the how-to on setting up a simple e-mail server on a dial-up/cable internet connection, here is the second part of the article which focuses on setting up a POP Server. If you have not setup the SMTP Server read the first part of this Article.


At the end of of the installation we should be able to :

1.  Fetch  mails from different POP servers  and distribute them to different users on the LAN.
2.  Set up an Intranet Mail Server to be used on the LAN.

The following assumptions are made :

LocalUser Name            Local Password      Yahoo User Name              Remote Password
--------------------------------------------------------------------------------------------------------------------------------------
emp1                              localpassword1       remp1@yahoo.com             remotepassword1

emp2                              localpassword2       remp2@yahoo.com             remotepassword2
---------------------------------------------------------------------------------------------------------------------------------------


We begin with installation of qpopper and fetchmail from the ports  

As root :

# cd /usr/ports/mail/qpopper
# make install

next install fetchmail

#cd /usr/ports/mail/fetchmail
#make install

Now we add users as required.

# adduser
.....

Enter username [a-z0-9_-]: emp1

...............

The next task is to configure the .fetchmailrc file which is read by the fetchmail program for information such as the remote POP Server ID, user id and password etc. to access the POP account.

# ee .fetchmailrc
 

poll pop.mail.yahoo.com
        proto pop3
        user "remp1"
        pass "remotepassword1"
        is emp1
        fetchall
poll pop.mail.yahoo.com
        proto pop3
        user "remp2"
        pass "remotepassword2"
        is emp2
        fetchall

replace
pop.mail.yahoo.com -> with your POP Server ID
pop3  -> with IMAP if your e-mail service provider supports IMAP.

Replace the username and password .

Make sure the .fetchmailrc file is in the root users home directory.

Next we add a  startup script file so that fetchmail is started on reboot.

# ee /usr/local/etc/rc.d /fetchmail.sh

#!/bin/sh
echo -n ' Fetchmail'

case "$1" in
start)
/usr/local/bin/fetchmail -a -s -K -F -d 600

;;
stop)
kill -9 `cat /var/run/fetchamil.pid`
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
exit 64
;;
esac

exit 0


Ensure that you have set the proper permissions for this file.


#chmod 0755 /usr/local/etc/rc.d/fetchmail.sh

The final step of course, is to start qpopper.  Please add the following line to /etc/inted.conf

# ee /etc/inetd.conf

pop3 stream tcp nowait root /usr/local/libexec/qpopper qpopper -s 

Now restart the machine and, Voila! -  you should have a working POP server for your LAN.



For more details :

man qpopper
man fetchmail

<  |  >

 

Related Links
  • Articles on Miscellaneous
  • 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 )

    Closing port 25 tp public
    by Andrew Knifel on Saturday November 09, @12:53AM
    Hi, Do you have a tutorial to block port 25 to the outside world? I'd only like to allow mail server and users in my own network to use Sendmail. Not the whole internet. :-) I use FreeBSD 4.5.
    [ Add a Reply to this ]
    • Re: Closing port 25 tp public
      by blah on Saturday February 01, @09:38PM
      bind the MTA to a NIC
      [ Reply to this ]
    • Re: Closing port 25 tp public
      by Jaker on Monday August 04, @03:27PM
      optionally, install a firewall such as ipfw(8)

      --------
      Cheap BSD VDS's
      www.jvds.com
      Quote Ref: EDC

      [ Reply to this ]
    • Re: Closing port 25 tp public
      by okey on Wednesday August 27, @12:38AM
      Please how do I block port 25 in my computer
      [ Reply to this ]
    POPBEFORESMTP on qpopper and IMAP
    by Jennifer Zhao on Thursday September 04, @04:39PM
    Dear Santhosh Joseph

    I read your HOW TO SETUP POP SERVER article.
    Your recommend pop server is qpopper. However, I have alrealy installed IMAP2000C on my FreeBSD4.3 as mail server, so at moment, what if I do not install qpopper, but keep IMAP , do you think I can still do POPBEFORESMTP, as this link article suggested:
    http://www.iecc.com/pop-before-smtp.html

    This article said to enalbe POPBEFORESMTP, first you need to add a patch to file pop_pass.c of pop3 server qpopper. Now the question I have is :
    Does IMAP200C has a compatible file as pop_pass.c to qpopper? If so, which file is it? Can I add the patch to it as the above link article said to pop_pass.c in qpopper?

    You and any other people's advice will be highly appreciated

    Jennifer Zhao
    [ Add a Reply to this ]
    • Re: POPBEFORESMTP on qpopper and IMAP
      by Jennifer Zhao on Thursday September 04, @07:38PM
      Hi, everyone,

      At ealier time I posted an email regardsing to the POPBEFORESMTP application in IMAP,
      rather than in qpopper .
      And some people sent me some advice on this as follows:

      ---start the advice---

      As you found, the patch to qpopper is not applicable to the IMAP toolkit
      POP3 server (ipop3d) since ipop3d is a completely different program.
      However, an expert can probably derive an equivalent patch for ipop3d
      without too much difficulty. The routine to modify is pass_login() in
      ipop3d.c, and specifically the five lines:

      if (ret == TRANSACTION) /* mailbox opened OK? */
      syslog (LOG_INFO,"%sLogin user=%.80s host=%.80s nmsgs=%ld/%ld",
      t ? "Admin " : "",user,tcp_clienthost (),nmsgs,stream->nmsgs);
      else syslog (LOG_INFO,"%sLogin user=%.80s host=%.80s no mailbox",
      t ? "Admin " : "",user,tcp_clienthost ());

      You may also need to modify the following lines in the main() function:
      else if ((state = mbxopen ("INBOX")) == TRANSACTION)
      syslog (LOG_INFO,"Auth user=%.80s host=%.80s nmsgs=%ld/%ld",
      user,tcp_clienthost (),nmsgs,stream->nmsgs);

      Basically, someone needs to figure out what pop_log() does in qpopper,
      and change the "Login user=" and "Auth user=" syslog() calls to do what
      pop_log() does.

      ----end of advice----

      Now the problem is I am no expert on this at all, so just can not think what
      change I need to do for "Login user=" and "Auth user=" , which can be
      compatible to the process as you put that patch to pop_pass.c

      Can anybody kindly give me some more details advice on that?

      Thanks a lot
      Jennifer
      [ Reply to this ]
    • Re: POPBEFORESMTP on qpopper and IMAP -fixed
      by Jennifer Zhao on Tuesday September 16, @09:26PM
      Hi,

      I just upgraded my Freebsd4.3 to 4.7 release via CDROM. and use SMTP AUTH rather than POPBEFORESMTP, fixed the mail relay problem.

      Jennifer
      [ Reply to this ]
    Re: HOWTO: Setup POP Server on your LAN
    by Nguen Cong Trung on Thursday December 04, @07:10AM
    Help me
    [ Add a Reply to this ]
    Re: HOWTO: Setup POP Server on your LAN
    by Jenning on Friday December 05, @08:38AM
    How can I set sendmail server on my LAN. I have a LAN with four PCs and connect to internet via Cable Router. How can I build an internal sendmail server on my one PC with Linux 8.0 server installed? And also is it possible to have multi-mail hosts like user@domain1.com, user@domain2.com - that is one same user has different mail box on different mail hosts domain1.com and domain2.com. Thank you!
    [ 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 ]