# maildirmake?

## s970501

I am installing qmail following qmail-howto @ gentoo.org.

after emerge qmail, there is one test thing to test delivery service.

-------------------------------------------------------

Code Listing 2.5: Test delivery service

# ssh vapier@localhost

# maildirmake

# qmail-inject root << EOF

test root e-mail!

EOF

# qmail-inject postmaster << EOF

test postmaster e-mail!

EOF

# qmail-inject vapier << EOF

test vapier e-mail!

EOF

# mutt 

(You should now have 3 e-mails in your inbox)

-------------------------------------------------------

the problem is...

when i type maildirmake, i've met an error message.

-----------------------------------------------

maildirmake: usage: maildirmake name

-----------------------------------------------

test was okay anyways... 

but what's wrong here? 

or which should i type after maildirmake?

----------

## franoculator

 *s970501 wrote:*   

> 
> 
> the problem is...
> 
> when i type maildirmake, i've met an error message.
> ...

 

You need to type the name of the maildir you wish to create.

I usually call it .maildir.

Try `maildirmake ~/home/user/.maildir`

HTH

----------

## r3pek

just a small correction:

don't do:

 *Quote:*   

> Try `maildirmake ~/home/user/.maildir` 

 

do instead:

```
maildirmake /home/[user]/.maildir
```

 :Very Happy: 

----------

## franoculator

oops, thanks for the correction.

----------

## smukec

I've folowed the

http://www.gentoo.org/doc/en/qmail-howto.xml

manual but no mail has been delivered.

'ps' reports qmail-send running.

 To which logs should I look to find out the reason?

Do I need to create a 'vpopmail' user by any chance?

( not for the delivery test, but for later use)

regards,

Goran

----------

## skunkworx

Qmail's logs are in /var/log/qmail.  If qmail succeeded in getting the message, those logs will tell you what qmail did with it.

----------

## smukec

 *skunkworx wrote:*   

> Qmail's logs are in /var/log/qmail.  If qmail succeeded in getting the message, those logs will tell you what qmail did with it.

 

Ok, but there is no such file as /var/log/qmail.

----------

## smukec

Sorry, was the wrong machine (a bit late here)

These would be the qmail-send logn of interest

```
@40000000405f554f27f70e64 new msg 2207

@40000000405f554f27fc7d04 info msg 2207: bytes 838 from <> qp 18422 uid 206

@40000000405f554f2c95799c starting delivery 12: msg 2207 to remote root@fragola.indea.si

@40000000405f554f2c9a76f4 status: local 0/10 remote 1/20

@40000000405f554f30558324 delivery 12: failure: Sorry,_I_couldn't_find_any_host_named_fragola.indea.si._(#5.1.2)/

@40000000405f554f30652af4 status: local 0/10 remote 0/20

@40000000405f554f38f974f4 bounce msg 2207 qp 18424

@40000000405f554f39009144 end msg 2207

@40000000405f554f39226d3c new msg 2194

@40000000405f554f3927dbdc info msg 2194: bytes 1295 from <#@[]> qp 18424 uid 206

@40000000405f5550027dbfac starting delivery 13: msg 2194 to remote postmaster@fragola

@40000000405f55500282c0ec status: local 0/10 remote 1/20

@40000000405f55500dc4509c delivery 13: failure: Sorry,_I_couldn't_find_any_host_named_fragola._(#5.1.2)/

@40000000405f55500dd3d92c status: local 0/10 remote 0/20

@40000000405f55500ddc2244 triple bounce: discarding bounce/2194

@40000000405f55500de0835c end msg 2194
```

To get clear:

- fragola is the server's hostname

- indea.si is the registered domain that will be used

I was injecting mail as user goran.

At the end I would like get mail delivered to goran at indea.si

The hostnames mentioned in the log are present in /etc/hosts:

```
127.0.0.1       fragola fragola.indea.si localhost
```

From the log I suppose the first mail can't be delivered, it's bounced and again can't be delivered. Am I right?

----------

## trossachs

Just to tag on the back on what you guys are talking about here. I've long since setup my own maildir's, but the other day I was going to add a couple more and I got this error:

