Maintain email integration Zarafa & MailServer: Z-Pull-Vmail

Zarafa is a MS exchange server replacement with outlook and mobile compatibility, including IMAP/POP3 protocols support, and iCal/CalDAV feature services
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:

https://account.synology.com/support/support_form.php?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
User avatar
TosoBoso
Novice
Novice
Posts: 49
Joined: Sun Jul 06, 2014 10:17 am

Maintain email integration Zarafa & MailServer: Z-Pull-Vmail

Postby TosoBoso » Sat Nov 29, 2014 11:24 pm

All,
for the community a package with collection of scripts to maintain email integration of Zarafa and adding a few more options.
It will respectively re-activate Postfix settings as described in Zarafa How-To below each time MailServer package is updated and templates are deleted (see manual steps automated): http://www.zarafa.com/wiki/index.php/Za ... own_domain

With dependency to MailServer Z-Pull-Vmail will repair Postfix when stopped and started by update process which looks like this:

Image
<When Updating MailServer [Z-Pull-Vmail] will be stopped. Do you want to continue>..
Press Yes and the package will do it's work. The log-file of Z-Pull-Vmail will look like this:

> 2014.11.19-19.56.53 added vmail user in zarafa server config to zarafa admin user group
> 2014.11.19-19.56.53 added spam and antivirus integration to zarafa dagent config
> 2014.11.19-19.56.54 added vmail user to system in disabled mode random pwd (synouser cmd)
> 2014.11.19-19.56.55 changed group permission fetchmail, dagent, etc. files for vmail to write to
> 2014.11.19-19.56.56 changed fetchmail init script to run as vmail user instead of default root
> 2014.11.19-19.56.56 patching zarafa copy_licensed for outlook integration to work with dsm-5.1
> 2014.11.19-19.58.51 trim & archive logs to vmail home in cron (sun 7pm); initial clean-up 250 MB
> 2014.11.19-19.58.51 installed vmail settings in mail master template
> 2014.11.19-19.58.52 installed zarafa mailbox settings in mail main template
> 2014.11.19-19.58.52 (re)installed fetchmail to pass through postfix settings for spam, av scanning
> 2014.11.22-18.46.36 re-installed vmail settings in mail master template <= repair post update
> 2014.11.22-18.46.38 re-installed zarafa mailbox settings in mail main template<= repair post update

And Zarafa mailbox will be working again post update without the hassle of rebuilding the Postfix configuration.

Additional helpful features of the package are:

- Patching Fetchmail init to run as user vmail user at minimum rights instead of default root which is a security enhancement
- Zarafa log-files in system area can be trimmed to 10 when greater 250 lines as logs can get quite big over time
- Advanced features for Postfix to have Zarafa pushing mails straight into junk mail when marked by SpamAssasin
- Advanced features for Fetchmail to pass through Postfix and hence get av, spam scans (default: Fetchmail bypasses the scans)
> See: http://www.synology-forum.de/showthread ... MailServer
- Power-user feature to preserve mail main template instead of rebuilding it and restore other template files
> for users with additional features in the templates that like to enjoy the automatic backup restore to preserve their settings

Important Notes:

You will find the package on the Community Package Hub: add https://www.cphub.net to your package sources and set trust level to Synology as trusted publishers; - then search for the package.
This package is designed to run for users with their own (dynamic) domain using Postfix with Fetchmail on top. Users with Fetchmail only might not benefit from all features and potentially run into trouble when Spam, AV, Postfix are not configured.
User vmail operating Zarafa Postfix dagent and Fetchmail as well as group maild are created to enable running at minimal rights and user vmail is disabled for DSM login by purpose.
I also maintain the package in German Synology forum (hence links to other Ger threads) under http://www.synology-forum.de/showthread ... Pull-Vmail you might check for reference.
Last edited by TosoBoso on Sat Oct 31, 2015 1:49 pm, edited 11 times in total.
SPK Developer Zarafa4h (Wiki helps: http://wiki.zarafa.com/index.php/Zarafa4h_Instructions_for_Synology_NAS). DS415+, DS412+, DS214play, MailServer, Zarafa4h, OwnCloud, Docker, Debian Chroot, etc.
jvanzijl
Experienced
Experienced
Posts: 103
Joined: Mon Jan 31, 2011 6:10 pm
Location: Amsterdam

Re: Maintain email integration Zarafa & MailServer: Z-Pull-V

Postby jvanzijl » Tue Dec 02, 2014 12:22 am

Hi TosoBoso,

Great package!
One problem though: when I installed the package it looks like fetchmail doesn't work anymore.
Also the file etc/fetchmailrc is now empty (in Zarafa Administration there still are fetchmail entries).
In the Zarafa fetchmail logfile is says:

fetchmail: restarting fetchmail (/etc/fetchmailrc changed)
fetchmail: WARNING: Running as root is discouraged.
File /etc/fetchmailrc must be owned by you.

I did a chmod to 777 on this file, but that didn't make a difference
an update of a fetchmail entry in Zarafa Administration didn't have a result either.
What's gone wrong?

Greetings, John
DS 2413+
7 x Hitachi H3IK40003272SE
5 x WD60EFRX
2x DS1511+, 1x DX510
15x WD30EZRSDTL
APC Back-UPS CS500 and CS650
Popcorn Hour A400 and C200, iPhone, iPad
User avatar
TosoBoso
Novice
Novice
Posts: 49
Joined: Sun Jul 06, 2014 10:17 am

Re: Maintain email integration Zarafa & MailServer: Z-Pull-V

Postby TosoBoso » Tue Dec 02, 2014 7:11 am

Hi,
First ting if in Zarafa admin are still entries just save and restart fetchmail in this section.
It should write again the fetchmailrc in Zarafa area and this gets copied over to /etc by the package (provided you have fetchmail to pass postfix enabled and package is running)

I did not come across an empty fetchmailrc and when the package is installed with the switch enabled fetchmail runs as user vmail and not as root as default it was ok, confirmed by others.
Fetchmail-log will look like this (and runs as vmail instead of root when package installed):
> 2014.12.02-06.58.52 starting as vmail fetchmail service
> fetchmail: starting fetchmail 6.3.26 daemon

Did you perhaps install and then uninstall just to get the Zarafa DSM 5.1 Patch?
I will try to recreate this special case. Can you post the logs of fetchmail and tell me which options were used? If you straight un-installed and have no logs can you reinstall inc. options fetchmail not as root and fetchmail to pass postfix, create / verify fetchmail user in Zarafa admin and give it a try again?
To fix your problem as is: copy the fetchmailrc (check that it is not empty) in /usr/syno/etc/packages/Zarafa/fetchmailrc [mod: had wrong file] to etc/ and make it roots owner only (chown root:root fetchmailrc; chmod 700 fetchmailrc).
br TosoBoso
Last edited by TosoBoso on Tue Dec 02, 2014 8:26 pm, edited 1 time in total.
SPK Developer Zarafa4h (Wiki helps: http://wiki.zarafa.com/index.php/Zarafa4h_Instructions_for_Synology_NAS). DS415+, DS412+, DS214play, MailServer, Zarafa4h, OwnCloud, Docker, Debian Chroot, etc.
jvanzijl
Experienced
Experienced
Posts: 103
Joined: Mon Jan 31, 2011 6:10 pm
Location: Amsterdam

Re: Maintain email integration Zarafa & MailServer: Z-Pull-V

Postby jvanzijl » Tue Dec 02, 2014 8:08 am

Hi,

I did install en not uninstall, I used the default options whilst installing, this includes fetchmail not as root and fetchmail to pass postfix.
Maild group is created and root is the owner of fetchmailrc (755).
The end of the fetchmail log in Zarafa admin is:

fetchmail: Warning: the connection is insecure, continuing anyways. (Better use --sslcertck!)
fetchmail: Warning: the connection is insecure, continuing anyways. (Better use --sslcertck!)
fetchmail: Warning: the connection is insecure, continuing anyways. (Better use --sslcertck!)
fetchmail: Warning: the connection is insecure, continuing anyways. (Better use --sslcertck!)
fetchmail: Warning: the connection is insecure, continuing anyways. (Better use --sslcertck!)
fetchmail: Warning: the connection is insecure, continuing anyways. (Better use --sslcertck!)
fetchmail: Warning: the connection is insecure, continuing anyways. (Better use --sslcertck!)
fetchmail: restarting fetchmail (/etc/fetchmailrc changed)
fetchmail: WARNING: Running as root is discouraged.
File /etc/fetchmailrc must be owned by you.
2014.12.01-23.34.00 starting as vmail fetchmail service
2014.12.01-23.54.02 starting as vmail fetchmail service
2014.12.02-00.10.34 starting as vmail fetchmail service
2014.12.02-00.12.02 starting as vmail fetchmail service
2014.12.02-00.42.50 starting as vmail fetchmail service
2014.12.02-00.48.41 starting as vmail fetchmail service

What will the fetchmail user in Zarafa do??

Greetings John
DS 2413+
7 x Hitachi H3IK40003272SE
5 x WD60EFRX
2x DS1511+, 1x DX510
15x WD30EZRSDTL
APC Back-UPS CS500 and CS650
Popcorn Hour A400 and C200, iPhone, iPad
jvanzijl
Experienced
Experienced
Posts: 103
Joined: Mon Jan 31, 2011 6:10 pm
Location: Amsterdam

Re: Maintain email integration Zarafa & MailServer: Z-Pull-V

Postby jvanzijl » Tue Dec 02, 2014 8:19 am

Hi,

There is no fetchmailrc in /usr/local/zarafa/etc/init.d/fetchmail (this is a file, not a folder)
There is a fetchmailrc in /usr/local/zarafa/etc but that one is empty except for the line
# Place your configuration here

I will uninstall and install again.

Greetings, John
DS 2413+
7 x Hitachi H3IK40003272SE
5 x WD60EFRX
2x DS1511+, 1x DX510
15x WD30EZRSDTL
APC Back-UPS CS500 and CS650
Popcorn Hour A400 and C200, iPhone, iPad
jvanzijl
Experienced
Experienced
Posts: 103
Joined: Mon Jan 31, 2011 6:10 pm
Location: Amsterdam

Re: Maintain email integration Zarafa & MailServer: Z-Pull-V

Postby jvanzijl » Tue Dec 02, 2014 8:48 am

OK, I installed Z-Pull-Vmail again with the required options.
Package log:

2014.12.02-08.29.57 added vmail user in zarafa server config to zarafa admin user group
2014.12.02-08.29.57 added spam and antivirus integration to zarafa dagent config
2014.12.02-08.29.59 added vmail user to system in disabled mode random pwd (synouser cmd)
2014.12.02-08.30.00 changed group permission fetchmail, dagent, etc. files for vmail to write to
2014.12.02-08.30.03 changed fetchmail init script to run as vmail user instead of default root
2014.12.02-08.37.28 (re)installed fetchmail to pass through postfix settings for spam, av scanning

In Zarafa admin there still are my five users in the fetchmail
etc/fetchmailrc is still empty
When I copy a backup fetchmailrc to /etc and then restart fetchmail in Zarafa admin fetchmailrc is empty again

Now I have copied the backup fetchmailrc again to /etc
I have tried to stop/start mailserver, but it can't without stopping Z-Pull_Vmail first.
I will see what happens.....

Thanks for helping me!

Greetings, John
DS 2413+
7 x Hitachi H3IK40003272SE
5 x WD60EFRX
2x DS1511+, 1x DX510
15x WD30EZRSDTL
APC Back-UPS CS500 and CS650
Popcorn Hour A400 and C200, iPhone, iPad
jvanzijl
Experienced
Experienced
Posts: 103
Joined: Mon Jan 31, 2011 6:10 pm
Location: Amsterdam

Re: Maintain email integration Zarafa & MailServer: Z-Pull-V

Postby jvanzijl » Tue Dec 02, 2014 9:55 pm

Too bad, I couldn't get it to work, Zarafa also stopped receiving mail via postfix....
I had to unstall Z-Pull-Vmail. Unfortunately that also deleted the vmail user and it took me some time to find out that that was the case.
In the end I restored a settingsfile (.dss) from a couple of days ago and reinstalled Zarafa and now everything works again as advertised.

I'm sorry you're package didn't work for me, because it looks just like the solution to a problem I'm having regularly.
Oh well....

Please post when you've found a solution and I will try your package again.

Thanks so far,

Greetings, John
DS 2413+
7 x Hitachi H3IK40003272SE
5 x WD60EFRX
2x DS1511+, 1x DX510
15x WD30EZRSDTL
APC Back-UPS CS500 and CS650
Popcorn Hour A400 and C200, iPhone, iPad
User avatar
TosoBoso
Novice
Novice
Posts: 49
Joined: Sun Jul 06, 2014 10:17 am

Re: Maintain email integration Zarafa & MailServer: Z-Pull-V

Postby TosoBoso » Tue Dec 02, 2014 11:36 pm

Hi John / jvanzijl,
I'm sure helping you and tried to recreate it.. Found the odd combination / bug (2 hrs later..)
I updated the package to v7 on https://www.cphub.net and it should be available sometime tomorrow 3rd Dec..
Please check and un-install v0.6 first then install v0.7 => it should work now again for postfix and fetchmail..
Sorry for inconvenience, it was a setting I do not have by default so I tested this but did not spot the combination when file with soft-link was over written; -looks like it only happened on non default option settings, which is why it worked with me and some other users
Last edited by TosoBoso on Tue Dec 02, 2014 11:42 pm, edited 1 time in total.
SPK Developer Zarafa4h (Wiki helps: http://wiki.zarafa.com/index.php/Zarafa4h_Instructions_for_Synology_NAS). DS415+, DS412+, DS214play, MailServer, Zarafa4h, OwnCloud, Docker, Debian Chroot, etc.
jvanzijl
Experienced
Experienced
Posts: 103
Joined: Mon Jan 31, 2011 6:10 pm
Location: Amsterdam

Re: Maintain email integration Zarafa & MailServer: Z-Pull-V

Postby jvanzijl » Tue Dec 02, 2014 11:42 pm

Great, I'll try it tomorrow!

Good night, John.
DS 2413+
7 x Hitachi H3IK40003272SE
5 x WD60EFRX
2x DS1511+, 1x DX510
15x WD30EZRSDTL
APC Back-UPS CS500 and CS650
Popcorn Hour A400 and C200, iPhone, iPad
User avatar
TosoBoso
Novice
Novice
Posts: 49
Joined: Sun Jul 06, 2014 10:17 am

Re: Maintain email integration Zarafa & MailServer: Z-Pull-V

Postby TosoBoso » Sun Dec 07, 2014 8:03 am

jvanzijl wrote:Great, I'll try it tomorrow! Good night, John.

Hi John / jvanzijl, had a chance to try? BTW v.08 is now online on https://www.cphub.net/download.php?pid=339
SPK Developer Zarafa4h (Wiki helps: http://wiki.zarafa.com/index.php/Zarafa4h_Instructions_for_Synology_NAS). DS415+, DS412+, DS214play, MailServer, Zarafa4h, OwnCloud, Docker, Debian Chroot, etc.
jvanzijl
Experienced
Experienced
Posts: 103
Joined: Mon Jan 31, 2011 6:10 pm
Location: Amsterdam

Re: Maintain email integration Zarafa & MailServer: Z-Pull-V

Postby jvanzijl » Sun Dec 07, 2014 5:32 pm

Hi Tosoboso,

No not yet.
I want to be sure to have the time to undo all the changes, in case it doesn't work, so I'll wait until I have a bit more time available.

Question: do I need to be on Zarafa 0.6.0?
At the moment I use Zarafa 0.5.5 because Jdo marks 0.6.0 still as experimental.

What would be the best approach: first upgrade to Zarafa 0.6.0 and then install Z-Pull_Vmail or the other way around?

Thanks,

John
DS 2413+
7 x Hitachi H3IK40003272SE
5 x WD60EFRX
2x DS1511+, 1x DX510
15x WD30EZRSDTL
APC Back-UPS CS500 and CS650
Popcorn Hour A400 and C200, iPhone, iPad
User avatar
TosoBoso
Novice
Novice
Posts: 49
Joined: Sun Jul 06, 2014 10:17 am

Re: Maintain email integration Zarafa & MailServer: Z-Pull-V

Postby TosoBoso » Sun Dec 07, 2014 5:58 pm

Thanks for the reply. No need / dependency of Z-Pull-Vmail to Zarafa 0.6. It was build for 0.55.
Also the DSM-5.1 patch taken from JDO2002 works perfectly fine on Zarafa 0.55. RGS TosoBoso
SPK Developer Zarafa4h (Wiki helps: http://wiki.zarafa.com/index.php/Zarafa4h_Instructions_for_Synology_NAS). DS415+, DS412+, DS214play, MailServer, Zarafa4h, OwnCloud, Docker, Debian Chroot, etc.
IanB
Beginner
Beginner
Posts: 27
Joined: Wed Sep 04, 2013 11:35 am

Re: Maintain email integration Zarafa & MailServer: Z-Pull-V

Postby IanB » Thu Dec 11, 2014 2:49 pm

Great idea for a package, it installed OK, now all I need is a Postfix upgrade to test it.

Ian B
jvanzijl
Experienced
Experienced
Posts: 103
Joined: Mon Jan 31, 2011 6:10 pm
Location: Amsterdam

Re: Maintain email integration Zarafa & MailServer: Z-Pull-V

Postby jvanzijl » Sat Dec 13, 2014 4:02 pm

Hi TosoBoso,

I removed the user vmail and installed version 0.9 of Z-Pull-Vmail (which installs its own version of the user vmail), and everything now works OK, albeit Fetchmail only after I saved and restarted Fetchmail in Zarafa Administration.
Thanks a lot!

Greetings, John
DS 2413+
7 x Hitachi H3IK40003272SE
5 x WD60EFRX
2x DS1511+, 1x DX510
15x WD30EZRSDTL
APC Back-UPS CS500 and CS650
Popcorn Hour A400 and C200, iPhone, iPad
User avatar
TosoBoso
Novice
Novice
Posts: 49
Joined: Sun Jul 06, 2014 10:17 am

Re: Maintain email integration Zarafa & MailServer: Z-Pull-V

Postby TosoBoso » Sat Dec 13, 2014 8:36 pm

Great to hear that. Yes it was intended to let the package do the job of vmail user creation working then at minimal rights..
SPK Developer Zarafa4h (Wiki helps: http://wiki.zarafa.com/index.php/Zarafa4h_Instructions_for_Synology_NAS). DS415+, DS412+, DS214play, MailServer, Zarafa4h, OwnCloud, Docker, Debian Chroot, etc.

Return to “Zarafa”

Who is online

Users browsing this forum: No registered users and 1 guest