MacPorts “PortIndex file may be corrupt” Resolution

Posted in Uncategorized on May 29th, 2010 by Rugmonster – Be the first to comment

In the past few months, I moved to a Mac, which has been great. Shortly after switching, I found MacPorts, which has also been great. The other day, however, when doing an upgrade, I got the following warning over and over and my upgrade wouldn’t complete:

Warning: It looks like your PortIndex file for rsync://rsync.macports.org/release/ports/ may be corrupt.

I couldn’t find a clear answer on what was going on, until I found a bug report on the MacPorts site. The fix for this will be put into MacPorts 1.9.0, but I’m on 1.8.2 now, so that doesn’t help much.

The issue sounds like it has to do with a cache of the PortIndex can build up stale information. My brute force resolution was to remove that cache. I wasn’t terribly sure where that was, but I did find it.

$ locate PortIndex.quick
/opt/local/var/macports/sources/rsync.macports.org/release/ports/PortIndex.quick
$ sudo rm /opt/local/var/macports/sources/rsync.macports.org/release/ports/PortIndex.quick

Alternatively, you could move the file out of the way if that makes you more comfortable.

Once that was done, I went ahead and gave it try.

$ sudo port sync
Warning: No quick index file found, attempting to generate one for source: rsync://rsync.macports.org/release/ports/
$ sudo port upgrade outdated
...

All worked as it should! So until we see MacPorts 1.9.0, this will be my solution should I see this come up again.

My address IS valid, Facebook!

Posted in Mail, Postfix on May 4th, 2010 by Rugmonster – 1 Comment

If you happened to have seen my previous post, Blocking spammers with Postfix alone, you saw that I use SpamCop for one of my RBLs. It’s worked great for years. My whole setup has worked great for over a year now with very minimal changes. Imagine my confusion when Facebook told me to that my email address was detected as no longer valid.

Facebook Fail

What?!

So I dug in my mail server’s logs and found that SpamCop had listed some of the Facebook mail servers on their DNS Blacklist.

read more »

iPhone’s mail.app and IMAP folders

Posted in Apple, Mail, Postfix, iPhone on March 11th, 2010 by Rugmonster – Be the first to comment
IMAP Folders Example

My IMAP Folders

I use IMAP folders combined with fairly extensive Sieve rules to sort my incoming mail into the appropriate folders. This works great for me, because my Facebook notifications go to “Websites”, bill notifications go into “Bills”. It makes it easy for me to find what I’m looking for without having to sort through a single, massive Inbox.

When I got my iPhone, I was very disappointed in its handling of folders. It simply lacks the ability to check all folders for new mail. I didn’t want to have to click through each folder to see if I got new mail in one of them. I wanted to be able to see my little mail badge with the number of new messages I had, when I got a new message, no matter what folder it happened to reside in. I thought of various solutions, such as writing a server-side IMAP proxy that would do the checking for me and present a virtual mailbox of only new messages. While it may have been a fun project, a friend pointed out a more obvious solution: setup a second mailbox and have all of my mail forwarded to it. Here are the details of what I setup.
read more »

Simple activity report from FTP xferlog

Posted in Linux on January 27th, 2010 by Rugmonster – Be the first to comment

UPDATE: I found that what I originally posted was wrong and didn’t work at all. I don’t know how I managed to do that, but I’ve fixed it and it’s verified as working now.

I was asked if there was a way to extract the FTP activity to be emailed to someone. The server had a typical xferlog, but the box was being used for shared hosting and the reports didn’t need to include results for all of the other sites.

I put together the following script to extract the activity and transpose it to a more friendlier output. read more »

Remove old messages from Plesk/Qmail Maildir mailboxes

Posted in Linux, Mail, One-Liners, Plesk, qmail on December 1st, 2009 by Rugmonster – Be the first to comment

I needed to remove messages older than a week old for a list of email accounts on a Plesk system running Qmail. I put together the following BASH script to locate the messages using find and back them up outside of the mailbox (just in case). This builds on the technique I used in my previous post, Maintain directory structure copying `find` results.

All you need to do is create a file with one address per line to be read in by the command.

cd /var/qmail/mailnames; \
IFS="@"; \ 
while read LINE ; \
do \
    ADDR=( ${LINE} ); \
    echo "${ADDR[0]}@${ADDR[1]}"; \
    find ${ADDR[1]}/${ADDR[0]}/Maildir/ \
        \( -path "*/cur/*" -o -path "*/new/*" \) \
        ! -type d -mtime +7 | \
        while read FILE; \
        do \
            DIR=$( dirname ${FILE} ); \
            mkdir -p /path/to/dst/${DIR}; \
            mv ${FILE} /path/to/dst/${DIR}; \
        done; \
done < /path/to/address_file