Tag: Apple

Server-Side Email Filtering With Sieve

Another post for the peripheral brain.
When I first set up my own server lo these years ago, I never really thought about email message filtering. After all, I had rules in Mail.app that would send my incoming message to wherever I wanted them. Besides, I was much more concerned with eliminating spam.
Well, that was then and spam seems under control. I was prompted to look at server-side message filtering mostly to help out my mother, who seems determined to have every single store, travel and other consumer site that will happily take your email address and send you messages daily — or more often, have a more controllable experience on her iPhone. When we originally set up her iPhone she told me she didn’t want to use it for email. Silly me, I listened and set her up with a POP account. Well now she wants email. What’s a good son to do. 😉
I changed her POP account to IMAP, copied over all her messages to her new IMAP folders and thought I’d need to solve her impending problem of 100 or so messages every other day choking her inbox.
After a bit of Googling I found Sieve. I’d actually heard of it before but never really thought about it. The Apple Discussion Forum had a nice start and pointed me on to sources I used to set it up.
Here are the salient points. From the terminal…

  1. Add the following lines to /etc/services
    sudo pico /etc/services
    

    Insert the following lines.

    callbook 2000/udp # callbook
    callbook 2000/tcp # callbook
    + sieve 2000/udp # sieve mail filtering
    + sieve 2000/tcp # sieve mail filtering
    

    You can check to see if it’s running by running

    netstat -an | grep 2000
    

    with results

    tcp4 0 0 *.2000 *.* LISTEN
    tcp6 0 0 *.2000 *.* LISTEN
    
  2. Create /usr/sieve
    sudo mkdir /usr/sieve
    sudo chown _cyrus:mail /usr/sieve
    
  3. Restart mail services
    sudo serveradmin stop mail
    [ some stuff ]
    sudo serveradmin start mail
    [ some stuff ]
    
  4. Since I’m using OS X Server and SquirrelMail is already running, next was installing and configuring avelsieve.

I really did try installing the latest development version — 1.9.9 alpha. That should have been a clue. After spending way too much time with it I installed the stable version – avelsieve 1.0.1. Once copied into /usr/share/squirrelmail/plugins run sudo perl /etc/squirrelmail/config/conf.pl and activate the plugin.
Then it’s back to the terminal. These instructions are from AFP548.

    cd /usr/share/squirrelmail/plugins/avelsieve
    sudo cp config-sample.php config.php

Now set the correct authentication matching SquirrelMail.
Edit /etc/squirrelmail/plugins/avelsieve/config.php and change:

$preferred_mech = "PLAIN";

to

$preferred_mech = "CRAM-MD5";

You should be running SquirrelMail with CRAM-MD5 authentication anyway.
Finally, edit the /etc/squirrelmail/plugins/avelsieve/lib/sieve-php.lib.php file.
Find the line:

fputs($this->fp, "PUTSCRIPT "$scriptname" {$len+}rn");

and change it to :

fputs($this->fp, "PUTSCRIPT "$scriptname"".' {'."$len+".'}'."rn");

This fixes an error in the script allowing you to save your changes to the filters. Now go login to webmail and click on the Filter link to start creating your Sieve filters.

Filed under: code, mac-osx, osx-serverTagged with: , , , , ,

New Safari Version??

I’ve just spent the last 40 minutes on the phone with Union Bank tech support because for the past 2 weeks I’ve been unable to log in to my online account with Safari. After all this time the tech support person, who was very nice, told me I was missing a patch to Safari.
I told him I have the latest patches to my OS and I am running the most currently available version of Safari. I told me that someone there “got some update patch and could log in.” I told him, with all due respect, I’ve been using Macs for over 20 years. (I got my first Mac 128K in 1985) I was quite certain that there is no more currently available version of Safari. Naturally I ran Software Update and no updates are available.
Currently I’m running OS 10.6.3 and Safari Version 4.0.5 (6531.22.7), according to the About box. I’m not sure why they want to blame Apple, but for their logic to hold true a single user of theirs seems to have a “more up-to-date” version of Safari than is obtainable from either Software Update or Apple’s site.
Fortunately Firefox still works.

Filed under: computer, mac-osxTagged with: , ,

iPad Arrives

Well, with the Easter weekend over and Apple’s iPad gaining more headlines than anything else, I have to say I want one, but I can wait.
I actually got to touch one. Someone at the hospital brought it with them.

  • It’s not that heavy.
  • The display is bright and crisp.
  • It’s fast.

I played a little with the keyboard and I can see with some practice that it’s quite usable.
I’m more excited to see what’s coming Thursday in the iPhone 4.0 announcement. A unified inbox for the Mail.app and Smart Folders would be great.
The iPad is certainly a machine designed for consuming data, not necessarily manipulating data. There are several scripts that I’ve written that make my life easier and I don’t see anyway of making them work on an iPad or iPhone. Not that it’s a deal-breaker, it just means I can’t use the iPad for much more than I use my iPhone now. Except it’s really a faster, better reading environment. I’ll probably buy one based upon that alone.
Time will tell. But I have to say for all those naysayers, wait till you’ve held one!

Filed under: computerTagged with: , , ,

Subscribing to Delegated Calendars

OK, I’m fortunate or crazy enough to run my own server using Apple’s OS X Leopard Server software. It has been, at times, very simple and very complex to set everything up. One of the options that I use is the iCal Server so that I can have shared calendars. Once I got it up and running with all the permissions worked out it’s been terrific. By terrific I mean that I haven’t had to do a single thing to keep it up and running.
Here’s the problem. My wife and I both have iPhone’s. I’d like to see one of her calendar’s on my iPhone and I want here to see one of mine on her iPhone. On our respective computers these calendars show up in iCal as _Delegates_. That’s how there’re suppose to show up. The problem is that only local calendars and subscribed calendars are listed in iTunes for syncing to the iPhone.
After a bit of googling, the [1]. If I do a get info on the _Delegate_ calendar and copy the CalDAV URL I can then subscribe to this URL, the calendar will show up in my _Subscriptions_ list. I can then sync it to the iPhone. It is perhaps the simplest workaround that I’ve found. Your user must log out and log back in for iTunes to see the newly subscribed calendar.
However, it’s still a [kludge][] and I await the day Apple fixes iTunes to allow for syncing any viewable calendar iCal to your iPhone.
[1]: http://discussions.apple.com/message.jspa?messageID=6690635#6690635
[kludge]: http://en.wikipedia.org/wiki/Kludge

Filed under: mac-osx, osx-serverTagged with: , , ,

Laptop Envy

OK, I have serious laptop envy. I **need** a new MacBook. Just have to figure out what to do about no firewire drive.

Filed under: computerTagged with: ,