```

gandalf / # maildirmake

-bash: maildirmake: command not found

```

Could this have been because I 'emerge -C' something like qmail which I don't use? thx.

----------

## smukec

 *JulesF wrote:*   

> Just to tag on the back on what you guys are talking about here. I've long since setup my own maildir's, but the other day I was going to add a couple more and I got this error:
> 
> ```
> 
> gandalf / # maildirmake
> ...

 

Try do it as root...

----------

## trossachs

My original post was as root. I always thought that maildirmake was something generic so that all usr's could create their own mailfolders. But I am a bit stuck with this one.

----------

## smukec

You're right - shouldn't be only for roots. Each user has to do it (or at least the root,but as user)

 I've tried it again on the right machine and it is present for all users.

Also the how-to is written that way, that the user 'ssh' to the mail machine with its own username.

 You should check what you removed.

----------

## trossachs

I have a feeling that qmail is needed for this to work, but there are so many 'entries' for qmail under emerge that it is very difficult to see what you need!

Thanks for your help.

----------

## skunkworx

JulesF:  I assume that because you uninstalled qmail, you instead have other email software that uses maildirs (postfix?).  Those other packages should come with tools for building maildirs.  Courier IMAP, for example, comes with a maildir creation tool, which is even named maildirmake (Courier IMAP's maildirmake is usually put in /usr/bin, while qmail's maildirmake hides in /var/qmail/bin).  At any rate, check the documentation for the maildir-supporting packages you have installed, and see what tools they provide for creating maildirs.

smukec:  First, let me warn you that I don't use vpopmail and am not very familiar with how it integrates with qmail.

```
@40000000405f554f27f70e64 new msg 2207 

@40000000405f554f27fc7d04 info msg 2207: bytes 838 from <> qp 18422 uid 206 

@40000000405f554f2c95799c starting delivery 12: msg 2207 to remote root@fragola.indea.si 

@40000000405f554f2c9a76f4 status: local 0/10 remote 1/20 

@40000000405f554f30558324 delivery 12: failure: Sorry,_I_couldn't_find_any_host_named_fragola.indea.si._(#5.1.2)/ 
```

This part is telling you that the message bound for root@fragola.indea.si  could not be delivered, because qmail could not figure out where messages bound for the "fragola.indea.si" domain should go.  This could be due to any number of reasons, such as "fragola.indea.si" being a nonexistent domain, or your server not being set up properly for DNS.

Also, judging from the remainder of the logs, the message qmail was trying to send to root@fragola.indea.si was actually a bounce message, that is, a return-to-sender of a message that root@fragola.indea.si wanted delivered, but that qmail decided couldn't be delivered.  The log entries dated before the section you posted can shed some light on why that original message was being bounced.

```
@40000000405f554f38f974f4 bounce msg 2207 qp 18424 

@40000000405f554f39009144 end msg 2207 

@40000000405f554f39226d3c new msg 2194 

@40000000405f554f3927dbdc info msg 2194: bytes 1295 from <#@[]> qp 18424 uid 206 

@40000000405f5550027dbfac starting delivery 13: msg 2194 to remote postmaster@fragola

@40000000405f55500282c0ec status: local 0/10 remote 1/20 

