Current time: 11-22-2024, 04:47 AM 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
Knut Offline
Member
***

Posts: 736
Joined: Nov 2006
Reputation: 10
Post: #2
RE: HOWTO: "Push" email with Z-push
Nice Howto!
Thx
10-26-2011 01:20 PM
Find all posts by this user Quote this message in a reply
viop Offline
Banned

Posts: 5
Joined: Oct 2011
Post: #3
RE: HOWTO: "Push" email with Z-push
Thanks Knut!

Anyone, please give feedback if it works or needs correction! I will start -->

+1 working Z-push installation on ispCP Omega 1.0.7
+1 working iPhone 3gs
+1 working iPhone 4
+0 deviations from HOWTO instructions
(This post was last modified: 10-26-2011 02:34 PM by viop.)
10-26-2011 02:32 PM
Find all posts by this user Quote this message in a reply
spacecdr Offline


Posts: 1
Joined: Oct 2011
Reputation: 0
Post: #4
RE: [HowTo]: "Push" email with Z-push
Unfortunately, your setup does not permit to delete emails.
I am able to read and be notified suddenly but when i delete a message, iphone reply it can't move message...
Have you a solutions for this?
10-31-2011 11:08 PM
Find all posts by this user Quote this message in a reply
viop Offline
Banned

Posts: 5
Joined: Oct 2011
Post: #5
RE: [HowTo]: "Push" email with Z-push
(10-31-2011 11:08 PM)spacecdr Wrote:  Unfortunately, your setup does not permit to delete emails.
I am able to read and be notified suddenly but when i delete a message, iphone reply it can't move message...
Have you a solutions for this?

Hi spacecdr,

I must say that my setup does permit one to delete messages. When I delete a message from the Inbox folder, it is moved to the trash folder. When I delete a message from the trash folder, it is permanently deleted (purged). I can also login to webmail (Squirrelmail) and follow along by refreshing the page. In webmail, I see the message move to the trash folder and then dissapear.

I do not recall any special change that must be enabled to permit deleting email, but I will think about it.

Could you please describe your setup? Which versions of ispCP and O/S and which phone and phone's O/S and which email app...
11-01-2011 12:42 AM
Find all posts by this user Quote this message in a reply
viop Offline
Banned

Posts: 5
Joined: Oct 2011
Post: #6
RE: [HowTo]: "Push" email with Z-push
spacecdr,

I did some searching and I found a forum thread where some people using Z-Push have trouble deleting files from their iPhone (when the internet connection is weak): Iphone can't move (delete) emails. Look for a solution posted by mad. Let us know how that works for you.
11-01-2011 07:51 AM
Find all posts by this user Quote this message in a reply
AlonzoLester Offline


Posts: 1
Joined: Nov 2011
Reputation: 0
Post: #7
RE: [HowTo]: "Push" email with Z-push
(11-01-2011 07:51 AM)viop Wrote:  spacecdr,

I did some searching and I found a forum thread where some people using Z-Push have trouble deleting files from their iPhone (when the internet connection is weak): Iphone can't move (delete) emails. Look for a solution posted by mad. Let us know how that works for you.

When i was facing this problem i also tried the same solution posted by Mad by searching. So it works.
11-11-2011 06:50 PM
Find all posts by this user Quote this message in a reply
jma Offline


Posts: 1
Joined: Sep 2012
Reputation: 0
Post: #8
RE: [HowTo]: "Push" email with Z-push
hey guys, i could need some help Smile

i tried using your How-To for the new 2.0.3 z-push version, but the setup changed a little bit and i'm having trouble setting it up correctly.

seems i have some problems with open_basedir.

first with your .htaccess file i always got an "error 500". without the .htaccess file the z-push index.php loaded up but with an error. the config check routine was not able to write a the log file.

/var/log/z-push is writable for the correct user, in my case vu2003, and chmod 775.
if i try #php /var/.……./z-push/index.php directly in the terminal, there was no problem for z-push writing the logfile and access the /var/lib/z-push state folder… and i know it's not magic because i executed it as root Smile

well, so i just created a "log" folder inside /var/www/virtual/mydomain/htdocs/z-push/ and edited the config.php … now z-push can access the logs, of course, but gave me an error because it couldn't access /var/lib/z-push.
also moved that into my install dir. so it loads up without complain and he asks for user and password, but that's not working. I guess because he needs access to files i overlooked outside of it's installation path?!

to put it in a nut shell: i wasn't able to disable open_basedir in /etc/apache2/sites-available/ispcp.conf or /var/www/fcgi/mydomain/php5/php.ini
and it would be awesome if someone could update the how to for the new z-push version to help some poor mediocre serveradmin like me Wink

thx in advance, i'ld appreciate your help.

jma

PS: and please excuse my sometimes maybe kinda' bad english Wink
09-28-2012 09:33 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


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