Things I would pay for….

Being an extraordinarily stingy bastard, I’m generally only willing to pay for what I need or want a lot. An example would be The Regiment, I want the game… So I’d be willing to buy it. I don’t need an IDE so why would I buy Microsoft Visual Studio??? And to be honest I’d rather make a charitable donation because of how much I love and use Vim then pay for MS Visual Studio $_$

I’m used to not having a lot of money, so needless to say while I don’t have problems spending a lot of money. When I do spend my money it is often as carefully Analyzed and as wisely as I can.

Products and services I would pay for if I could afford to:

  1. Strongspace
    • Strongspace would save me so much trouble. Not only would it make things easier then having to set stuff up on my lan and configure every thing (clients/servers) and deal with Winsucks | Nix relations… Namely that Windows my options. My server lacks a good sized hard drive so I can’t even make use of a similar solution with my own hardware. Even the cheapest plan on strongspace could probably hold my entire home directory! 5GB storage for $15/month is not bad. The medium plan costs more (25GB Storage for $50/month) but it could hold all of my personal data on the network. Geeze my laptop doesn’t even have 25GB of data on its 80GB disk. And my server has less free-space then strongspaces startup plan offers :/. If I could afford strongspace I would definitely go for it fast

  2. Live Journal
    • While I wasn’t sure if I would like it at first, nore blogs at all. Since I started using Live Journal I’ve come to like it quite a lot. If I had the spare money I’d go for a paid account. While my account at this time is basic and I do occasionally experiment with setting it to Plus (ad supported), feature wise I’ve found Basic (free, no advertisements) to be more then enough. A paid account would probably be more helpful to LJ then useful for me. I like Live Journal so I think it would be worth while even if I don’t need the extras;-)

  3. Ippimail
    • Webmail with a heart, they use Squirrel Mail with several plug ins and a custom theme. It looks very nice and provides a lot of features for a free service. Most of there setup is using Open Source Software and a portion of their profits goes to charities and supporting OSS Projects. The ads on the webmail are basically what pay them. The advertisements on the webmail are very on-obtrusive and dispite having filled out the surveys to the fullest, I have _NEVER_ gotten an ounce of spam from ippimail. I wish I could say the same about my ISP !!! Ippimail has saved my mail… Since I can’t afford a new UFD and mailx+lynx on my server would be a bitch. I’ve all ready tried mutt+lynx, I liked it but not when people sent me HTML mail ! I’m glad ippimail is free, because I probably wouldn’t be able to use it other wise 🙁 but it is a service I would pay for if I could + had to.

  4. DX For Nix
    • Some way to play any game on Linux and BSD and an assurance that any game would work. Would be worth a small fortune to me. The closest thing to it only works for Linux based systems but not on BSD using the Linux ABI. I don’t use GNU/Linux very often. Although I’d rather run a GNU/Linux Distro on my desktop then Windows XP hehe.

  5. Vim
    • If I ever win the lotto, oh boy is there going to be a donation sent this way 🙂

I don’t know why…. but some how every time I start looking at web browsers. Lynx just keeps coming up as #1.

Lynx seems to be able to give me every thing I could possibly want out of my browser. Except for Tabbed Browsing, the options of Images, and most importantly… being able to lay out a page decently !

Links does a much better job on laying pages but I’m more comfortable with Lynx, dang I wish I had time to see what trying to create a new browser based on the Links and Lynx code bases would result in :/

Netscape navigator 9 I like a lot but it’s just too bloody slow.

Firefox 2 I can’t stand, it’s crap as far as I’m concerned… Hopefully 3.x will rock.

I like Seamonkey but since I use only webmail now, theres no need for it when theres Firefox and Navigator.

Opera I like a lot, it’s got a few rough edges but it’s one of the best browsers I’ve ever used. I’ve got to reinstall it on my desktop, keeps crashing…. never had that problem before. It’s nice enough to ask to restore my session on the next run tho.

Konqueror and Safari I like a lot but nether are portable enough for my needs, *yet*

I need to find a decent web browser, some thing I can use consistantly on Windows NT, Linux i386/AMD64, *BSD i386/AMD64, and Mac OS X. While I don’t have a Mac and rarly use Linux Distros. I like to have the SAME program as much as possible between OSes. Like Vim, works on every OS I’m likely to use and nearly any OS I’ll probably bump into. The major difference is I tend to preffer GVim (Vim’s GUI) only when I don’t have a decent terminal emulator, like on Windows XP. CMD.EXE is a poor one compared to Konsole.

