Quote:"Push" e-mail
Push e-mail is used to describe email systems that provide an always-on capability, in which new email is actively transferred (pushed) to the e-mail client on your smartphone, etc. This is as opposed to the email client on your device polling the server for mail every 5min/30min/hour. (Immediate vs. Every once in a while)
Quote:Z-Push - open source push technology
Z-Push is an implementation of the ActiveSync protocol which is used 'over-the-air' for multi platform ActiveSync devices, including Windows Mobile, iPhone, Sony Ericsson and Nokia mobile devices. With Z-Push any groupware can be connected and synced with these devices.
HOWTO: push email unsecurely* with ispCP 1.0.7 OMEGA on Debian Squeeze for use with iPhone 3GS
*using regular HTTP, instead of HTTPS - because it's easier, and because if you have already enabled HTTPS, you know what to do!
- Download Z-push to the web-root directory of your server from http://z-push.sourceforge.net
Code:
cd /var/www/virtual/mydomain.org/htdocs
wget http://download.berlios.de/z-push/z-push-1.5.5-790.tar.gz #current as of 2011-10-25
NOTE: the above download site goes down permanently Dec 31, 2011 info here
- Extract the tarball into your web-root directory. (It will extract into it's own directory 'z-push')
Code:
tar -xvzf z-push-1.5.5-790.tar.gz
- Find out who the owner of your web-root is, and give correct ownership of the z-push folder and contents.
Code:
ls -la #see that the other files are owned by "vu2001" or similar
chown -R vu2001:vu2001 #change "vu2001" to your requirements
- Read the INSTALL file in the new z-push subdirectory. Keep that information in mind while you follow along here and get all the extra steps required.
Code:
cd z-push
cat INSTALL | more
- Check your timezone first:
Code:
cat /etc/timezone
(or browse the /usr/share/zoneinfo directory and subdirectories)
then edit the config.php file (and do the optional bits by default)
change line 45 to reflect your time zone:
Code:
date_default_timezone_set("MyRegion/MyCity");
optionally increase max attachment size on line 66 (i used 10MB):
Code:
define('MAX_EMBEDDED_SIZE', 10485760);
optionally enable loose provisioning for certain and older devices by changing line 75 to read:
Code:
define('LOOSE_PROVISIONING', true);
change line 95 to read:
Code:
$BACKEND_PROVIDER = "BackendIMAP";
optionally change line 116 to read:
Code:
define('IMAP_OPTIONS', '/notls/norsh/ssl/novalidate-cert');
- Edit index.php to avoid open_basedir errors
Change line 131 to read:
Code:
$subdirfile = BASE_PATH . "/backend/" . $entry . ".php";
- Make the state folder writeable
- Make a .htaccess file to fix some problems with authentication:
add these lines:
Code:
RewriteEngine On
RewriteRule .* - [E=HTTP_MS_ASPROTOCOLVERSION:%{HTTP:Ms-Asprotocolversion}]
RewriteRule .* - [E=HTTP_X_MS_POLICYKEY:%{HTTP:X-Ms-Policykey}]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
- Edit the apache config to redirect the ActiveSync URL
Code:
nano /etc/apache2/sites-available/ispcp.conf
for the virtual host's domain name that you are using, find the line:
Code:
# httpd [MyDomain.org] dmn entry BEGIN.
look down 13 more lines and see:
Code:
Alias /errors /var/www/virtual/MyDomain.org/errors/
right below that line, add:
Code:
Alias /Microsoft-Server-ActiveSync /var/www/virtual/MyDomain.org/htdocs/z-push/index.php
- Reload the apache config
Code:
/etc/init.d/apache2 reload
That should be all that is necessary to make push email work on the server.
On the iPhone 3GS
Code:
Tap: Settings,
Tap: Mail, Contacts, Calendars,
Tap: Add Account,
Tap: Microsoft Exchange,
Email: MyEmail@MyDomain.org
Domain: leave blank
Username: MyEmail@MyDomain.org
Password: MySecretPasswordWithUpperAndLowerCaseAnd|\|U/\/\B3R5
Description: NameOfThisFolderInTheMailApp
Tap: Next
Don't worry if the iPhone doesn't like it, just tell it to SAVE.
Now, go back in to:
Code:
Tap: Settings,
Tap: Mail, Contacts, Calendars,
Tap: NameOfThisFolderInTheMailApp,
Turn off: Calendars
Tap: Account Info
Turn off: Use SSL (at the bottom of page) *because we didn't configure apache2 for HTTPS
Tap: Done
Now it should work!
Troubleshooting:
To enable logging, in the z-push directory:
Code:
touch debug.txt
chmod 777 debug.txt
For verbose logging to debug.txt, edit file wbxml.php and change line 45 to read:
Code:
define('WBXML_DEBUG', true);
Quote:Logging can produce a LOT of unregulated output, so remember to disable logging when you get things working (or remember to disable it when you are wondering why there is no disk space left on that mountpoint!)
To disable logging, remove the permissions you just granted:
Code:
rm debug.txt #to get rid of that potentially HUGE file
touch debug.txt
chmod 644 debug.txt