Tag: iPhone

Printopia

AirPrint is one of the most welcome additions of late to iOS 4.2. Unfortunately Apple removed the ability to print to shared printers. Fortunately, creative software developers such as Ecamm have created Printopia as a solution for those of us with networked or shared printers.
The simplicity of this Preference Pane is amazing. It takes less than a minute to setup and use.
The only problem I found was when installed on my server I had to open port 49195 in my firewall for it to work. Now all is well again. I can’t recommend this $10 piece of software enough.

Filed under: osx-serverTagged with: , ,

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: , , , , ,

False Positive

Just a personal reminder to keep in the memory bank.
When running OS X Server and SpamAssassin, if you have spam set up to be quarantined it gets stored in /var/virusmails. A method of viewing and releasing quarantined mail mostly from the command line follows.
First, to do anything with the quarantined message you need to know it’s mail-file. That’s usually something like spam-kFLGPbnGHO3a.gz.
Using TextExpander’s snippets and the clipboard I have the following snippets.
To view the quarantined message I copy the quarantined file to /Users/Shared/ and then unzip it, read it into a new mail message to me. If it looks OK then I release it. I delete the file from /Users/Shared/ when I’m done.
To send it myself I have the following snippet. The snippet begins by copying the mail-file to the clipboard. If you don’t have TextExpander just replace all instances of %clipboard with the mail-file.

<br />
sudo cp /var/virusmails/%clipboard /Users/Shared/;gunzip /Users/Shared/%clipboard;/usr/bin/mail -s &quot;%clipboard&quot; me@example.com &lt; /Users/Shared/`echo %clipboard | sed &#039;s/.gz//g&#039;`;rm /Users/Shared/`echo %clipboard | sed &#039;s/.gz//g&#039;`<br />

If I want to release the file from quarantine and send it to notjunkmail.
<br />
sudo amavisd-release %clipboard ; sudo amavisd-release %clipboard &quot;&quot; notjunkmail<br />

I did have to do a few things to get amavisd-release working. First, it was looking for amavisd.sock in the /var/amavis/home directory and it’s really located in the /var/amavis directory. It was simple to create a new directory and then create a symlink to the amavisd.sock file.
<br />
sudo mkdir /var/amavis/home; sudo ln -s /var/amavis/amavisd.sock /var/amavis/home<br />

Now, using only the command line and a mail app, I can check on quarantined email and release it. All this just so I can make sure that I can do this task from an iPhone or iPad. 😉
FWIW, I have amavis-blocked (by Uwe S. Fuerst)
a log file parser for amavisd-new 2.x, written in Perl
set up to send me logs each night at 23:59. That’s where I get the mail-file from.

Filed under: osx-serverTagged 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: , , ,

iPhone Stand

While looking for an iPhone stand I came across [the simplest solution][1]. A binder clip.
[1]: http://cultofmac.com/iphone-stand-from-binder-clip/4374

Filed under: UncategorizedTagged with: