Using fetchmail for 200 Email accounts

Taking care of your Linux box.

Using fetchmail for 200 Email accounts

Postby Learner » Thu Jan 29, 2009 3:26 pm

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
Learner
Lance Naik
 
Posts: 41
Joined: Wed Nov 08, 2006 2:40 am

Re: Using fetchmail for 200 Email accounts

Postby LinuxFreaK » Tue Feb 03, 2009 9:09 am

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
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi

Postby Learner » Tue Feb 03, 2009 11:34 am

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
Learner
Lance Naik
 
Posts: 41
Joined: Wed Nov 08, 2006 2:40 am

Re:

Postby LinuxFreaK » Fri Feb 06, 2009 12:05 pm

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
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi

Postby Learner » Mon Feb 09, 2009 2:56 pm

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
Learner
Lance Naik
 
Posts: 41
Joined: Wed Nov 08, 2006 2:40 am

Re:

Postby LinuxFreaK » Tue Feb 10, 2009 8:56 am

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
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi

Postby Learner » Sat Feb 21, 2009 1:57 pm

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
Learner
Lance Naik
 
Posts: 41
Joined: Wed Nov 08, 2006 2:40 am

Postby LinuxFreaK » Mon Feb 23, 2009 10:07 am

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
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi


Return to “%s” Administration

Who is online

Users browsing this forum: No registered users and 1 guest

cron