Mail

The UK Government strikes again

Since my previous rant on the UK Government’s inability to understand how technology works, it would appear the Government has still not advanced its understanding.

Apparently they are going to force ISPs to record the time, to and from details of all emails. Aside from failing to see how this will possibly prevent terrorism, one has to ask; “what about about those of us who do not use ISPs to send email?” Am I going to be marked as a possible terrorist simply because I run my own mail server, rather than use my [parent's] ISP’s?

Also, what information are they using as the from and to? If they use the IP address’s of the sender and receiver then they will neither be able to readily find the actual identity of the sender/receiver or to record the IP address of the receiver until they collect their mail from the mail server by pop/imap/webmail. If they, alternatively, record the from/to email addresses then the information will be useless due to how trivial it is to forge from addresses (as anyone who has received spam claiming to be from their bank will be able to testify). If they record the IP of the sender and the email address of the receiver (probably the most sensible combination) then they will still be unable to determine who sent the email easily since a single IP may have many computers behind it (due to NAT routers) and the fact that (especially with ISPs which dynamically allocate IPs) the fact that IP addresses are constantly being re-allocated.

Yet another brilliant, and useless, idea from our illustrious leaders.
</rant>

Mail
Rants
Technology

Comments (1)

Permalink

Courier-imap-ssl woes

In order to be able to resize RAID5 arrays in my mailserver, I upgraded from Debian Stable->Testing as it broke less than trying to manually install the relivent packages needed from experimental and unstable. In order to resize RAID5, according to Steinar H. Gunderson, you need a 2.6.17-rc* kernel and mdadm tools>=2.4.1. Thankfully the updated mdadm tools are in unstable so installing them on testing was trivial. linux-imager-2.6.17-rc3 is in experimental, so installing that was also strightforward, just a case of adding an experimental source, aptitude update, aptitude install linux-image-2.6.17-rc3, and removing the experimental source).

After the stable->testing upgrade everything seemed to be working fine. My mail was still being fetched and delivered locally, mutt was working fine, apache2 was still running and the imaps daemon was still going. This morning I tried to access my email through the copy of SquirrelMail I have installed for eash access without having to ssh into the box. It failed to login with the message:

Error connecting to IMAP server: tls://localhost.
115 : Operation now in progress

To see if the courier-imap-ssl daemon was just not accepting connections I fired up Thunderbird (which I havn’t used in sometime, since setting up my mailserver). Thunderbird connected successfully and happily talked to the mailserver, fetched my current inbox and allowed me to poke my emails although it didn’t seem to like some locally created emails with attachments (it just refused to show the attachments). Starting the non-ssl daemon and telling SquirrelMail to use that instead work, but it should be able to use the ssl daemon. It was working fine under stable!

According to DirectAdmin Knowledge Base the error is caused by a bug in PHP. Their solution seems to be to rebuild everything from source. I think I’ll try some less-drastic solutions first, such as downgrading SquirrelMail to the version in Stable, and if that doesn’t work downgrading PHP too. or I could try installing PHP5 (I assume it’s still using 4.something atm).

Anyway, I have two exams in the next 24hours so more pokeage of this will have to wait until the weekend.

**UPDATE**
Following some interesting reading on php.net,freebsd.org and bugs.debian.org on the matter I decided to try installing PHP5 (as those seem to indicate, on debian, the problem is an openssl<->php incompatibility). After installing PHP5 it all worked as expected. Hurray! Now for some revision, honest.

Debian
Mail
Technology

Comments (0)

Permalink

Weblinks

In the good old days(tm), before I started blogging and stuff I used to e-mail myself weblinks if I didn’t want to lose them. Since I’m now blogging and have recently completely replaced the way I get my email, I’m now sorting out the contents of my inbox and removing these links. Anything which is still useful or relevent is here:

A simple text list of ‘language notes’ on python. It’s really useful and concise, as well as listing most of the nifty things you can do with the Python language.

A comprehensive guide to the stuff you can do with .htaccess. It’s lists juast about everything you could do (or at least want to do) with the .htaccess file in a straightforward way. One of the better references for doing stuff with a .htaccess file.

Lots of shiny icons.

The exceptionally shiny flurry screensaver from MacOSX for windows

Howto use 3rd party encoders with exact audio copy (e.g. FLAC)

Nifty settings and stuff for mutt

An intersting article on gentoo in the server room

Gentoo
Linux
Mail
Web links

Comments (0)

Permalink

OMG H4X!

I’ve just finshed writing possibly the hackiest(if that’s a word) script I’ve ever written.

