Using fetchmail for 200 Email accounts

Taking care of your Linux box.
Post Reply
Learner
Lance Naik
Posts: 41
Joined: Wed Nov 08, 2006 2:40 am

Using fetchmail for 200 Email accounts

Post by Learner »

AOA

Dear All ,

I am using fetchmail on FreeBSD (sendmail as a mail server) to fetch my mail from my domain and users can get their mails from the local server. Now I have to configure a new server and the email IDs are increased to 150. I old routine I have only one users having the "fetchmailrc" file and all the accounts details were mentioned in that file. It collect the mail in top to bottom order for each account mentioned in that file which is time consuming and not an efficient method.

Now I want to make "fetchmailrc" file for each user and "crontab" to be set for each user will that work fine for that much users.
Thanks & Regards


Muhammad Ali
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re: Using fetchmail for 200 Email accounts

Post by LinuxFreaK »

Dear Learner,
Salam,
Learner wrote:I am using fetchmail on FreeBSD (sendmail as a mail server) to fetch my mail from my domain and users can get their mails from the local server. Now I have to configure a new server and the email IDs are increased to 150. I old routine I have only one users having the "fetchmailrc" file and all the accounts details were mentioned in that file. It collect the mail in top to bottom order for each account mentioned in that file which is time consuming and not an efficient method.

Now I want to make "fetchmailrc" file for each user and "crontab" to be set for each user will that work fine for that much users.
Make shell script and run put it into crontab.

Best Regards.
Farrukh Ahmed
Learner
Lance Naik
Posts: 41
Joined: Wed Nov 08, 2006 2:40 am

Post by Learner »

AOA

Dear LinuxFreaK,

Please guide a bit more that how can I make a script for this.

Also that it will do the same as checking each account one by one from top to bottom.

If an account at 10 position have 20 MB mail it will down load all and move to next position but the position 1-9 have to wait for more.
Thanks & Regards


Muhammad Ali
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear Learner,
Salam,

Example Script:

Code: Select all

USERS=(user1 user2 user3 user4)
for USER in ${USERS[@]}
do
   your commands here
done
Create a file users.txt

Code: Select all

for USER in `cat /path/to/user.txt`
do
   your commands here
done
Best Regards.
Farrukh Ahmed
Learner
Lance Naik
Posts: 41
Joined: Wed Nov 08, 2006 2:40 am

Post by Learner »

AOA

Dear LinuxFreaK,

The .fetchmailrc file contain the users details with passwords,

Code: Select all

poll mail.abcd.com with proto POP3
user 'username@abcd.com' there with password 'xxxxxxxx' is username
How do I set them in the script you have written because evry users have different password of their emails.
Thanks & Regards


Muhammad Ali
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear Laerner,
Salam,
Learner wrote:The .fetchmailrc file contain the users details with passwords,

Code: Select all

poll mail.abcd.com with proto POP3
user 'username@abcd.com' there with password 'xxxxxxxx' is username
How do I set them in the script you have written because evry users have different password of their emails.
Do not you have .fetchmailrc in every user directory. If you do not have then you can create it with same way using shell script and execute fetchmail to fetch mails from remote mail server.

Best Regards.
Farrukh Ahmed
Learner
Lance Naik
Posts: 41
Joined: Wed Nov 08, 2006 2:40 am

Post by Learner »

Dear LinuxFreaK


Sorry I didnt get your point what are you trying to say.
Do not you have .fetchmailrc in every user directory. If you do not have then you can create it with same way using shell script and execute fetchmail to fetch mails from remote mail server.
Please guide me in detail I am still confussed
Thanks & Regards


Muhammad Ali
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Post by LinuxFreaK »

Dear Learner,
Salam,

Just go through following document and it will give you better understanding.

FYI, http://www.howtoforge.com/debian_etch_fetchmail

Best Regards.
Farrukh Ahmed
Post Reply