Partition plan

I’d like a small partition in the lead, doesn’t need to be big, I’ll probably use OpenBSD or an old FreeBSD 6.0 disk for setup. I just want a pretty minimal install, kernel, manual pages, and required binaries. I’d like it to be a pretty small slice but with enough room to hold a few files in a ‘pinch. Its basically just there in case I need to do some recovery operations and can’t boot the primary OS.

As far as that goes, PC-BSD v1.4 when it is released.

# PC-BSD v1.4
ad0s2 66560MB (65GB)
/ 10240MB (10GB)
/swap 1024MB (1GB)
/home/ 20480MB (20GB)
/usr/ 25600MB (25GB)
/var/ 512MB (0.5GB)

All sizes are approximate but I’m figuring I should have 7-8gb free space in the slice. 512mb will be more then enough for /var, my current system has /tmp linked to /var/tmp and is only using 120-150mb on a 2.5gb partition. 10GB should be plenty for the root partition. My laptops not even 10GB with /:/usr:/home all being on the same partition. So I expect roughly 20gb for my home directory and ~25gb to be plenty for /usr. I could probably thin back /var and add a nice fat /tmp/ but I figure the spare space on / will do if I need the extra room in /tmp when un-packing a file. /usr/ports and /usr/src is only about 800-1200MB so it won’t make much dent into my /usr partition.

# My Laptop, PC-BSDv1.3.4 is on ad0s3, the other partitions are for storeage
Terry@Dixie$ df -h 8:41
Filesystem Size Used Avail Capacity Mounted on
/dev/ad0s3a 36G 8.2G 25G 25% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/ad0s3e 2.9G 135M 2.5G 5% /var
/dev/ad0s1 10G 1.1G 8.9G 11% /mnt/ad0s1
/dev/ad0s2 20G 48K 20G 0% /mnt/ad0s2
linprocfs 4.0K 4.0K 0B 100% /usr/compat/linux/proc
Terry@Dixie$ 8:41

I can finally clean up my laptops partitions… which I have wanted to do for a long while but havn’t had time or wish to do to a ‘stable’ system. If its not broke don’t fix it ! But since I’ll need to reformat, may as well. I like to have issues of partitioning set out BEFORE I do any install. That way I know roughly what I want before hand. So I can adopt it to what I need when the situation comes up. As I have it now, I’ve got a few Gigs worth of free slice planned, more then enough for a minimalist BSD install. Plus a few free gigs on the main PC-BSD slice. So I can add another partition if I need to, it does leave me room to use growfs on my future PC-BSD install if I need to later on.

I hope the Release will be soon, that way I won’t have to lose much time. My home directory is cut down to only what it needs to function with copies of the backups near by in case I need some thing. Once my little synchronizer is done I can complete my change of browsers and get Vectra (an OpenBSD box) setup running an FTP server on the LAN to felicitate it. Thus I should again be able to keep my bookmark/mail/settings the same between computers again. Since I remembered Lynx has good support for Vi and Emacs keybindings… I’m almost tempted to switch to using Lynx as my primary browser but I know sasclan.org is pretty crappy in Lynx !!! And Links doesn’t work natively on Win32 yet afaik.

5 minutes to local 0500…. time to go to sleep !!!!

http://www.nabber.org/projects/appupdater/

Hmmmmm, I might want to take a look at that later.

Days log

While the automatic update between Netscape Navigator 9.0b1 and 9.0b2 was not so automatic on my laptop, it was still painless. Just had to download the Linux tarball and unpack it. I saved it to /tmp as I usually do when I download files I’m not going to need much.

Dixie# cd /usr/compat/linux/opt/
Dixie# ls
navigator
Dixie# mv navigator navigator_9.0b1
Dixie# tar -xzf /tmp/netscape-navigator-9.0b2.tar.gz
Dixie# ls
navigator navigator_9.0b1
Dixie# rm -rf navigator_9.0b1/

Even took a backup of the install just in case.

Today we got to meet to new dogs and a nice family. We’ll be taking care of the dogs while they’re on vacation.. and financially thats a pretty good thing for us.

