Thread
:
Man ports Etch mail server packages to Chinook; melts own brain
View Single Post
matthew_exon
2008-02-17 , 18:14
Posts: 72 | Thanked: 58 times | Joined on Feb 2008
#
1
This is a report of a success, of sorts, rather than a request for help. But it's likely that there are much, much, much better solutions to my various problems, so pipe up and let me know what they are.
The situation was as follows.
I'm going to be travelling round the world, through places where finding a public hotspot is simply not an option. The best I'll manage is occasional access to internet cafes. That means the only connection to the outside world my n810 will have is via USB mass storage.
So how do I get my mail? I have a cron job on my server that downloads in full all articles from my RSS feeds and uploads them to my mail server. I'd like to retrieve that email for reading on the road. How to do that via USB mass storage?
Well it's easy enough to retrieve new mail to the card - use rsync (although the devil is in the details there, especially for mail going the other way). But how do I read that mail on the n810? Claws allegedly has support for reading local maildir, but in fact it only seems to work with mbox. And anyway, claws is pretty horrid. Modest is somewhat better, but it doesn't seem to have support for reading a local maildir.
So there seemed nothing for it but to run a mail server on the device itself. Then configure modest to connect to nokia-n810-50-2, and voila, I can read email without a network connection. That's the theory.
So I therefore undertook to find a mail server from the Etch repository and rebuild the package under scratchbox. Yes, I could just compile the binary and package it up myself, but I like having the Debian developers backing me up. They've already found and dealt with all of the tricks and caveats, and so it's better to bring over their work cleanly.
So my approach worked like this:
build-package (package) {
apt-get source package
while ("dpkg-buildpackage package" complains about dependency) {
build-package(unmet-build-dependency)
}
while ("dpkg-buildpackage package" fails) {
hack-package
}
while ("dpkg --install package" complains about dependency) {
build-package(unmet-install-dependency)
}
}
Plug "dovecot" or "courier" into the start of that function, and recurse away. What could be simpler?
A week, over 300 .debs, and a lot of swearing later, I eventually managed to get this to actually work. One package depends on another, which requires a library, that is documented with ghostscript and won't build unless its there, and before you know it you're trying to compile x.org. It's really, really embarrassing how much time over the last week I sunk into this project instead of organising my holiday. But for better or worse, the results are available here:
http://apt.exon.name
(Although if too many people try to use it, they won't be for very long).
The net result is that I am able to "apt-get install dovecot-imapd libpam-modules". I tried courier, but it just doesn't wanna go. Dovecot is enough for the moment.
There are two hairy parts. First, you need to install libpam-modules as well. It's not a dependency in Debian, and I didn't want to mess with that in case there was a reason.
The second hairy part is that the Debian dovecot depends on having an inetd. I compiled openbsd-inetd, but it depends on update-inetd. As it happens, Nokia have smooshed that into the netbase package - but there's no "Provides:" line to make that clear. It tries to install a real update-inetd, which leads to:
Unpacking update-inetd (from .../update-inetd_4.27-0.5_all.deb) ...
dpkg: error processing /var/cache/apt/archives/update-inetd_4.27-0.5_all.deb (--unpack):
trying to overwrite `/usr/share/perl5/DebianNet.pm', which is also in package netbase
So I rebuilt netbase with nothing changed except the "Provides:" line:
http://apt.exon.name/pool/main/n/net....osso6_all.deb
(And if you install packages with names like "netbase" from random hackers on the internet pointing to random servers, you're mad.)
Once dovecot-imapd is installed, edit /etc/dovecot/dovecot.conf and set "protocols = imap" to enable the server. You will also want to add a user so that you can set a password.
If you have problems with this, well, sorry. I really don't have time to fix anything that goes wrong. On the plus side though, if you want to compile your own dovecot, there are a bunch of build dependencies and things in my repository that you can use to avoid all the pain I had to go through.
So, why don't you embarrass me even more by explaining how I could have knocked this off in an afternoon :-)
Quote & Reply
|
The Following 2 Users Say Thank You to matthew_exon For This Useful Post:
free
,
Texrat
matthew_exon
View Public Profile
Send a private message to matthew_exon
Visit matthew_exon's homepage!
Find all posts by matthew_exon