I’ve switched to using mutt as my primary mail client and since it’s pretty much a stock mutt setup, it doesn’t particularly like the html emails that the ‘Daily Dilbert’ come as. In order to read the strips with as little effort as possible (always a good thing ;) ), I’ve written this filter. It extracts the url of the image from the email, fetches the image and then replaces the original email with just the image as an attachment (no body).

This is the filter from my .mailfilter (which courier-maildrop uses):

if ( /^Subject: Your Daily Dilbert$/ )
{
# This increadably hacky script extracts just the picture from the 'daily dibert' email so I can view it through
# my non-html email client (mutt).
# It's in an exception block, so if the hacky script fails the email (hopefully) will still get delivered.
exception {
TEMPFILE=`tempfile`
FROMFILE=`tempfile`
OUTFILE=`tempfile`
xfilter "tee $FROMFILE \
| grep 'http://www\.comics\.com/comics/dilbert/archive/images/.*\.gif' \
| sed -e 's#^.*\(http://www\.comics\.com/comics/dilbert/archive/images/.*\.gif\).*$#\1#' > $TEMPFILE \
&& sed -e '/^Subject: Your Daily Dilbert$/d; /^$/Q;' $FROMFILE | tee $FROMFILE > /dev/null \
&& echo 'X-Haxed-For-Piccie-Only: Yes' >> $FROMFILE \
&& curl `cat $TEMPFILE` > /tmp/`cat $TEMPFILE | sed -e 's#^.*/\(.*\.gif\).*$#\1#'` \
&& rm $OUTFILE \
&& mpack -s 'Your Daily Dilbert' -o $OUTFILE /tmp/`cat $TEMPFILE | sed -e 's#^.*/\(.*\.gif\).*$#\1#'` \
&& rm /tmp/`cat $TEMPFILE | sed -e 's#^.*/\(.*\.gif\).*$#\1#'` $TEMPFILE \
&& cat $FROMFILE $OUTFILE \
&& rm $OUTFILE $FROMFILE"
}
to $MAILDIR/.MailingLists/
}

Note the subject gets deleted, and then re-added when mpack creates the email with attachment. This is because mpack refuses to create mail without a subject, even though I’m adding all the original headers (mainly so I can see spam-assassin’s report) back in later.

Linux
Mail

Comments (0)

Permalink

Hmm, Blog

I recently (re-)discovered I’d actually installed a blog script, and never written anything down! Oh well, no time like the present to start – I wonder how long I will be able to keep writing entries before I:

  1. get bored with the whole ‘blog’ idea
  2. simply forget about or neglect the blog to the point that it disappears from my mind (again!)
  3. I get distracted by some project or other.

I recently managed to set up a Debian-based mail server. I originally searched google and came up with a number of guides to doing this which looked quite good, albeit long but it’s a project I’ve been planning for a while so I decided to bite the bullet and have a go. After installing Debian and playing around with various different approaches for a bit, I discovered an entry on another blog at The Tech Terminal explaining how the author had setup a Debian Mail Server. This simply said that all I had to do was enter this:

# apt-get install courier-imap
# apt-get install postfix
# postconf -e 'home_mailbox = Maildir/'
# postconf -e 'mailbox_command ='
# /etc/init.d/postfix restart

at the command line. This was certainly a lot easier that the 8-page guide I had be following previously, and it worked :) .

Using other guides to install spamassassin and squirrelmail and it was all working very nicely. Fetchmail and gotmail were easy to install and configure using the man pages so I didn’t need to enlist google’s help with them. I now have a single server with 2×40GB HDDs (configured for RAID 1 using a PCI PATA RAID card) which goes and fetches emails from my 2 POP accounts and my hotmail account and delivers them to my local user on the machine (for my purposes I decided LDAP was overkill and that dropping the mail to a local user’s Maildir made more sense). This means I can now access my mail using an IMAP client on either my desktop or laptop, or I can use a web-browser from any other location.

One small snag did run into is that Maildir creates a directory for each directory on the server (as you’d expect) but doesn’t nest them. I was expecting them to nest and it took a while (and some head-banging) for me to discover that Maildir actually uses a ‘.’ to represent sub-directories.
e.g. this structure:

Inbox
:-New
:-Badgers
: :-Mushroom
: :-Snake
:-Llama

becomes this Maildir structure:

/Inbox
/Inbox.New
/Inbox.Badgers
/Inbox.Badgers.Mushroom
/Inbox.Badgers.Snake
/Inbox.Llama

Blog
Debian
Mail

Comments (0)

Permalink