@40000000405f55500dc4509c delivery 13: failure: Sorry,_I_couldn't_find_any_host_named_fragola._(#5.1.2)/ 
```

qmail, being unable to deliver the bounce message, instead tried to alert the postmaster (ideally the postmaster account is owned by the email system administrator) about this "double-bounce."  qmail determined the postmaster address was "postmaster@fragola", an address not local to the server.  qmail may have gotten this address from the /var/qmail/control/doublebouncehost and /var/qmail/control/doublebounceto configuration files; see the man-page for qmail-send for more information about those files.  There may be an interface through vpopmail for editing those files.

Regardless of where that address came from, qmail again decided the message was undeliverable, because it could not figure out where messages bound for the "fragola" domain should go.

```
@40000000405f55500ddc2244 triple bounce: discarding bounce/2194 
```

Unable to deliver both a bounce and a double-bounce, qmail gave up and tossed the message.

I suspect "fragola" and "fragola.indea.si" are supposed to be domains local to your email server.  If so, these entries must appear in /var/qmail/control/rcpthosts for qmail to accept email for them, and then must appear in either /var/qmail/control/locals or /var/qmail/control/virtualdomains for qmail to deliver the email locally (as opposed to forwarding it on to some other server).  This is probably where you need to double-check your vpopmail configuration and make sure that it is aware of all email domains and addresses you plan on accepting email for.

----------

## trossachs

skunkworx: Thanks for this mate. Yeh I abandoned qmail because I was already familiar with Postfix under Redhat so naturally carried this over to Gentoo. 

I've check out their website for a maildirmake equivilant.

----------

## smukec

This is actually a single machine. Do I have to allow receiving from localhost? It was not mentioned in the howto(a bit up in the thread).

 As far as I understood the situation, vpopmail works with mysql. And it could have hapenned that I s.#!$%!.d something related to mysql during installation.

 I will re-read the how-to and retry the setup tomorrow.  Maybe I missed something.

----------

## skunkworx

 *Quote:*   

> This is actually a single machine. Do I have to allow receiving from localhost? It was not mentioned in the howto(a bit up in the thread). 

 

I doubt it, and at any rate, localhost didn't enter the picture here.  Ideally a server can reference itself using any name it has been configured with, not just "localhost".

 *Quote:*   

> 
> 
> As far as I understood the situation, vpopmail works with mysql. And it could have hapenned that I s.#!$%!.d something related to mysql during installation.

 

It's possible.  I know vpopmail stores a good deal of its information in MySQL databases, and database corruption could lead to qmail being misconfigured.

I believe your advice is best.  Re-read everything and go through the steps again.  Double-check yourself at each step and make sure you have a grasp on everything the guide explains in each section.

Good luck!

----------

## smukec

I rechecked the situation (after sleeping a bit it seems I can think better).

First it already stopped on local delivery. The server had problems searching/accessing itself. After some corrections to the /var/qmail/control files I made a step forward.

I'm also continuing in a thread with a more appropriate subject :

Qmail does not want to deliver local emails

https://forums.gentoo.org/viewtopic.php?p=979229#979229

I tried to find some explanation for the /var/qmail/control files on the www.qmail.org and some how-tos (like http://cr.yp.to/qmail.html, http://www.skunkworx.org/guides/QmailOnGentoo.txt, ...) but did not succedded (maybe still a bit tired). Can you give me a hint?

----------

## skunkworx

The qmail-control man page lists all the /var/qmail/control files that are part of the standard distribution of qmail, and references other man pages that better describe what each control file is used for.  Life with qmail also has a section that talks about control files.  The qmail documentation at skunkworx.org contains a few blurbs about the control files that are used by Gentoo but not by the stock distribution of qmail, however, that documentation assumes you have read Life with qmail.

Note that none of these references describe how vpopmail edits qmail's control files for its own purposes, so be careful that you don't break vpopmail when editing those files.  vpopmail's documentation hopefully provides some insight into how it configures qmail.

----------

## trossachs

Sorry to bring this back but I am curious. Does anyone here use Postfix and has created their maildir's using maidirmake? As posted earlier, for some reason I keep getting a 'maildirmake not found' error.

```

gandalf etc # maildirmake

-bash: maildirmake: command not found

```

Any ideas as to what package is emerged to get maildirmake to be installed along with it?

----------

## trossachs

Managed to sort this out. I re-emerged maildrop which seems to form an intergral bind to maildirmake. The two must sit together else you will get the error which I posted above.

----------

## smukec

 *skunkworx wrote:*   

> The qmail-control man page lists all the /var/qmail/control files that are part of the standard distribution of qmail
> 
> 

 

 I don't want to make big changes to this files - just wanted to know what is their usage to get qmail work(entering the domain in all files specified in the how-to helped). I'm still away from vpopmail.

Currently I'm (without any success) trying to use qmail-inject to send and pine to read(check) mail. It simply does not get to local mailboxes.

 altough ~/maildir has been made.

----------

## smukec

I made a new step forward.

Regarding to Life with qmail part:

```
With qmail, virtual domains are configured in the virtualdomains file, which consists of one or more entries of the form:

    user@domain:prepend

