# milter-greylist not generating .db file



## drhowarddrfine (May 26, 2014)

The service is running and the milter-greylist.sock is in /var/milter-greylist/ along with the .pid file in /var/run/ but there has never been a milter-greylist.db file in that directory. The service is running as mailnull:mailnull and the /usr/local/etc/mail/greylist.conf file says to create the dumpfile there. So I'm at a loss as to why I never see the .db file there unless it's not generated until needed(?). However, we get enough spam that I can't believe that's true.

I do get the message, when restarting, that it cannot read the dumpfile in /var/milter-greylist and it's starting with an empty list but, as I said, I never see the file there.



> ps -auxww | grep greylist
> mailnull 51365   0.0  1.0 11128 2368  -  Ss    3:03PM    0:00.03 /usr/local/libexec/milter-greylist -P /var/run/milter-greylist.pid -f /usr/local/etc/mail/greylist.conf -p /var/milter-greylist/milter-greylist.sock -u mailnull:mailnull


----------



## wblock@ (May 26, 2014)

I have

```
# ls /var/milter-greylist/greylist.db
/var/milter-greylist/greylist.db
```

And in /usr/local/etc/mail/greylist.conf:

```
pidfile "/var/run/milter-greylist.pid"
socket "/var/milter-greylist/milter-greylist.sock"
dumpfile "/var/milter-greylist/greylist.db"
user "mailnull"
...
```


----------



## drhowarddrfine (May 26, 2014)

I have exactly the same thing except the default user mailnull:mailnull. Originally, permission on greylist.conf was root:wheel. I tried mailnull:mailnull and just setting the user to mailnull and that didn't change anything. Permissions on /var/milter-greylist are mailnull:mailnull. 

I sent an email to myself and it was logged as 
	
	



```
skipping greylist because address XXXX is whitelisted ...
```
 but there is no greylist.db in /var/milter-greylist/ which is driving me crazy.


```
ps -auxww | grep greylist
mailnull 51365   0.0  1.0 11128 2368  -  Ss    3:03PM    0:00.03 /usr/local/libexec/milter-greylist -P /var/run/milter-greylist.pid -f /usr/local/etc/mail/greylist.conf -p /var/milter-greylist/milter-greylist.sock -u mailnull:mailnull
```


----------



## wblock@ (May 26, 2014)

Permissions on greylist.db here are 600, owned by mailnull:mailnull.


----------



## drhowarddrfine (May 26, 2014)

No. greylist.conf


----------



## wblock@ (May 26, 2014)

root:wheel and 400.  /var/milter-greylist is 755 and owned by mailnull:mailnull.


----------



## drhowarddrfine (May 27, 2014)

Same here. I'm lost.


----------



## wblock@ (May 27, 2014)

Do you have any security settings in /etc/rc.conf or /boot/loader.conf?  What options were used when building the mail/milter-greylist port, and are there custom settings in /etc/make.conf?


----------



## drhowarddrfine (May 27, 2014)

Aha! (I think). I looked real quick at /etc/make.conf and the line there is 
	
	



```
SENDMAIL_CF_DIR=/usr/local/share/sendmail/cf
```
 I *think* that was put there when I first installed sendmail from ports. But there is no sendmail.mc or sendmail.cf or freebsd.cf files in that directory so why is this working at all? 

Still confused but maybe you see the problem?


----------



## wblock@ (May 27, 2014)

No idea, but I'd remove it and rebuild sendmail and then all the milters.


----------



## drhowarddrfine (May 27, 2014)

I think I read to put that there when you install sendmail from ports so you're not using the built-in sendmail. I wish I figured that out earlier today since the mail server is running without much traffic today.


----------



## drhowarddrfine (May 27, 2014)

Ok. I think I'm on track to find what the problem is. I was following a site that was showing how to set this up with better security using cyrus-sasl. I was in a rush to get sendmail working and I got to the point where it was working as far as I could tell but it wasn't working in the way it should have. I see problems with my install of all this and I need to review that.

Thanks for your help.


----------



## wblock@ (May 27, 2014)

It might just be an outdated tutorial.  The port has an option for SASL now, although I don't know if the port looks in the normal locations or in /usr/local/etc/.


----------



## drhowarddrfine (May 27, 2014)

It was this one http://www.puresimplicity.net/~hemi/fre ... dmail.html but uses security/cyrus-sasl2.


----------

