sawyl: (A self portrait)
As an aide-memoire, here is a quick way to prevent fetchmail from logging Server certificate verification error: certificate not trusted messages.

  1. Create a certificates directory
    mkdir -p /usr/local/etc/fetchmail/certs
  2. Change to a temporary directory
    cd $TMPDIR
  3. Get the certificate from your POP3 server
    echo | openssl s_client -connect <pop server>:993 -showcerts > info
    where <pop server> is your mail server
  4. Extract the security certificate
    sed -n "/^--*BEGIN/,/^--*END/{p;/^--*END/q;};d" info > /usr/local/etc/fetchmail/certs/<pop server>.pem
  5. Find the certificating authority
    grep issuer= /tmp/info
  6. Get the appropriate root certificate, for example:
    wget http://www.geotrust.com/resources/root_certificates/certificates/GeoTrust_Global_CA.pem
  7. Move the root certificate into place
    mv GeoTrust_Global_CA.pem /usr/local/etc/fetchmail/certs
  8. Create hashed symlinks
    c_rehash /usr/local/etc/fetchmail/certs
  9. Append the following to the fetchmail configuration file
    sslcertck sslcertpath /usr/local/etc/fetchmail/certs
  10. Restart the fetchmail daemon

And, obviously, check the logs to confirm the validity of the change and send a few test mails from a remote server to check that everything is working as expected...

sawyl: (A self portrait)
Why is it that all email clients, with the exception of mutt, fail to realise that when you're replying to a mail in your sent items folder, it shouldn't reply to the person who sent the original message — yourself — but to the recipient(s) of the original message? I'd've thought it'd be a pretty obvious thing for people to want to do...
sawyl: (A self portrait)
Slightly against my better judgement, I've decided to follow the path of least resistance by ditching my current email solution and give Outlook Web Access a whirl. My initial feelings are:
  • it isn't nearly as horrible as I'd expected; certainly nothing like as bad as Outlook 2003
  • the lack of proper regexps and booleans makes writing mail filters a total chore
  • quoting is completely and utterly broken in a way that defies belief
  • the shortcuts are horrible and I reserve the right to switch back to a console-driven client

It has also made me realise just how short of resources my desktop system is. It's been prone to bouts of swapping for a while, but in the last few days the problem has gone from acute to chronic: grindingly slow interactive response punctuated by periods of catatonia when it starts to thrash. Time, I think, to swap it for one of the no-longer-used and better specified application analyst machines from a few desks down.

sawyl: (Default)
After a day of stressing over a yet another urgent OS upgrade, I found myself forced to spend my evening reconfiguring my mail server following my ISP's decision to migrate to Exchange. I'd been dreading the change, thinking my mail server still ran sendmail. But to my surprise I discovered that it was running postfix, making it a breeze to reconfigure.

All I had to do was:

  1. change fetchmail to point to the new POP server along with the old one
  2. change /etc/postfix/sasl_password to add my username and password for the on the SMTP server
  3. run postmap hash:/etc/postfix/sasl_passwd to rebuild the DB file
  4. change relayhost in /etc/postfix/main.cf
  5. bounce the fetchmail and postfix
  6. send myself a couple of test messages

And it all worked like a charm. It's days like this that make me feel like I might actually be worthy of counting myself a professional sysadmin...

sawyl: (Default)
After having spent a while setting up Postfix on my NetBSD box, I decided, somewhat perversely, to move my mail services over to Debian on my slug.

The process of configuring the slug was generally pretty straight forward. All I did was install Postfix with apt-get, copy across the configuration files from my BSD box, modify main.cf to correct the locations of the various binaries — all extra packages installed on NetBSD go into the /usr/pkg directory — and tweak the start up scripts.

The only problem I experienced was, as always, with SMTP auth to my ISP's mail server. I checked the log and found that postfix was complaining about SASL: "warning: SASL authentication failure: No worthy mechs found" It transpired that the problem was due to a missing package: libsasl2-modules is required when using SMTP auth with Postfix but isn't included in the standard bundle of dependencies. All I had to do was install the missing module and, presto chango, my mail server was peachy-kean and willing to handshake with my ISP.
sawyl: (Default)
Here's a quick guide to getting the dovecot IMAP server work on NetBSD, using CRAM-MD5 passwords so that things work with Apple Mail.

