Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra - Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack (14) Thread Tools Display Modes
  14 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 01-25-2006, 05:13 PM
Zimbra Employee
 
Posts: 2,073
Default [SOLVED] Fetchmail from other servers (aka account aggregation)

NOTE: this should all happen on an MTA server, or the deliveries will fail (eg, server should be running the mta service)

I've attached a fetchmail config creation script to this post - remove the .txt extension, make it executable, and you can use this for account aggregation.

(All of this can be done as the zimbra user)

Here how it works - you use it to configure fetchmail to grab a number of external accounts, and deliver them to a local account:

Code:
zmfetchercfg -a -u account@remote.domain.com -H remote.server.com:993 -l account@zimbra.local.com -p 'remote_pass' -s -P IMAP -f "Inbox" -k -c /opt/zimbra/conf/my_fetchrc

zmfetchercfg -a -u account@remote.domain.com -H remote.server.com:993 -l account@zimbra.local.com -p 'remote_pass' -s -P IMAP -f "Work/Other folder" -k -c /opt/zimbra/conf/my_fetchrc

zmfetchercfg -a -u gmail.user@gmail.com -H pop.gmail.com:995 -l other_account@zimbra.local.com -p 'remote_gmail_pass' -s -P POP3 -k -c /opt/zimbra/conf/my_fetchrc

chmod 710 /opt/zimbra/conf/my_fetchrc
This sets up 3 accounts - 2 IMAP from the same server (different folders) and a pop account from gmail (delivered to a different local user). The -k tells it to leave the mail on the server. Also, all of my accounts use SSL to connect - the '-s' flag. If you don't need that, you can omit it (but you'll probably have to change the ports, too).

To test it out
Code:
HOME=/some/dir/I/can/write/to fetchmail -v -c -f /opt/zimbra/conf/my_fetchrc
If everything looks good, remove the '-c' and it will really grab the mail.

Things to be careful about: the local account (-l option) needs to exist, or you'll bounce all your mail, which is bad.

Adding the -d option to the fetchmail call will cause this to run as a daemon, and periodically check your mail.

The folder options apply to the remote account, NOT the local account - if you want to control where it gets delivered, set up a filter.


OTHER STUFF:
Yes, this is horribly insecure. Yes, you're going to be storing your email passwords on disk in an easily readable format. This is more intended for the home/hobby user, not for any serious enterprise deployment.
Attached Files
File Type: txt zmfetchercfg.txt (4.6 KB, 2345 views)

Last edited by marcmac : 01-25-2006 at 05:19 PM.
Reply With Quote
  #2 (permalink)  
Old 03-16-2006, 04:24 PM
Member
 
Posts: 12
Default Why can't we just use fetchmail?

Hi,

I'm not sure yet how zimbra stores its mails,
but can't we just use the normal fetchmail tool
and make procmail drop the mail somewhere.
Because, currently, a lot of filtering is done with procmail on our systems
for mail fetched from other servers.
Reply With Quote
  #3 (permalink)  
Old 03-16-2006, 04:50 PM
Zimbra Employee
 
Posts: 4,784
Default

You need to deliver via LMTP or SMTP. If you can do that then you can use your current setup.
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #4 (permalink)  
Old 04-16-2006, 01:42 PM
Senior Member
 
Posts: 73
Default

Hi marcmac

I'm a newbie, and don't quite understand your post.

Do you mean that your fetchmail script will import mails from other non-Zimbra mail servers (imap and pop3) into Zimbra mailboxes?

I want to use zimbra as a webmail (like squirrelmail) for other non-Zimbra imap servers, instead of migrating the mails from the non-Zimbra servers to the Zimbra server- but I don't think this can be done, right? Maybe your script is a solution to my problem?

Thank you very much in anticipation.

gui

Last edited by zzzzsg : 04-16-2006 at 01:55 PM.
Reply With Quote
  #5 (permalink)  
Old 04-16-2006, 02:01 PM
Zimbra Consultant & Moderator
 
Posts: 11,508
Default