Managed to launch part of my continuation training today. Was just Hellfish, Duke, and Me.. Chester and Lake seem to have been lost in the reboot. For the most part we failed the missions, although all but one was completed….. We went into over time on all but 1 and the other, was neutral. We had met the conditions before time was up but didn’t know it till 40 seconds later.

We did pretty good if you ask me. Because when I sat down and made the list of scenarios. I had plotted the times figuring on 6-8 players. And trying to find a flexible border between the impossible and the possible. Well, I had planned there to be a fairly good sized [SAS] presense and some good applicants. On one mission we went just a wee bit over. But I know if we had two 4-man Elements and proper pre planning. We would’ve taken the mission in half the required time.

With just 3 people I didn’t really expect to complete any successfully. But I think it showed Duke and Hellfish a bit more about me. You see, when I was young and had time to train myself harder. Well I still do, just not as often as I’d like.

I set high goals to obtain, make the as good as impossible or highly improbable a completed mission. Not always successful… but I would train till I got better, till I could do no better. I remember my own little ‘personal’ one man training sessions in SWAT3. I would set the map to Brentwood residence. Which is a large 3 floor house, back and front lawns swimming pool. With a Den, Bedroom, and Bathroom on Level 1. Kitchen, Family room, Library/office’et, Bathroom (2 rooms), Huge Living/Dinning room, and garage on Level 2. And 4-5 Bedrooms upstairs including 2-3 closets and 2 bathrooms. Huge house, kinda nightmare to clean… lol. Mission was simple, 2 Adults and 3 Children that needed to be evacuated and maybe 5-6 suspects in body armour with light assault weapons holding them hostage.

The [SAS] Record time was like 54-67 seconds or so. 10 Men, no team casualties, every thing pre-planned. Mission complete 100%. My personal training op was to try and break that record. I never succeeded, not once but I learned greatly.

To make things harder on my self, I would take my usual S3 training loadout. A Compact primary for working in close confines. Usually the AKS74U with Kobra sight or if running the [SAS] Realism Mod (which included a large weapon mod). I’d bring my HK53 which used the same sight overlay as the MP5 family (I didn’t like the Aimpoint scopes). I’d load it with a SINGLE magazine of FMJ, pack a pistol with a suppressor. Normally a HK MK23 .45 Cal or HK USP.40 Cal with ONE magazine of JHP loaded. A single CS Gas canister, one Flashbang, and a lone C2 Breaching Charge. And my favorite uniform, the Guardian duds with Navy Blue pattern. Later on I would do it with [SAS] PTE uniform.

To make it even harder, I set the AI to the max and the difficulty to the hardest mode. Level 1, rear poolside entrance. I’d head in stealth to first contact then go dynamic when necessary. Or when I decided a loud tactical aid was just to good to pass up. I’d make use of the Opti-wand when I wanted to be extra cautius, like coming up into the blind hallway on the top floor. Or making entry on the back door, where a Suspect might be lurking on the near by stairs.

I made the level as hard and realistic as I could. Secured the area and even after the game gave me the mission complete. I’d keep going till I had personally cleared every room. After awhile and a lot of getting shot at. My average *best* clear time. Was 1:07, far from my mark but the best I could do. I had learned some valuable lessons and how to ‘rough it’ without good equipment. Later on, I’d learn how to master any weapon in Raven Shield. When I was a bucking recruit, you could hand me a Mac-9/11+SD or SR-2 off the rack and I could put a two-round burst in a tangos head from quite a distance away as fast as I could think fire.

Today, well I’d probably miss by a mile at that range on my first try. Lack of hours in the shoot-house but it was great fun training to my sharpest edge. I looked for the impossible situations and I tried to best them, usually I couldn’t or it would be close. But I would do so and try to walk away the better for having tried.

As a Recruit I had a lot of fun, my typical day consisted of going through the map list like 3 or 4 times. Usually I’d start off in an Element with Rasa and Leon, then end up alone several hours later to keep on going. Being able to complete a mission on my own was not to far off. As a trooper I pushed my self even further then that. Completing a mission on my own was not a problem.. just an inconvenience. After awhile… I got rather bored, what else was their to do? I even started to do less then ‘as perfect as I could get’ things. To make it more challenging — instead of taking the most professional, safest, most effective routes. I would take the most dangerous, insane ones. I learned how to handle them as best as I could. It even got to the point that I thought about leaving the [SAS], boredom set in.

