[SOLVED] Fetchmail from other servers (aka account aggregation)

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
marcmac
Elite member
Elite member
Posts: 2091
Joined: Fri Sep 12, 2014 9:53 pm

[SOLVED] Fetchmail from other servers (aka account aggregation)

Postby marcmac » Wed Jan 25, 2006 6:13 pm

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:


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



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.

zmfetchercfg.txt



timothyp
Posts: 12
Joined: Fri Sep 12, 2014 10:07 pm

[SOLVED] Fetchmail from other servers (aka account aggregation)

Postby timothyp » Thu Mar 16, 2006 6:24 pm

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.
14319KevinH
Ambassador
Ambassador
Posts: 4558
Joined: Fri Sep 12, 2014 9:52 pm

[SOLVED] Fetchmail from other servers (aka account aggregation)

Postby 14319KevinH » Thu Mar 16, 2006 6:50 pm

You need to deliver via LMTP or SMTP. If you can do that then you can use your current setup.
zzzzsg
Advanced member
Advanced member
Posts: 72
Joined: Fri Sep 12, 2014 10:01 pm

[SOLVED] Fetchmail from other servers (aka account aggregation)

Postby zzzzsg » Sun Apr 16, 2006 2:42 pm

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
phoenix
Ambassador
Ambassador
Posts: 26284
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

[SOLVED] Fetchmail from other servers (aka account aggregation)

Postby phoenix » Sun Apr 16, 2006 3:01 pm

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

Rspamd: A high performance spamassassin replacement

If you'd like to see this implemented in a future version of ZCS then please vote on Bugzilla entries 97706 & 108168
zzzzsg
Advanced member
Advanced member
Posts: 72
Joined: Fri Sep 12, 2014 10:01 pm

[SOLVED] Fetchmail from other servers (aka account aggregation)

Postby zzzzsg » Sun Apr 16, 2006 10:08 pm

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 user="10330phoenix"]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.[/QUOTE]
phoenix
Ambassador
Ambassador
Posts: 26284
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

[SOLVED] Fetchmail from other servers (aka account aggregation)

Postby phoenix » Mon Apr 17, 2006 4:51 am

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

Rspamd: A high performance spamassassin replacement

If you'd like to see this implemented in a future version of ZCS then please vote on Bugzilla entries 97706 & 108168
zzzzsg
Advanced member
Advanced member
Posts: 72
Joined: Fri Sep 12, 2014 10:01 pm

[SOLVED] Fetchmail from other servers (aka account aggregation)

Postby zzzzsg » Mon Apr 17, 2006 2:05 pm

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.
phoenix
Ambassador
Ambassador
Posts: 26284
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

[SOLVED] Fetchmail from other servers (aka account aggregation)

Postby phoenix » Mon Apr 17, 2006 2:26 pm

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. :D
Regards

Bill

Rspamd: A high performance spamassassin replacement

If you'd like to see this implemented in a future version of ZCS then please vote on Bugzilla entries 97706 & 108168
teamdc
Posts: 7
Joined: Fri Sep 12, 2014 10:10 pm

[SOLVED] Fetchmail from other servers (aka account aggregation)

Postby teamdc » Thu May 04, 2006 10:01 am

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:
fetchmail:/opt/zimbra/conf/zmfetcheracct.conf:1: parse error at /opt/zimbra/conf/zmfetchercfg

Return to “Administrators”

Who is online

Users browsing this forum: No registered users and 7 guests