From owner-freebsd-questions@FreeBSD.ORG Sat Apr 24 20:50:44 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D744216A4CE for ; Sat, 24 Apr 2004 20:50:44 -0700 (PDT) Received: from lakermmtao05.cox.net (lakermmtao05.cox.net [68.230.240.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id A302E43D64 for ; Sat, 24 Apr 2004 20:50:43 -0700 (PDT) (envelope-from bob89@bobj.org) Received: from mail.bobj.org ([24.250.218.207]) by lakermmtao05.cox.net (InterMail vM.6.01.03.02 201-2131-111-104-20040324) with ESMTP id <20040425035041.DBZT18641.lakermmtao05.cox.net@mail.bobj.org> for ; Sat, 24 Apr 2004 23:50:41 -0400 Received: from bobj.wb4jcm.org ([192.168.132.167]) by neti.bobj.org with esmtp; Sat, 24 Apr 2004 23:50:40 -0400 From: Bob Johnson To: freebsd-questions@freebsd.org Date: Sat, 24 Apr 2004 23:49:29 -0400 User-Agent: KMail/1.6 References: In-Reply-To: X-Source-System: Bob's Laptop MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200404242349.29908.bob89@bobj.org> cc: Derrick Ryalls Subject: Re: Courier-MTA/maildrop X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2004 03:50:45 -0000 On Friday 23 April 2004 03:07 pm, Derrick Ryalls <"Derrick Ryalls" > wrote: > Pardon if this is a bit off topic, but here it goes... > > I have a couier-mta system that is running nicely on my 4.9 box, and > I wanted to add some server side mailfilter for some of my email > (like put mail from this list into a specific folder automatically). > > I enabled maildrop in courierd, but I am unconvinced it is working. > As a test, I put just this in my $HOME/.mailfilter file: > > to "./Maildir/.test" It's been a long time since I set it up, so I don't remember the details of how I came up with it, but the rule I use for this list is: if (/List-ID:.*freebsd-questions/:h) { to $HOME/Maildir/.FreeBSD.questions } That's in the ".mailfilter" file in my home directory. You also need a file named ".courier" in your home directory with the following delivery instruction in it: | /usr/local/bin/maildrop Which tells Courier to deliver your mail by handing it to the maildrop program. > > And the file is owned by me, and rw only by me as required for > maildrop. Even so, mail is not being redirected at all. I have tried > various thing (sorry didn't keep track) and searched around google to > no avail. > > Does anyone know how to get maildrop working, and as a bonus have > aliased acct names working as well? > I'm not sure what you mean by "aliased account names". If you have a real mailbox named "james" and you want an alias "freddie@fbsdsolutions.com" to be delivered to the "james" mailbox, then put something like freddie: james in /usr/local/etc/courier/aliases/james (the name of the file isn't important, as long as it is in the right directory). Once you've done that, run /usr/local/sbin/makealiases to rebuild your aliases database. It will take all the files in /usr/local/sbin/courier/aliases and build an alias database from them, so you can, for example, have an alias file for each user. While you are at it, edit the "system" file in the aliases directory, and have mail for "root" sent somewhere useful. Your other possibility for aliased accounts is the automatic aliasing that happens when you create an extended account name on the fly. For example, if you have an account "godzilla@fbsdsolutions.com", then mail sent to "godzilla-questions@fbsdsolutions.com" or "godzilla-test@fbsdsolutions.com" will be delivered to the "godzilla" mailbox, or whereever you want it. ANY address created by adding a hyphen and anything else to a real user's mailbox will be delivered as directed by that user's ".courier-default" file. In the user's home directory, create a file called ".courier-default" and put delivery instructions in it, e.g. | /usr/local/bin/maildrop if you want mail for automatic aliases to be run through the maildrop filter. You can also change the extension character from a hyphen to whatever you want, but I don't remember how. It might be a good idea to change it from the default to keep the spammers on their toes. Because Courier is so flexible, there are other ways you could accomplish this. There are, for example (IIRC), system defaults for the .courier and .courier-default files that you could set up, instead of doing it in each user's home directory. Also, you could set up delivery instructions for some of the automatic aliases, e.g. if you want all mail for godzilla-questions@fbsdsolutions.com to be forwarded to godzilla@yahoo.com, then you could create a file ".courier-questions" in godzilla's home directory with one line in it: godzilla@yahoo.com Or something like that. I'm doing this from memory, and I may have some details wrong. "man dot-courier" will get you lots and lots of details. Hope that at least provides useful clues. - Bob > TIA > > -Derrick >