Then some day some body decided to make me an SAS_LCpl_Spidey01. In my opinion I was the worlds biggest failure as a LCpl… Lazy good for nothing bum with often no one to train. Eventually they made me a Cpl, I took it as a second chance. It was during those days that I got to see a lot of close training time (Trp->LCpl->Cpl). Later on I was to become an SSM.. and now I’m the RSM. As I look back on my past, I think Recruit, Corporal, and Squadron Sergeant Major are my favorites. As a Rct I got to learn so much and wanted to help pass it on. As a Cpl, I could work on passing it on and as SSM. My mind started to grow tactically to make up for the slack in my shooting skills. I’m not sure if I enjoy being the RSM more then I did SSM, it’s to early to tell. But right now I find my self situated just where I want to be.

I’m an SNCO and able to help in more business matters that I would like to be of service in. Yet I’m also close enough to the front lines to keep limber and have fun. I don’t really know if theres any one more active then me thats above Cpl. I love the fact, that I’ve trained personally with almost every one in [SAS]. And those that I have not, I’m on familer enough terms with. Like me and Random, we’re not exactly bosom buddies or any thing. But when it comes to server time, we’re not strangers ether. How many people in [SAS] can say the same? I’ve trained with all of the Rct personally, I’ve helped the Troopers during their Recruit time. And I’ve seen many of the NCO grow since pre-rct times. Most of the people who trained me are gone… But those I have trained with know me as Spidey01.

I’m not chained to a desk, yet I’m not glued to the field; It’s awesome. I remember when I was a NCO, my favorite past time was to try and get the younger generation to one up me. If I could do it to Gold Star perfection, I’d try and get them to go for the Platinum one. When ever people have been able to surpass me, I have been very greatly pleased.

I hope some day, to see the outcome. Being a member of the [SAS] has had an impact on my life, for the better in my humble opinion. And I hope it does for others, I found a group of kindred spirits when I stumbled on [SAS] Training Grounds #1 one day. Looking for a smoke-free zone I could play RvS with a realistic frame of mind. I’ve learned much, grown much, and have seen a lot since then. Here is part of my home… And I’m happy enough with it. In years to come maybe the same or similar will shine true for other Members.

Notes

archive: pax -wf archive /what
append to archive: pax -waf archive /more
unpack: pax -rf archive # unpacks in current directory
list: pax -f archive | $PAGER

the -z option adds gzip compression as with tar.

Also the -i and -v options work as per convention.

exclude file with the -c ‘file’ command or only file with -n ‘file’. Like:

pax -rf archive -c ‘ignoreme’ && pax -rf archive -n ‘onlyme’

gzip -# works well for the archives, where # is 0-9 low-high compression.

Well I’ve solved one problem, now to tackle another problem.

Solved:

KMail would crash when ever moving or deleting a message in my SMB mounted mailboxes.

Solution? I backed every thing up by moving them to /tmp. Replaced my .kde/share/config/kmail* and .kde/share/apps/kmail files with roots which was never configured. Then I set up kmail and imported my messages from backup.

That fixed it all but now I have a new problem:

How to access mail from any where on my network.

THe Soultion I’d like, kolab- > KDE Group Ware xD

Man, I don’t look forward to source installing that monster on a 500Mhz Pentium III !!! Maybe I can run it in a FreeBSD Jail for security as well.

SSMTP/Getmail how-to part III

back to part II

The getmail documentation said that was the best way to automate it, and its bloody better then buling up getmail with ‘daemon mode’ code. But also like the documentation said if we want to ‘stop’ this daemon like mail checking we need a script for cron to run getmail through and program it to not run getmail if a file is pressent. Now we can do this many ways, heck we could set a enviroment variable if we want.

I’ve written a little script that can be run with a users cron jobs and skip over all mail or only the given account. You need one rcfile per account and you can tweak it to follow any conventions you want. My RCFiles follow the convention of getmailrc-shortaccountname, hence getmailrc-bell and getmailrc-sas for my bellsouth and sasclan accounts. This script should work on any system that has a bourneshell compatible /bin/sh. Just edit the shebang if you need to run it as another shell (such as /bin/ksh).

