# qmail problem - need advice

## Atremis

I'm having this problem with qmail.  When attempting to send from pine:

```

[Mail not sent. Sending error: 451 qq trouble creating files in queue (]

```

Now, up until yesterday, my machine had an open relay (I have no idea how that happened, but it did).  We closed the relay, but in the process of cleaning the queue to ensure the machine didnt try to send the thousands of spam mails waiting to be sent, something happened which is preventing me from sending or receiving anything.  I have a feeling this is a problem with permissions and/or ownership of certain files. 

Any suggestions?

----------

## rac

I fed your entire error message into Google, and came up with a mailing list message from a Manon Goo, in which the following directories seemed to be important, along with how the permissions are set up on them on one of my Gentoo qmail hosts:

/var/qmail/alias 755 alias.qmail

/var/qmail/rc 755 root.root

Things in /var/qmail/alias: 644 alias.qmail

The person who had your error was trying to run a qmail compiled on one machine on another.

I also found on http://qmail.org, the following: Eric Huss has released queue-fix 1.4. It repairs or generates a qmail queue structure. You can use this to help move your queue location, or if you regenerate the file system and the inode numbering changes. It will also fix permissions and ownerships of the files. Eric reports that Matthew Harrell wrote a patch to queue-fix which makes it work with Russ Nelson's big-todo patch. Patches upon patches!

Charles Cazabon wrote queue_repair. queue-repair is a qmail queue diagnostic and repair tool, written in Python, and licensed under the GPL.

----------

## Atremis

Thanks a lot, giving that a try now.  Will post after I run the fixer and let you know what happened.

----------

## Atremis

Ok... the queuing problems appears fixed, but now there is a new problem:

```

Task 'x.x.x.x - Sending and Receiving' reported error (0x800CCC0F) : 'The connection to the server was interrupted.  If this problem continues, contact your server administrator or Internet service provider (ISP).'

```

I checked and it seems the problem involves the pop3 daemon, because sending and receiving using pine works fine.

```

`-svscan-+-supervise---qmail-send-+-qmail-clean

              |                        |-qmail-lspawn

              |                        `-qmail-rspawn

              |-3*[supervise---multilog]

              `-2*[supervise---tcpserver]

```

I can't remember off-hand, but is there supposed to be a pop3 process in there somewhere?  If not, how can I verify whether or not pop3d is running?

It also seems as if mail is not being received.  Would appreciate it if you guys can provide some insight.

----------

## rac

 *Atremis wrote:*   

> If not, how can I verify whether or not pop3d is running?

 

I have 

```
$ ls -al /service/qmail-pop3d

lrwxr-xr-x    1 root     root           32 Jun  9 13:23 /service/qmail-pop3d -> /var/qmail/supervise/qmail-pop3d
```

...and...

```
$  ps auxw | grep pop 

root      2562  0.0  0.0  1316   72 ?        S    Sep13   0:00 supervise qmail-pop3d

root      2566  0.0  0.0  1392  104 ?        S    Sep13   0:00 /usr/bin/tcpserver -v -p -x /etc/tcp.smtp.cdb 0 pop-3 /var/qmail/bin/

qmaill    2567  0.0  0.0  1328   80 ?        S    Sep13   0:00 /usr/bin/multilog t s2500000 /var/log/qmail/qmail-pop3d
```

 *Quote:*   

> It also seems as if mail is not being received.

 

Does it not get received for users who just deliver via maildir (not POP)?  Could it be a .qmail problem?  But you say it used to work perfectly before, though, so probably not.

----------

## Atremis

Yup, it did work perfectly before this ordeal.

```

 ls -al /service/qmail-pop3d

lrwxr-xr-x    1 root     root           32 Aug 24 20:43 /service/qmail-pop3d -> /var/qmail/supervise/qmail-pop3d

```

So that part was ok...

```

 ps auxw | grep pop

root      5953  0.0  0.1  1332  312 ?        S    07:32   0:00 supervise qmail-pop3d

qmaill    5959  0.0  0.1  1344  312 ?        S    07:32   0:00 /usr/bin/multilog t s2500000 /var/log/qmail/qmail-pop3d

root      5960  0.0  0.1  1408  484 ?        S    07:32   0:00 /usr/bin/tcpserver -v -p -x /etc/tcp.smtp.cdb 0 pop-3 /var/qmail/bin/

```

So I guess that part is ok too...

Just checked my logs:

```

* From /var/log/qmail/qmail-pop3d/current *

@400000003d8721640cdac38c tcpserver: status: 0/40

@400000003d87216c2428b8b4 tcpserver: status: 1/40

@400000003d87216c242adf7c tcpserver: pid 5983 from 12.217.133.17

@400000003d87216c25eb8adc tcpserver: deny 5983 augustus.scs.uiuc.edu:130.126.224.132:110 12-217-133-17.client.mchsi.com:12.217.133.17::3129

@400000003d87216c25ee710c tcpserver: end 5983 status 25600

@400000003d87216c25ee78dc tcpserver: status: 0/40

```

If you could tell me how to fix this, I'd appreciate it.  I'll wager a similar problem is preventing mail from being received as well.

----------

## rac

Could /etc/tcp.smtp or whereever you keep the tcpserver rules be overly restrictive?  Maybe tcprulescheck can help you diagnose the problem.

----------

## Atremis

```

augustus qmail # /usr/bin/tcprulescheck /etc/tcp.smtp.cdb

rule :

deny connection

```

This could be the issue after all...

```

augustus qmail # cat /etc/tcp.smtp

130.126.224.132:allow,RELAYCLIENT=""

127.0.0.1:allow,RELAYCLIENT=""

:deny

```

Yeah, I am an SMTP n00b... what do I need to stick in there to make this work w/o turning my machine into an open relay again?

----------

## rac

Following the instructions in http://www.palomine.net/qmail/relaying.html, I just use /var/qmail/control/rcpthosts to control relaying access.

----------