Yes, fetchmail gets mail from other servers and downloads them to the Zimbra server. It's used for getting mail that's in, let's say, your ISPs mailserver.

You can't use zimbra as a front-end to other mail servers as it's meant to be a complete mail/groupware solution and runs it's own postfix instance.

What you can do is migrate all your mail using something like imapsync, have a search of the forums and see how it's been done by others.
__________________
Regards


Bill

Last edited by phoenix : 04-16-2006 at 02:12 PM.
Reply With Quote
  #6 (permalink)  
Old 04-16-2006, 09:08 PM
Senior Member
 
Posts: 73
Default

Thanks, Bill.

Yes, I've used imapsync to import mailboxes from one imap server to another.

Although Zimbra is not built to be like web front-end like Squirrelmail, can we use this fetchmail script to import mails from other imap servers into Zimbra server whenever an user logs on to Zimbra? In this way, Zimbra is like a front-end although the mails will be imported into its database. Will it take a long time?

Zimbra is fantastic but seems kind of slow, and requires a more powerful server than the one we have now. That's why I'm thinking of Zimbra as a 'front-end' (even if it is via fetchmail) for my sendmail/imap-uw mail server, until I have a more powerful server.

gui



Quote:
Originally Posted by phoenix
Yes, fetchmail gets mail from other servers and downloads them to the Zimbra server. It's used for getting mail that's in, let's say, your ISPs mailserver.

You can't use zimbra as a front-end to other mail servers as it's meant to be a complete mail/groupware solution and runs it's own postfix instance.

What you can do is migrate all your mail using something like imapsync, have a search of the forums and see how it's been done by others.
Reply With Quote
  #7 (permalink)  
Old 04-17-2006, 03:51 AM
Zimbra Consultant & Moderator
 
Posts: 11,508
Default

I don't know if there would be an easy way to use Zimbra to imort mail when a user logs-on. If you're saying that your server is 'slow' then I would suggest that importing mail at each logon wouldn't be an effective answer. Zimbra should only appear slow at first logon as it has to cache a lot in the browser, after that it should be acceptable. What are the specs of the server you're running zimbra on? Some of the users in the forum have Zimbra on relatively slow systems and seem to get reasonable performance, you could always reduce the resources that zimbra uses - have a search of the forums for some some info. Do you also have enough ram on the Zimbra server?
__________________
Regards


Bill
Reply With Quote
  #8 (permalink)  
Old 04-17-2006, 01:05 PM
Senior Member
 
Posts: 73
Default

Hi bill

thanks for the reply. so the fetchmail script here won't import mails from other non-zimbra imap servers when user logs on?

yes, you are right, it will probably be slow if I use fetchmail to import mails.

My zimbra server is only Pentium III 550MHz, 1 GB Ram.
My existing mail server (sendmail, imap-uw) is Pentium 4 2GHz 1GB RAM.

Zimbra is great, but I guess I have to buy a new server.

Last edited by zzzzsg : 04-17-2006 at 01:20 PM.
Reply With Quote
  #9 (permalink)  
Old 04-17-2006, 01:26 PM
Zimbra Consultant & Moderator
 
Posts: 11,508
Default

I'm not quite saying you couldn't use fetchmail to import mail, rather that it would be painfully slow. I'm also still fairly new to Linux so I don't know if it could be incorporated but I wouldn't go down that route.

That is a very slow processor you have on that system and way below the recommended spec. Apart from some of the techniques described in the forums for reducing the resources used by Zimbra I don't really know what to suggest other than the obvious, get a new server.
__________________
Regards


Bill
Reply With Quote
  #10 (permalink)  
Old 05-04-2006, 09:01 AM
Junior Member
 
Posts: 7
Default

Okay I have a question about this.. are there two files I'm creating? I tried to follow the instructions, but I'm getting an error:
Code:
fetchmail:/opt/zimbra/conf/zmfetcheracct.conf:1: parse error at /opt/zimbra/conf/zmfetchercfg
Reply With Quote
Reply


Thread Tools
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0