#!/bin/sh

# Use getmail to check my E-Mail account using the RC variable
# This script has the advantage that one can save it as another file, change
# one variable and set a cron job to check each account at different times (1
# cron job per script). Then not only use a file in their .getmail folder to
# stop all the scripts from running getmail or use a file to stop one script
# from checking its account. It also keeps a log which will be trimmed by
# another script

# Name of the getmailrc file to use
RC=getmailrc-sas

# log to a file when mail is checked
LOGFILE=${HOME}/.getmail/cronjobs.log

#
# If a nomail or nocheck file is found in ~/.getmail/ exit without checking
# else look for a no file. Where is equal to every thing that
# comes after the getmailrc- in $RC. If none of these files exsist check mail
# using the $RC file.
#
if [ -e ${HOME}/.getmail/nomail ]
then
LOG=$(echo "Skipping mail for $RC")
exit 1
elif [ -e ${HOME}/.getmail/nocheck ]
then
LOG=$(echo "Skipping mail for $RC")
exit 1
else
DIE=$(ls ${HOME}/.getmail| grep $RC | cut -d '-' -f 2)
if [ -e ${HOME}/.getmail/no${DIE} ]
then
LOG=$(echo "You have desided not to check this mailbox - $DIE")
else
LOG=$(echo `date` "checked mailbox with $RC")
getmail -r$RC
fi
fi

# Update log with the result
echo $LOG >> $LOGFILE 2> /dev/null

if you want to use the script copy and paste it into a text file and mark it executible. I saved them as ~/.getmail/check-.sh and chmod’d them 0700

Ok, let us make a cron job, because this is allready a big long post that took me forever to write with the way my house is. I’m not detailing cron(8) so please read the handbook or read the fine manual.

I created this crontab file to run my scripts to check my accounts every 5 and 4 hours respecfully and to ‘trim’ my log file every week.

# rstf's crontab
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/usr/home/rstf/
MAILTO=""
#
#minute hour mday month wday who command
#
# check sas every 5hr
5 * * * * rstf ${HOME}/.getmail/check-sas.sh
#
# check bell every 4hr
4 * * * * rstf ${HOME}/.getmail/check-bell.sh
#
# trim log @weekly
0 0 * * 0 rstf ${HOME}/sh/trim-getmail-cronlog
#

The trim-getmail-cronlog script is thus

#!/bin/sh

# Rotate my logfile for running get mail via cron

LOGFILE=${HOME}/.getmail/cronjobs.log
TMPDIR=/tmp/

if [ -e $LOGFILE ]
then
tail $LOGFILE > $TMPDIR/gmlog.$$
rm $LOGFILE
mv $TMPDIR/gmlog.$$ $LOGFILE
else
exit 1
fi

To load my crontab file into crons system i.e. /var/run/tabs/${USER} all I have to do is run a simple command.

crontab ~/rstf-contrab

SSMTP/Getmail how-to part II

Back to Part I

It should’ve taken like two minutes to install or so. The getmail program is very nice and it follows the concept of do one ting and do it well + allows for a great level of modularity. We can use it with a number of protocols and other softwares like procmail, spamasassion, clamav e.t.c.

Setting up getmail is very easy and theres great documentation so far I’ve been very happy with it. Lets go to our home directory, we do *not* want to be the root user for this.

I’m gong to use a console because thats how i like it, so I’ll short how to do it via that way. If you want to use a GUI app like Konqueror to do it be my guest, you should be able to easy enough.

Make a directory your home directory called .getmail and set the permissions so that only you have access.

mkdir -m 0700 ~/.getmail That ammounts to the owner having read, write, and execute but no one else but the root user being able to enter the directory. Lets cd over to our ~/.getmail folder and create a rc file. By default getmail reads the ${HOME}/.getmail/getmailrc file but we can create multiple rc files and have getmail use the one we choose.

getmail -rRCFILENAME

if its not in our .getmail/ folder we need to supply the path to the rc file, if its in .getmail we can skip it.

The syntax of the file reminds me alot of .ini files on Win32, to be perfectly honest the getmailrc file syntax is the easist I've seen. Heres a copy of one of the RC files I use complete with anotations of what the ooptions do. After this I'll go into more detail about the options to help you get a owrking rc file.