qmail converts user@domain to prepend-user@domain and treats the result as if domain was local. The user@ part is optional. If it's omitted, the entry matches all @domain addresses.

```

In the 

```
/var/qmail/control/virtualdomains
```

 file I have removed the prepend which was equal to the domain name. Now I have 

```
indea.si:
```

and now I get local delivery:

```
@4000000040619d6e29cfc604 new msg 2205

@4000000040619d6e29d00c54 info msg 2205: bytes 278 from <root@indea.si> qp 16988 uid 0

@4000000040619d6e31cd4a5c starting delivery 21: msg 2205 to local goran@indea.si

@4000000040619d6e31cd8cc4 status: local 1/10 remote 0/20

@4000000040619d6f03c08494 delivery 21: success: did_1+0+0/

@4000000040619d6f03c0d2b4 status: local 0/10 remote 0/20

@4000000040619d6f042bbdcc end msg 2205
```

I had to install mutt in order to read ~/.maildir. Pine had its mail directory.

----------

## skunkworx

 *smukec wrote:*   

> I made a new step forward.
> 
> Regarding to Life with qmail part:
> 
> ```
> ...

 

This will work fine, as the man page for qmail-send explains that any entry in /var/qmail/control/virtualdomains without a prepend is treated as a local domain.  However, if you're not planning on using vpopmail or any other virtual domain manager, it may be easier to understand if you simply leave /var/qmail/control/virtualdomains empty, and put "indea.si" in /var/qmail/control/locals.  The functionality will be the same, but there will be fewer configuration files to juggle.  A message to any address within a domain listed in /var/qmail/control/locals will be delivered locally.

----------

## smukec

 *skunkworx wrote:*   

> This will work fine, as the man page for qmail-send explains that any entry in /var/qmail/control/virtualdomains without a prepend is treated as a local domain.  However, if you're not planning on using vpopmail or any other virtual domain manager, it may be easier to understand if you simply leave /var/qmail/control/virtualdomains empty, and put "indea.si" in /var/qmail/control/locals.  The functionality will be the same, but there will be fewer configuration files to juggle.  A message to any address within a domain listed in /var/qmail/control/locals will be delivered locally.

 

 Basically I plan to have one single domain(indea.si). But there is a possibility that I will also host some other. As far as I found the howto(http://www.gentoo.org/doc/en/qmail-howto.xml)  that explains how to install(exactly the things I neeed) it I just followed the instructions. Such scripts are more or less straight forward - just copy/paste instructions and it will work. 

 I admit - it didn't even crossed my mind to read some documentation(until it stuck) - I was sure it will work the first try.

 So, now it is my priority to make this domain work. I would like to have the following functionality:

- SMTP/POP3/IMAP

- web mail

- spamassasin

- fetchmail (from external pop3 to local users)

- antivirus

- web based forward management (trough horde probably)

----------

## skunkworx

 *smukec wrote:*   

> I admit - it didn't even crossed my mind to read some documentation(until it stuck) - I was sure it will work the first try.

 

Famous last words.  :Smile: 

 *smukec wrote:*   

> So, now it is my priority to make this domain work. I would like to have the following functionality:
> 
> - SMTP/POP3/IMAP
> 
> - web mail
> ...

 

qmail comes with a POP3 server, which will be easy to work with once you're comfortable working with qmail.  Courier IMAP is by far the best IMAP server to use if you want something that integrates cleanly with qmail.

qmail-scanner is an all-purpose mail filtering tool.  SpamAssassin can be tied to it, and so can many different virus scanners, both free and commercial.  The qmail howto has a brief section on qmail-scanner, and I believe people have written up other documentation and posted it here in the forums.  A search will turn that up.

Personally I think getmail is better than fetchmail, but getmail doesn't send its retrieved email through local SMTP, so it can be a complex task to set up if you've got a lot of virtual users to worry about.

I use SquirrelMail for web mail.  Haven't tried Horde, so I can't comment on that.

In all cases, search the forums for ideas, as there has been plenty of talk about email software.

----------

