Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Apr 2004 23:49:29 -0400
From:      Bob Johnson <bob89@bobj.org>
To:        freebsd-questions@freebsd.org
Cc:        Derrick Ryalls <freebsd@fbsdsolutions.com>
Subject:   Re: Courier-MTA/maildrop
Message-ID:  <200404242349.29908.bob89@bobj.org>
In-Reply-To: <A99A5AC30F74624388EE5F757BA58A20D7A2F9@RED-MSG-50.redmond.corp.microsoft.com>
References:  <A99A5AC30F74624388EE5F757BA58A20D7A2F9@RED-MSG-50.redmond.corp.microsoft.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 23 April 2004 03:07 pm, Derrick Ryalls <"Derrick Ryalls" 
<freebsd@fbsdsolutions.com>> 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
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404242349.29908.bob89>