mount by network location

/etc/fstab:

host.lan:/ /media/mount nfs4 _netdev,noauto,users,async 0 0

/usr/local/bin/network-mount:

#!/bin/bash
stasjon=/media/mount
ping=`/usr/bin/fping -q host.lan`
if [ $? = 0 ]; then
  mountpoint $stasjon > /dev/null
  if [ $? != 0 ]
    then mount $stasjon
  fi
  else
  mountpoint $stasjon > /dev/null
  if [ $? = 0 ]
    then umount -l $stasjon
  fi
fi

chmod +x /usr/local/bin/network-mount
crontab -e

* * * * * /usr/local/bin/network-mount

getmail, spamassasin and dovecot deliver(LDA)

Checking incoming mail from getmail for spam isn’t hard when you already have spamassasin configured. Here is a sample getmailrc.

[retriever]
type = SimplePOP3Retriever
server = external.mailserver.no
username = uname
password = pword

[filter-spam]
type = Filter_external
path = /usr/bin/spamc

[destination]
type = MDA_external
path = /usr/lib/dovecot/deliver
arguments = ("-d", "luser@seljebu.no")

[options]
delete = true
message_log = /var/log/getmail.log