1. Build and Install dovecot Build and install the package in the normal way:

cd /usr/pkgsrc/mail/dovecot
make install

2. Set up the Configuration
Set up the configuration files:

touch /usr/pkg/etc/dovecot.conf
touch /usr/pkg/etc/dovecot-cram-md5.pwd
chmod 0600 /usr/pkg/etc/dovecot.conf
chmod 0600 /usr/pkg/etc/dovecot-cram-md5.pwd

3. Edit dovecot.conf
The main configuration file should contain something like the following:

base_dir = /var/run/
login_dir = /var/run/login

protocols = imap
ssl_disable = yes
login_chroot = no
login_user = dovecot
default_mail_env = maildir:/home/%u/.Maildir

auth_verbose = yes
auth_debug = no

auth default {
mechanisms = cram-md5

passdb passwd-file {
args = /usr/pkg/etc/dovecot-cram-md5.pwd
}


userdb passwd {
}
user = root
}

4. Set up the passwords file
Create an encrypted password entry using the following bit of magic:

echo foo:`/usr/pkg/sbin/dovecotpw` >> /usr/pkg/etc/dovecot-cram-md5.pwd

Replacing "foo" with a sensible user name. If you're using sudo (and if you're not, what's wrong with you?), you'll need to do the following:

sudo sh -c "echo foo:`/usr/pkg/sbin/dovecotpw` >> /usr/pkg/etc/dovecot-cram-md5.pwd"

5. Set up the Startup Script
Set up the rc script in the usual way:

cd /etc/rc.d
cp /usr/pkg/share/examples/rc.d/dovecot .

6. Start the Server
Start the server by hand in the usual way:

/etc/rc.d/dovecot forcestart

If everything's good, you can tweak rc.conf to start the server at boot.

sawyl: (Default)
Ever wanted to get postfix authentication working under NetBSD? Well, it's not actually all that difficult. Here's a quick guide to doing it from scratch:

1. Install pkgsrc
Download the tarball from the NetBSD web site. Bootstrap the installation as follows:

cd /usr/pkgsrc/bootstrap; ./bootstrap
cd /etc
ln -s ../usr/pkg/etc/mk.conf .

2. Set Postfix Options
Edit /etc/mk.conf to add the option "PKG_OPTIONS.postfix+=sasl"

3. Build and Install Postfix
Build and install the package in the normal way:

cd /usr/pkgsrc/mail/postfix
make install

4. Build and Install cy2-plain
Build and install the auth package in the usual way (you might need other packages if you want to use something other than plaintext authentication):

cd /usr/pkgsrc/security/cy2-plain
make install

5. Setup the Configuration Files
Set up the postfix configuration files by doing the following:

cd /etc/postfix
mv main.cf main.orig
mv master.cf master.orig
ln -s ../../usr/pkg/etc/postfix/main.cf .
ln -s ../../usr/pkg/etc/postfix/master.cf .

