{"id":12,"date":"2011-02-21T15:35:47","date_gmt":"2011-02-21T22:35:47","guid":{"rendered":"http:\/\/blog.gptnet.net\/?p=12"},"modified":"2011-02-21T16:06:32","modified_gmt":"2011-02-21T23:06:32","slug":"sharing-large-files-with-the-convinience-of-email","status":"publish","type":"post","link":"https:\/\/blog.gptnet.net\/?p=12","title":{"rendered":"Sharing large files with the convinience of email"},"content":{"rendered":"<p>In today&#8217;s world email became preferred way of communication in public and private sectors. With the progress and ever increased popularity of multimedia content on the network average email size increased. Many organization face the dilemma of keeping up to date their software and hardware to meet this ever changing requirements. I this article I would be focusing on mid- to large business organizations that have their own email private infrastructure. How to share large files with the convenience factor of email when your current email infrastructure can&#8217;t support it.<\/p>\n<p><!--more--><\/p>\n<h2>Facing reality<\/h2>\n<p>Classical problem that many organizations face: your users need to share large files with the clients and the only way is email. One option is to increase email size limits but it doesn&#8217;t mean that recipients email server will be accepting large files. For example, in my organization we have aging and now discontinued Microsoft Exchange Server 2000 Standard Edition. For those unfamiliar with this product: it has database storage limit of 16GB. We have approximately 175 mailboxes and thus keeping user&#8217;s mailbox as small as possible is one of the essentials. We implemented a 5mb limit for all incoming and outgoing emails, which is craziness if you ask me. In 21st century, where business is populated with multimedia and large files this can bring everything to a stillness.<\/p>\n<h2>Solution<\/h2>\n<p>There are a lot of ways you can share files: ftp, web-based file upload but neither one can match convince and simplicity of email. On the internet there are services such as <a href=\"https:\/\/www.yousendit.com\/\" target=\"_blank\">Yousendit<\/a> that allow someone share large files with the &#8220;convenience of email. This means that users will have to upload private and sensitive\u00a0 data to &#8220;external&#8221; servers. Many organization, just like mine, wouldn&#8217;t allow this. The only way is to have similar in-house solution that can be monitored and kept secure. ZendTo is one of the products that does it all and more.<\/p>\n<h2>ZendTo<\/h2>\n<p>This is a web-based package that will let you provide a secure and easy method for your users to be able to exchange files with other people, even with external members that do not have any login rights at your organization. Unlike other commercial services, you do not have to trust your files or login rights to any other services; you keep system in-house. It will integrate with any Active Directory, LDAP or IMAP system you already have in place. Best of all it is Open Source and free.<\/p>\n<h2>Installation<\/h2>\n<p>This example will be based on Ubuntu Server 10.04 LTS, ZendTo 3.63 and current setup in my organization. The following software will be used:<\/p>\n<ol>\n<li>Apache 2.2.17<\/li>\n<li>MySQL 5.5<\/li>\n<li>ClamAV 0.96<\/li>\n<li>PHP 5.2.6<\/li>\n<li>phpMyAdmin 3.3.9.2<\/li>\n<li>Postfix 2.8<\/li>\n<\/ol>\n<p>I am not covering installation of basic Ubuntu server, there are plenty of articles and manuals describing it. Assuming that you have instance of Ubuntu server running. We will be using Active Directory as means for our users to authenticate. i will be using the following in my examples:<\/p>\n<ul>\n<li>ZendTo server ip address: 192.168.1.4<\/li>\n<li>ZendTo server&#8217;s FQDN: zendto.gptnet.net<\/li>\n<li>Domain controlers: dc1.gptnet.ltd, dc2.gptnet.ltd<\/li>\n<li>install directory \/home\/zendto (create if you don&#8217;t have it)<\/li>\n<li>dropoffs directory \/data (in my case on the separate harddrive)<\/li>\n<li>postfix relays email to our gateway (emailgate.gptnet.ltd)<\/li>\n<\/ul>\n<p>Lets start by installing postfix, clamav and rrdtool<\/p>\n<p>apt-get install postfix, postfix-doc<\/p>\n<p>Select &#8220;Internet site&#8221; and enter your system mail name (zendto.gptnet.net in my case).<\/p>\n<p>Edit \/etc\/postfix\/main.cf to work with your email infrastructure. In my case all email will be relayed to our email gateway. Config file:<\/p>\n<blockquote><p>myhostname = zendto.gptnet.ltd<br \/>\nalias_maps = hash:\/etc\/aliases<br \/>\nalias_database = hash:\/etc\/aliases<br \/>\nmyorigin = zendto.gptnet.ltd<br \/>\nmydestination =<br \/>\nrelayhost = emailgate.gptnet.ltd<br \/>\nmynetworks = 127.0.0.0\/8<br \/>\nmailbox_size_limit = 0<br \/>\nrecipient_delimiter = +<br \/>\ninet_interfaces = all<br \/>\nlocal_transport = errot:No local mail delivery<br \/>\nsmtpd_helo_required = yes<br \/>\nvirtual_alias_maps = hash:\/etc\/postfix\/virtual<\/p><\/blockquote>\n<p>Secondly we need to install apache and php components:<\/p>\n<blockquote><p>apt-get install apache2, php5, libapache2-mod-php5, php5-ldap, php5-cli<\/p><\/blockquote>\n<p>verify that apache working is with php by creating inside \/var\/www\u00a0 test.php file with the following content:<\/p>\n<blockquote><p>&lt;?php phpinfo(); ?&gt;<\/p><\/blockquote>\n<p>and the going to http:\/\/zendto.gptnet.net\/test.php and you should see output.<\/p>\n<p>Next step is to install MySQL:<\/p>\n<blockquote><p>apt-get install mysql-server, mysql-client<\/p><\/blockquote>\n<p>Please take note of the root password.<\/p>\n<p>More installation:<\/p>\n<blockquote><p>apt-get install clamav, clamav-daemon, rrdtool<\/p><\/blockquote>\n<p>now lets get ZendTo<\/p>\n<blockquote><p>cd \/tmp<br \/>\nwget http:\/\/www.zend.to\/files\/ZendTo-3.63-1.tgz<br \/>\ntar xvfz ZendTo-3.65-1.tgz<br \/>\nmv -R ZendTo-3.65-1 \/home\/zendto<\/p><\/blockquote>\n<p>install php admin for SQL management and backup<\/p>\n<blockquote><p>wget http:\/\/downloads.sourceforge.net\/project\/phpmyadmin\/phpMyAdmin\/3.3.9.2\/phpMyAdmin-3.3.9.2-all-languages.tar.gz<br \/>\ntar xvfz phpMyAdmin-3.3.9.2*<br \/>\nmv -r phpMyAdmin-3.3.9.2 \/var\/www\/sqlmgr<\/p><\/blockquote>\n<p>now lets configure apache: we will be having 2 websites running, one hosting phpmyadmin and another ZendTo application. To secure phpmyadmin we will be running this website on non-standard port (port 777 in my case).<\/p>\n<blockquote><p>cd \/etc\/apache2\/sites-available<\/p><\/blockquote>\n<blockquote><p>cp default zendto<\/p><\/blockquote>\n<p>edit default website to listen to port 777 by editing the following line: &lt;VirtualHost *:777&gt;<\/p>\n<blockquote><p>vi \/etc\/apache2\/sites-available\/default<\/p><\/blockquote>\n<p>make apache listen to port 777 by adding the following 2 lines in \/etc\/apache\/hosts.conf<\/p>\n<blockquote><p>NameVirtualHost *:777<\/p><\/blockquote>\n<blockquote><p>Listen 777<\/p><\/blockquote>\n<p>edit zendto website to point to a different folder<\/p>\n<blockquote><p>vi \/etc\/apache2\/site-available\/zendto<\/p><\/blockquote>\n<p>and change line 4 to look like this:<\/p>\n<blockquote><p>DocumentRoot: \/home\/zendto\/www<\/p><\/blockquote>\n<p>Next we need to fix php.ini settings. Edit the following file: <tt>\/etc\/php5\/apache2\/php.ini<\/tt><\/p>\n<p># error_reporting = E_ALL &amp; ~E_DEPRECATED &amp; ~E_NOTICE<br \/>\n# allow_call_time_pass_reference = On<br \/>\n# max_execution_time = 7200<br \/>\n# max_input_time = 7200<br \/>\n# memory_limit = 300M<br \/>\n# error_reporting = E_ALL &amp; ~E_NOTICE &amp; ~E_DEPRECATED<br \/>\n# display_errors = On<br \/>\n# post_max_size = 2000M<br \/>\n# upload_max_filesize = 2GB<\/p>\n<p>Finally you need to enable zendto website and restart apache to implement the changes:<\/p>\n<blockquote><p>a2ensite zendto<br \/>\nservice apache2 restart<\/p><\/blockquote>\n<p>Now Log into phpMyadmin and create user and database (please note these values). Then execute file \/home\/zendto\/sql\/zendto.mysql to create MySQL tables.<\/p>\n<p>Now we need to register website\u00a0for reCAPTCHA service. Its free all you need is google account. You can do that by following this link:<\/p>\n<p><a href=\"https:\/\/admin.recaptcha.net\/recaptcha\/createsite\/\" target=\"_blank\">https:\/\/admin.recaptcha.net\/recaptcha\/createsite\/<\/a><\/p>\n<p>Now you need to edit the following lines in\u00a0\/home\/zendto\/config\/preferences.php<\/p>\n<blockquote><p>define(&#8216;NSSDROPBOX_BASE_DIR&#8217;,&#8217;\/home\/zendto\/&#8217;);<br \/>\ndefine(&#8216;NSSDROPBOX_LIB_DIR&#8217;,&#8217;\/home\/zendto\/lib\/&#8217;);<br \/>\ndefine(&#8216;NSSDROPBOX_DATA_DIR&#8217;,&#8217;\/data\/zendto\/&#8217;);<br \/>\ndefine(&#8216;SqlBackend&#8217;, &#8216;MySQL&#8217;);<br \/>\n&#8216;MySQLhost&#8217; =&gt; &#8216;localhost&#8217;,<br \/>\n&#8216;MySQLuser&#8217; =&gt; &#8216;yourvalue&#8217;,<br \/>\n&#8216;MySQLpassword&#8217; =&gt; &#8216;yourvalue&#8217;,<br \/>\n&#8216;MySQLdb&#8217; =&gt; &#8216;yourvalue&#8217;,<br \/>\n&#8216;maxBytesForDropoff&#8217; =&gt; 2147483647,<br \/>\n&#8216;maxBytesForFile&#8217; =&gt; 2147483647,<br \/>\n&#8216;recaptchaPublicKey&#8217; =&gt; &#8216;yourownvalue&#8217;,<br \/>\n&#8216;recaptchaPrivateKey&#8217; =&gt; &#8216;yourownvalue&#8217;,<br \/>\n&#8216;authenticator&#8217; =&gt; &#8216;AD&#8217;,<br \/>\n&#8216;authLDAPAdmins&#8217; =&gt; array(&#8216;itboss&#8217;),<br \/>\n&#8216;authLDAPBaseDN1&#8217; =&gt; &#8216;DC=gptnet,DC=ltd&#8217;,<br \/>\n&#8216;authLDAPServers1&#8217; =&gt; array(&#8216;dc1.gptnet.ltd&#8217;,&#8217;dc2.gptnet.ltd&#8217;),<br \/>\n&#8216;authLDAPAccountSuffix1&#8217; =&gt; &#8216;@gptnet.ltd&#8217;,<br \/>\n&#8216;authLDAPUseSSL1&#8217; =&gt; false,<br \/>\n&#8216;authLDAPBindUser1&#8217; =&gt; &#8216;bind@gptnet.ltd&#8217;,<br \/>\n&#8216;authLDAPBindPass1&#8217; =&gt; &#8216;STRONGPAssword&#8217;,<br \/>\n&#8216;defaultEmailDomain&#8217; =&gt; &#8216;gptnet.net&#8217;<br \/>\n&#8217;emailDomainRegexp&#8217; =&gt; &#8216;\/gptnet\/&#8217;,<br \/>\n&#8216;cookieName&#8217; =&gt; &#8216;yourvalue&#8217;,<br \/>\n&#8216;cookieSecret&#8217; =&gt; &#8216;yourvalue&#8217;,<\/p><\/blockquote>\n<p>Now lets update permissions and create dropoff folders:<\/p>\n<blockquote><p>chown -R www-data \/home\/zendto<br \/>\nchgrp -R www-data \/home\/zendto<br \/>\nchmod -R 755 www-data \/home\/zendto<br \/>\nmkdir \/data\/zendto<br \/>\nmkdir \/data\/zendto\/dropoffs<br \/>\nchown -R www-data \/data\/zendto<br \/>\nchgrp -R www-data \/data\/zendto<br \/>\nchmod -R 777 \/data\/zendto<\/p><\/blockquote>\n<p>That&#8217;s all. Now you can fully access it from your browser by hitting <a href=\"http:\/\/zendto.gptnet.net\">http:\/\/zendto.gptnet.net<\/a><\/p>\n<p>Please note that your ZendTo web server needs to have access to google.com in order for reCAPTCHA to work. Please configure your firewall accordingly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In today&#8217;s world email became preferred way of communication in public and private sectors. With the progress and ever increased popularity of multimedia content on the network average email size increased. Many organization face the dilemma of keeping up to &hellip; <a href=\"https:\/\/blog.gptnet.net\/?p=12\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6,5,4,3],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-random-stuff","tag-dropoff","tag-email-large-files","tag-sharing-files","tag-zendto"],"_links":{"self":[{"href":"https:\/\/blog.gptnet.net\/index.php?rest_route=\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.gptnet.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.gptnet.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.gptnet.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.gptnet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12"}],"version-history":[{"count":21,"href":"https:\/\/blog.gptnet.net\/index.php?rest_route=\/wp\/v2\/posts\/12\/revisions"}],"predecessor-version":[{"id":25,"href":"https:\/\/blog.gptnet.net\/index.php?rest_route=\/wp\/v2\/posts\/12\/revisions\/25"}],"wp:attachment":[{"href":"https:\/\/blog.gptnet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.gptnet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.gptnet.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}