[retriever]
# This file is getmailrc-sas which is for checking my @sasclan.org account
type = SimplePOP3SSLRetriever
server = mail.host.tld
username = my_emailaddr@sasclan.org
password = My_Password

[destination]

# This destination is just for my e-mail not the systems local mboxes.
type = Maildir
path = ~/Mail/
user = rstf
filemode = 0600

[options]
# Note that '0' means disable for all integar values.

# (int) 0-warn/err only, 1-retriv/delete only, 2-every thing
verbose = 1
# (bool) true = fetch all, false = only what getmail has not seen before
read_all = true
# (bool) true = delete messages after downloading, will override delete_after
delete = true
# (int) delete messages from server after int days
#delete_after = 1
# (int) max server reported message *total* size to download per session
max_bytes_per_session = 0
# (int) do not retreve messsages larger then this number of bytes
max_message_size = 0
# (int) max number of messages to process
max_messages_per_session = 0
# (bool) adds Delivered-To: header field to the message.
delivered_to = true
# (bool) add received: header field to the message
received = true
# (str) log to file
#message_log
# (bool) use system logger
message_log_syslog = false

as a reminder so I wouldn't have to check the documentation in /usr/local/share/doc/getmail/ or online. I put comment notes in the file briefing discribing what each option does and the type of setting, namely bool (i.e. true/false), int(eger) i.e. 0 1 or 435 e.t.c., or str(ing) likethis. Basically you need to have a [retriever] and a [destination] section. Under retriever we tell getmail what type of protocol to use, taken from the documentation heres the options.

  • SimplePOP3Retriever
    — for single-user POP3 mail accounts.
  • BrokenUIDLPOP3Retriever
    — for broken POP3 servers that do not support the
    UIDL
    command, or which do not uniquely identify messages; this provides basic
    support for single-user POP3 mail accounts on such servers.
  • SimpleIMAPRetriever
    — for single-user IMAP mail accounts.
  • SimplePOP3SSLRetriever
    — same as SimplePOP3Retriever, but uses SSL encryption.
  • BrokenUIDLPOP3SSLRetriever
    — same as BrokenUIDLPOP3Retriever, but uses SSL encryption.
  • SimpleIMAPSSLRetriever
    — same as SimpleIMAPRetriever, but uses SSL encryption.
  • MultidropPOP3Retriever
    — for domain mailbox (multidrop) POP3 mail accounts.
  • MultidropPOP3SSLRetriever
    — same as MultidropPOP3Retriever, but uses SSL encryption.
  • MultidropSDPSRetriever
    — for domain mailbox
    SDPS mail accounts,
    as provided by the UK ISP Demon.
  • MultidropIMAPRetriever
    — for domain mailbox (multidrop) IMAP mail accounts.
  • MultidropIMAPSSLRetriever
    — same as MultidropIMAPRetriever, but uses SSL encryption.

Odds are if you don't know what you need, its probably SimplePOP3Retriever. If you've ever set up a mail client before you should know it, your ISP or webhost should be able to tell you as well. Next we gotta tell getmail what server to fetch mail off of with the server option. If your ISP is some thing like charter, its probably mail.charter.net. I don't have charter but all the mail servers I've seen have been mail.ispname.topleveldomain lol.

We need to set the username and password so the server knows its us and which mailbox we want. Other wise it will tell us to go 'eff off.

Now we need to tell getmail what to do with our mail once it checks the incoming mail server. This is what the destination section is for. You basically have two big options here, Maildir or MBox. I've always used mboxrd since thats what Mozilla Mail&Newsgroups, Mozilla Thunderbird, and Seamonkey Mail&Newsgroups used. Plus the systems local mailboxes are mbox format as well. Theres various 'variations' of mbox and probably maildir but compatible enough for our needs I'd say. Other options for 'type' allow us to use an

External Message Delivery Agent (MDA) like procmail.
Mutilple Destinations, using multiple maildir/mbox/externMDAs e.t.c.
Mutiple message sorting
Sort mitple messages into geussed destinations
And to use qmail-local to deliver messages as instructed in the .qmail file.

The exact specifics and how to set getmail to use these features are in the manual, go read it if you want to know more. I suggest ether mbox or maildir personally.

