

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
4 messages in net.sourceforge.lists.courier-usersRe: [courier-users] maildrop question| From | Sent On | Attachments |
|---|---|---|
| Andrey Ananin | May 23, 2007 12:58 am | |
| Milan Obuch | May 23, 2007 1:45 am | |
| mouss | May 26, 2007 12:48 pm | |
| fjar Uno al día | May 30, 2007 1:01 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [courier-users] maildrop question | Actions... |
|---|---|---|
| From: | fjar Uno al día (fra...@gmail.com) | |
| Date: | May 30, 2007 1:01:24 am | |
| List: | net.sourceforge.lists.courier-users | |
Andrey, you have to create a maildroprc and also change in courierd config file DEFAULTDELIVERY=./Maildir to: DEFAULTDELIVERY="| /path/to/courier/bin/maildrop" Otherwise it won't work. Regards.
On 5/26/07, mouss <mlis...@free.fr> wrote:
Milan Obuch wrote:
On Wednesday 23 May 2007, Andrey Ananin wrote:
Hello everyone,
I have one question about maildroprc.
I've installed courier 0.54.0 on FreeBSD 6.2 from ports and successfully configured it for accepting mails.
You are welcome. This list is for question abour courier usage. Should any FreeBSD specific question arise, please report it to port maintainer (it's me, but use maintainer address from port's Makefile to do so).
The problem is that if home directory for user doesn't exist I receive the bounce message ""511 maildrop: Unable to change to home directory."
But I want to automatically create folder and Maildir for user if it doesn't exist.
The message says all. It is not possible to change to directory if it does not exist. This issue has been discussed over and over. Home folder must exist and Maildir must be created before anything could be accepted for given address. Homedir/Maildir creation is administrator's job, not server's (or provisioning system should ensure their existence). Checking for homedir existence on every mail arrival and creating it on first mail is at least a bit ugly. Script creating authentication record in whatever auth database you are using should create proper directory structure at the same time.
I hear that it is possible to do it with the maildroprc file, so I created this file in /usr/local/etc/courier/ with the following content:
[ snip ]
May be I'm doing something wrong?
Well, when homedir does not exist, maildrop is not invoked at all no matter what's in. Error message comes first and processing stops.
And it seems that this file is totally ignored by maildrop because even I add `echo test>/root/test.txt` at the beginning of this file I can't see test.txt file after sending the message.
This just confirms statement above.
Just do it the right way - one time job like directory structure creation or mailbox initialisation should be done outside of mail processing loop (simple optimisation, but often forgotten). Write a script to do it. Try to fit it into your admin framework. Ask question if necessary. And last, but most important, enjoy courier - it's simply great.
looking at his chown, it seems he uses a single uid:gid for his mailstore. if so, then he can achieve his goal by setting the home to the "base" of his mailstore and setting the maildir field (DEFAULT) to the maildir. then he can create the latter in maildroprc. to avoid doing a test each time, he can use something like this:
exeption { to $DEFAULT } `mkdir -p $HOME/$USER && /path/to/maildirmake ... ` to $DEFAULT
WARNING. This is only to show the idea, and should not be just copy-pasted.
but of course, creating maildirs ahead of time is a better approach. If this not practical, it is still possible to do it by email using special addresses (sending mail to initialize-foo@domain.example would initialize the environment of foo@domain.example. the address should be protected to avoid DoS, and should not reinitialize an already initialized environment). Then when a user is added, just send a message to initialized-foo.
------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/
_______________________________________________ courier-users mailing list cour...@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users







