Click to See Complete Forum and Search --> : multiple pop accounts
dvdnut
08-02-2001, 12:26 PM
i have seen a friend of mine in the past with this setup
he has loads of email accounts and he can get them downloaded for various members of his family onto his linux box, and all they need to do is to collect it from the box onto their email clients on another part of the lan
i would like to do the same but havent a clue what i need in order to set it up
please help
andrzej
08-02-2001, 02:18 PM
1) create users: let's call them joe, sarah and john
2) install fetchmail
3) install pop3 server (and uncomment appropriate line in /etc/(x)inetd.conf, execute killall -HUP inetd)
4) in /root create a file called .fetchmailrc
edit it:
# this is an example .fetchmailrc
set daemon 300 #poll in 300 sec intervals
defaults:
no rewrite
no dns
# joe's pop account
poll joes.server.com with protocol pop3 user joe and password joes_secret_password to joe here fetchall;
# sara's pop account
# lets assume there is ssh access to sara's mail server
# why not use it to encrypt traffic ?
poll localhost with protocol pop3 and port 11110 user sara fetchall:
preconnect "ssh -C -f sara_smith@saras.mail.com -L 11110:saras.mail.com:110 sleep 5"
password saras_password;
# same section for john
...
# end of sample .fetchmailrc
If there are multidrop pop accounts you may want to use procmail (you need a properly set up smtp server for this: postfix or qmail or sendmail or ...). Eg there is an account to which mail for john and sara is sent.
# sample /root/.procmailrc:0 c
* ^TO(john)
! john
:0 c
* ^TO(sara)
! sara
:0 c
* !^TO(sara,john)
! sara
:0
all_mail_backup
# end of sample /root/.procmailrc
5) everything should work
References:
man fetchmail
man procmail
man procmailrc
man inetd (or xinetd)
Edit:
I forgot to tell you to launch fetchmail (as root).
Well, you might want to use it as another user - it's up to you. You'll probably want to add it to your startup scripts.
[ 02 August 2001: Message edited by: andrzej ]
Gotenks
08-02-2001, 04:59 PM
Damn, thats some pretty handy information. You should write that up as an NHF so I don't have to print it out :D
Gotenks
dvdnut
08-03-2001, 04:30 AM
but for instance if i (dvdnut) had 3 email accounts to myself
would i have to create 2 additional users so the email can be retrieved from the box to my email client on another machine?
or can all mail be stored in one account?
confusion reeks in me
andrzej
08-03-2001, 07:37 AM
A single account is enough.
# example .fetchmailrc
set daemon 300
defaults:
no dns
no rewrite
poll your.first.account proto pop3 user dvdnut pass your_first_passwd to dvdnut here fetchall;
poll your.second.account proto pop3 user dvdnut pass your_second_passwd to dvdnut here fetchall;
# end example
If you're running fetchmail as dvdnut you may skip the "to dvdnut here". Fetchmail defaults to put mail in the mailbox of the user who runs it.
edit: buggy mozilla...
[ 03 August 2001: Message edited by: andrzej ]