View Full Version : Email Hacking and Such
kakos
01-11-2007, 12:33 AM
So, first off, my overall goal is to get a way for my 770 to, every x minutes, automatically connect to the internet, pull email from my server, and then disconnect. First off, is there any easy way to do this that I've missed?
If the answer to that last question is no, my second question is if it is possible to tell the email application to start recieving email? It looks like there is a dbus facility to do it, but I'm pretty new to dbus, so I can't figure it out.
Any help would be greatly appreciated. Thanks.
thorbo
01-11-2007, 12:48 AM
I just set up the mail client -- (albiet on the 880) which will support POP mail, and then you can set a time interval for how often it will check for mail -- in this case from my google account. It took a little while, as I am still new to this, but it works fine....
Thor
kakos
01-11-2007, 12:56 AM
It won't check if you're not connected though. At least, my 770 won't. What I"m looking for is a way to automatically, without any intervention on my part, connect, get my mail, and disconnect.
aleksandyr
01-12-2007, 01:25 PM
If you configure network manager to connect automatically, and include enough connections that they're always available, this becomes a fairly simple problem.
There's a connectivity wrapper shell script: run a program through that, and whenever it tries to open a socket, the OS will fire the network connection app. If you give it permission to automatically connect...
Of course, you're going to need to write a custom mail-fetcher app: Telomer looks promising, however.
aflegg
01-12-2007, 04:09 PM
Agree with everything aleksandyr says.
Additional options:
See if osso-email has a "download email" DBUS call.
Add a "download email" DBUS call to osso-email (the source is available)
See if Sylpheed (http://www.bleb.org/software/770/#sylpheed) could do it.
Suggest to the Modest team that they do it.
Additionally, on the N800 there's a the lovely new alarm framework (http://www.maemo.org/platform/docs/howtos/howto_alarm_interface_bora.html) which can handle the scheduling and invocation.
kakos
01-13-2007, 01:11 AM
So, I did indeed find a DBUS call for osso_email. I wrote a little script that does what I want it to do. Here it is for reference.
#! /bin/sh
set -e
# /etc/init.d/mail_checker: start and stop the automatic mail checker.
if test -f /etc/default/mail_checker; then
. /etc/default/mail_checker
else
INTERVAL=600
fi
mail_check_loop () {
while :
do
dbus-send --session --type=method_call --dest=com.nokia.osso_email /com/nokia/osso_email com.nokia.osso_email.send_and_receive
sleep $INTERVAL
done
}
start_mail_check_loop () {
mail_check_loop &
}
stop_mail_check_loop () {
killall mail_checker
}
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
case "$1" in
start)
echo -n "Starting automatic mail check."
start_mail_check_loop
echo "."
;;
stop)
echo -n "Stopping automatic mail check."
stop_mail_check_loop
echo "."
;;
*)
echo "Usage: /etc/init.d/mail_checker {start|stop}"
exit 1
esac
exit 0
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.