Current time: 05-21-2024, 03:31 PM Hello There, Guest! (LoginRegister)


Post Reply 
[HowTo]: "Push" email with Z-push
Author Message
viop Offline
Banned

Posts: 5
Joined: Oct 2011
Post: #1
[HowTo]: "Push" email with Z-push
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!

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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)
    Code:
    nano config.php
    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');
  6. Edit index.php to avoid open_basedir errors
    Code:
    nano index.html
    Change line 131 to read:
    Code:
    $subdirfile = BASE_PATH . "/backend/" . $entry . ".php";
  7. Make the state folder writeable
    Code:
    chmod 777 state
  8. Make a .htaccess file to fix some problems with authentication:
    Code:
    nano .htaccess
    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]
  9. 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
  10. 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
(This post was last modified: 10-26-2011 03:03 PM by viop.)
10-24-2011 07:53 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
[HowTo]: "Push" email with Z-push - viop - 10-24-2011 07:53 PM
RE: HOWTO: "Push" email with Z-push - Knut - 10-26-2011, 01:20 PM
RE: HOWTO: "Push" email with Z-push - viop - 10-26-2011, 02:32 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)