Maildir is pretty simple there is a folder containing new, cur, and tmp directories full of e-mails. If you plan on checking e-mail often or automating it (as I do) this is probably for you. Each e-mail gets its own file in one of those directories which I personally think makes it better suited sharing messages but bad for FAT32 file systems (i.e. many small files).

We can make a mail directory like this on the command line, assuming we want ~/Mail. Or just make four directories in a GUI file manager.

mkdir -p ~/Mail/{new,cur,tmp}

You'll need to set the path to the mail directory as well to use Maildir. You can also set the user and file permissions to use. You've got to use the unix octal format, i.e. 0755 instead of u=rwx g=rx o=rw or some thing.

[destination]
type = Maildir
path = ~/Mail/
user = rstf
filemode = 0600

Setting filemode to 0600 means only I and the root user have read-write permission to my mail.

Now if we want to use mboxrd we have to specify the type and path to the mbox file as well. The user option works here too. Also you need to consider the locktype option. It takes a string argument and you have a choice of 'lockf' which uses fcntl locking or 'flock' default as of this writing (getmail v4.7.0) is lockf.

[destination]
type = Mboxrd
path = ~/Mail/inbox
user = rstf
locktype = lockf

We can also set up filter sections to use stuff like clamav & spam assasion on our e-mail. Considering that the odds of a virus or trojan that can invect a windows machine through being ssh'd into a freebsd box that is using mutt to view mail fetched with getmail from a server that filters spam (optional /w my ISP) and scans for viruses (nice ISP). I don't blood ythink I need to filiter things through an Anti-Virus ! But if you like go read the documentation on how to set that up.

I think I'll be looking into spam assasion for my ISP account though so maybe I'll have some thing topost there.

The options section I don't think is required but I'd suggest you set your read_all and ether delete or delete_after options.

My suggestions

[options]
# fetch all mail on the server
read_all = true
# then delete it after its in our Maidir or Mboxrd destination(s)
delete = true

[options]
# fetch mail getmail has not seen before
read_all = false
# then delete old messages after 1 day
delete_after = 1

The bottom option deletes the messages you download today from your mail server (not your destination) the next time getmail checks for mail and sees that the old messages are '1' day old. Any integer number will do but not a floating point number. i.e. 4675 will work but 2.43 will not.

I have two getmail rc files one for each account

$ ls -R ~/.getmail                                             20:21
getmailrc-bell
getmailrc-sas
oldmail-mail.host.tld-110-username
oldmail-mail.host.tld-995-username

So I can run getmail and tell it which file to use so Ican deside which mailbox to check. I've made a pair of shell aliases in my shells rc file to save typing.

alias gm-bell='getmail -rgetmailrc-bell'
alias gm-sas='getmail -rgetmailrc-sas'