6. Edit main.cf
Change the main.cf configuration file. It should contain something like the following (where "mail.isp" is the name of your ISP's SMTP relay host):

# Directory settings
command_directory = /usr/pkg/sbin
config_directory = /usr/pkg/etc/postfix
daemon_directory = /usr/pkg/libexec/postfix
queue_directory = /var/spool/postfix
sample_directory = /usr/pkg/share/examples/postfix
newaliases_path = /usr/pkg/bin/newaliases
sendmail_path = /usr/pkg/sbin/sendmail
mailq_path = /usr/pkg/bin/mailq

# User settings
mail_owner = postfix
setgid_group = maildrop

# Local settings
myorigin = $myhostname
mydestination = $myhostname localhost localhost.$mydomain
mynetwork_style = host
relay_domains =
relayhost = [mail.isp]
notify_classes = resource, software

# SASL settings
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/usr/pkg/etc/postfix/sasl_passwd
smtp_sasl_security_options =

7. Setup the SASL Password File
Create the password file as follows:

touch /usr/pkg/etc/postfix/sasl_passwd
chmod 0600 /usr/pkg/etc/postfix/sasl_passwd

Then add the lines:

[mail.isp] username:password

Replacing "[mail.isp]" with the name of your SMTP relay host. Create the password hash with:

postmap hash:/usr/pkg/etc/postfix/sasl_passwd

8. Configure the Startup Scripts
Add the following to /etc/rc.conf.d/postfix:

required_files='/usr/pkg/etc/postfix/main.cf'
start_cmd='/usr/pkg/sbin/postfix start'
stop_cmd='/usr/pkg/sbin/postfix stop'
reload_cmd='/usr/pkg/sbin/postfix reload'

9. Start Postfix
Start the daemons by hand:

/usr/pkg/sbin/postfix start

10. Test the Configuration
Try sending a message to a user on the local machine. If this works, try sending a message a remote user. Examine the mail log and confirm that the relayhost has accepted the message — the smtp server should report something like "status=sent (250 OK id=XXX)" if the message has been accepted.

Slow moves

Nov. 16th, 2005 11:07 pm
sawyl: (Default)
A slight, totally slight, gain in order: discovered that the netmask on the mac was way out, so although it could talk to localnet, the rest of the world was like shrouded in silence. Also "fixed" DNS by dumping it's nasty ass but despite yesterday's upbeat, SMTP auth is still splorking with "makeconnection... failed: Invalid argument" Probs just a wrong parameter in my client-info file, but question is which one?
sawyl: (Default)
The trick to setting up SMTP client authentication with sendmail seems to be the following:

  1. mkdir -m 700 /etc/mail/auth
  2. vi /etc/mail/auth/client-info
  3. Dump the following into the file: 'AuthInfo:smtphost.isp "U:localuser" "I:remoteuser" "P:smtppassword" "R:smtphost.isp" "M:DIGEST-MD5 CRAM-MD5 LOGIN PLAIN"' with the various bits and pieces tuned to reflect your setup.
  4. cd /etc/mail/auth; makemap hash client-info < client-info
  5. vi /etc/mail/sendmail.mc
  6. Add 'FEATURE(`authinfo',`hash /etc/mail/auth/client-info')'
  7. m4 sendmail.mc > sendmail.cf
  8. kill -HUP `cat /var/run/sendmail.pid`

Easy when you know how...

sawyl: (Default)
I've been working on a modification to my massively complicated network of mail filters and agents to add vacation replying to the list of things it does on my behalf. I'm a bit worried that the extra complexity might nudge it over into self-awareness and boot strap a singularity, but I think that's a risk I'm willing to run for a bit of peace and quiet while I'm away. Beside, it might be nice to share an office with a post-human artificially intelligence. It's almost bound to be quieter, politer, better smelling and generally less offensive that some of the people I currently share a floor plate with...
sawyl: (Default)
Discovered how to mark messages as read using procmail and maildir today. Turns out the trick involves renaming the mail after it's been delivered, thus:

MAILDIR=$HOME/Maildir :0 c $MAILDIR/ :0 ai * LASTFOLDER ?? ()\/[^/]+^^ | mv $LASTFOLDER $MAILDIR/cur/$MATCH:2,S

Way more complicated than using formail to add a "Status: RO" as used to be the way of things with mbox.

sawyl: (Default)
While trying to fix my IMAP server - I eventually discovered that, following a software upgrade, I now need to specify MAILDIRPATH in the configuration file - I found the following gem from Dan Bernstein in the maildir man page:

Many sites use Sun's Network Failure System (NFS),
presumably because the operating system vendor does not
offer anything else. NFS exacerbates all of the above
problems. Some NFS implementations don't provide any
reliable locking mechanism.

He's pretty much hit the nail on the head - NFS is a failure. You'd think that in return for appalling performance, no locking, no cache coherence etc, you'd at least get a certain amount of reliability, but no, that sucks too.

Profile

sawyl: (Default)
sawyl

August 2018

S M T W T F S
   123 4
5 6 7 8910 11
12131415161718
192021222324 25
262728293031 

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 7th, 2025 08:59 pm
Powered by Dreamwidth Studios