Ok, lets run getmail (I'll skip the alias), it will take a few seconds bu t if it takes a really long time you might want to make sure your system is configured correctly to resolve the hostnames.

rstf@Vectra$ getmail -rgetmailrc-sas                                                       20:22
getmail version 4.7.0
Copyright (C) 1998-2006 Charles Cazabon. Licensed under the GNU GPL version 2.
SimplePOP3SSLRetriever:My_EmailAddr@sasclan.org@OurMailServer:
0 messages retrieved, 0 skipped

Looks like I have no new mail in the account.

Ok, lets try some automation we can set cron jobs to run getmail -rRCFILE when ever we want on one or all of our files.

SSMTP/Getmail how-to part I

This is a short how to for kicking sendmail in the buttocks and setting up a micro-replacement for send-only usage on a FreeBSD (post 5.x) system. Plus using the getmail utility to check for new messages. I spent long enough screwing with it after I miss-read some documentation (fbsd handbook/ssmtp).

The goal is to be able to use utilties such as mailx, mutt, and other MUA’s dependant on sendmail (or exteneral) MTA(s) and be able to check mail easy and automaticly. I assume you at least know how to setup a mail client such as Mozilla Thunderbird or Outlook Express (or can get the relivent info) and know how to edit files as root when needed.

First we have to kill sendmail. For this we need to edit the /etc/rc.conf file, since I’ve cleaned mine up to place various options in related ‘sections’ heres the relivent one from my rf.cofing. Note all the sendmail_* options at the bottom.

#########################################################################
# SERVICES #
#########################################################################


#cupsd_enable="YES"
#background_cupsd="YES"

samba_enable="YES"

ntpdate_enable="NO"
ntpd_enable="YES"
ntpd_falgs="-c /etc/ntp.conf -f /var/db/ntpd.drift"

# Completly kill sendmail
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"

Save rf.config with those sendmail lines in it and we can stop sendmail from working. Sendmails probably the worlds most used Mail Transfer Agent but for a desktop we don’t really need it. While its well known for its history of security problems according to some OpenBSD people, at least they still patch it. Now with sendmail gone we have two problems.

  1. Daily run messages are usually mailed to root and this might break that a tad.
  2. MUA’s dependant on external MTA or utils dependant on sendmail may require configuration changes or stop working

Now to fix this we want some thing small that will allow us to send e-mail through some thing sendmail compatible’ish. I’ll assume that you have ports installed or know how – so go do it and update them. Personally I try to update my ports tree every few days or just before building a port if I rarly install stuff on the machine. I also prefer cvsup/csup 🙂

Ok, now that you have ports ready to go lets install some software. Open a shell (or use a GUI) to cd into /usr/ports/mail/sstmp/ so we can build it. Run the commands

make install replace clean

it shouldn’t take long to install so no need to go on coffee break 😛
In case your wondering what ssmtp is heres the pkg-descr:

A secure, effective and simple way of getting mail off a system to your
mail hub. It contains no suid-binaries or other dangerous things – no mail
spool to poke around in, and no daemons running in the background. Mail is
simply forwarded to the configured mailhost. Extremely easy configuration.

WARNING: the above is all it does; it does not receive mail, expand aliases
or manage a queue. That belongs on a mail hub with a system administrator.

WWW: http://packages.debian.org/testing/mail/ssmtp.html

Basically it doesn’t handle fetching or checking mail or reading it but it lets you send it. While some thing like sendmail, qmail, or postfix should at least provide send/recieve if you want to go bugger setting up a full blown mail server be my guest 🙂

sSMTP is really s send-only app that tries to emulate sendmail, most of the command line options to sendmail are accepted but many are just ignored. Some MUA’s can check mail for us, mutt springs to mind but I rather like using getmail so far. At first I thought I would use sendmail/fetchmail/ but I saw an app called ‘getmail’ in ports and checked it out. Its not as buggy as fetchmail is *said* to be, its got great documentation, and its really simple. So if your going to use getmail once ssmtp is done building start on /usr/ports/mail/getmail/ while we open another terminal to configure ssmtp while getmail compiles.

Using a shell or file manager like konqueror cd over to /usr/local/etc/ssmtp/ . We can ether use the .sample files here or create new ones from scratch. We to create a ssmtp.conf file that tells ssmtp how to send e-mail to our out going mail server. The config file syntax is a cake walk, its key=value and # for comments to end of line like many a language or file has.

# Your E-Mail _address_
root=email_username@isp.net
# Your outgoing mail server, normally the TLD is .net, .com, or .org
mailhub=mail.isp.topleveldomain
# Where mail looks like it came from, just stick in your e-mail address.
rewriteDomain=email_username@isp.net
# Your hostname, your e-mail address should be fine if your not a mail server
hostname=email_username@isp.net
# Set this to never rewrite the "From:" line (unless not given) and to
# use that address in the "from line" of the envelope.
FromLineOverride=YES

save as /usr/local/etc/ssmtp/ssmtp.config and that takes care of that. You might want to nuke sendmail or reboot of course for this to take effect. Now since we do want our daily run stuff to still work we will set up an alias so mail sent to our user account locally will actually be sent to our e-mail address. We’ll do this with the revaliases file in the same directory.

This ones a little bit og a bug but its not once you figure out how. Basically the syntax is like this

your_login_name_on_this_computer:your_email_address_to_send_to:the_out_going_mailhub_to_use

# Alias e-mail to the system root account to go to my private e-mail
root:myemailaddr@myisp.tld:mail.myisp.tld
# Alias my_username to my email address so I get my cron-job reports
my_username:myemailaddr@myisp.tld:mail.myisp.tld

This way the daily run and cron e-mail messages will still work and they will be in my e-mail rather then /var/mail/${USER} where I often forget to check 8=)

I’ve yet to figure out how to set up ssmtp for multiple outgoing mail servers but I’ll figure it out later & post it.

Ok, now lets get back to getmail