# A potpourri of qmail issues (not using vpopmail)

## maiku

First, if start up the qmail server without a rcphosts file specified, qmail won't listen on port 25.  But if I put a domain in rcphosts it won't send to any other domain.

Second, qmail-scanner and spamassassin are both set up and run without errors.  spamd  gives me a little bit of trouble when starting *Quote:*   

>  * Starting spamd ...
> 
> [7444] info: config: dcc_dccifd_path "/usr/sbin/dccifd" isn't a socket
> 
> [7444] info: config: SpamAssassin failed to parse line, "/usr/sbin/dccifd" is not valid for "dcc_dccifd_path", skipping: dcc_dccifd_path /usr/sbin/dccif  [ ok ]

 but the process runs anyway.  But I don't think it's scanning.  When I receive a mail it doesn't look like it gets scanned:  /var/log/qmail/qmail-smtpd/current *Quote:*   

> @4000000046bd4b263a85be2c new msg 75428
> 
> @4000000046bd4b263a85cdcc info msg 75428: bytes 1572 from <mikel@teknetronix.com> qp 7200 uid 210
> 
> @4000000046bd4b270205efcc starting delivery 2: msg 75428 to remote mikel@crcomputerbiz.net
> ...

 .

Third, how can I set it up so that users MUST authenticate to send mail using SMTP?

Fourth, how can I set it up so that users can use SSL for auth with SMTP (or at least TLS)?

Associated configs:

/var/qmail/control/conf-common *Quote:*   

> #!/bin/bash
> 
> # Common Configuration file for all qmail daemons
> 
> # $Header: /var/cvsroot/gentoo-x86/mail-mta/netqmail/files/conf-common,v 1.1 2006/02/12 18:42:33 hansmi Exp $
> ...

 /var/qmail/control/conf-smtpd *Quote:*   

> # Configuration file for qmail-smtpd
> 
> # $Header: /var/cvsroot/gentoo-x86/mail-mta/netqmail/files/conf-smtpd,v 1.1 2006/02/12 18:42:33 hansmi Exp $
> 
> # Stuff to run before tcpserver
> ...

 /etc/mail/spamassassin/local.cf *Quote:*   

> ###########################################################################
> 
> loadplugin     Mail::SpamAssassin::Plugin::DCC
> 
> loadplugin     Mail::SpamAssassin::Plugin::Pyzor
> ...

 

----------

## maiku

Any suggestions at all would be very helpful.

----------

## Larde

Hi!

I cannot help too much I fear, but I try anyway...

First: rcphosts, qmail not sending to other domains

Can't really help with that. There must be a configuration problem somewhere else.

Second: spamd warning, not scanning?

I don't use dcc_dccifd_path directive, but the error message is quite correct: "/usr/sbin/dccifd" is an executable, not a socket. Why do you want to configure the daemon as socket? I just load the DCC plugin with standard options - I don't set any.

Also: /var/log/qmail/qmail-smtpd/current doesn't show you when mail gets scanned, try /var/log/messages instead.

Third and fourth: User authentication for SMTP + TLS

It's been a while since I set everything up here, but this works for me:  :Smile: 

USE flags:

```

[ebuild   R   ] mail-mta/netqmail-1.05-r8  USE="qmail-spp ssl -gencertdaily -highvolume -mailwrapper -noauthcram -vanilla"

```

/var/qmail/control/conf-smtpd

```

TCPSERVER_OPTS="${TCPSERVER_OPTS} -R"

QMAIL_SMTP_PRE="${QMAIL_SMTP_PRE} /var/qmail/bin/qgreylistrbl.pl"

QMAIL_SMTP_CHECKPASSWORD="/bin/cmd5checkpw"

[[ -n "${QMAIL_SMTP_CHECKPASSWORD}" ]] && {

        [[ -z "${QMAIL_SMTP_POST}" ]] && QMAIL_SMTP_POST=/bin/true

        QMAIL_SMTP_POST="${QMAIL_SMTP_CHECKPASSWORD} ${QMAIL_SMTP_POST}"

}

```

(Yes, my config is kind of ancient, I once started with cmd5checkpw and I still use it.)

/etc/tcprules.d/tcp.qmail-smtp

```

127.0.0.1:allow,RELAYCLIENT="",RBLSMTPD=""

:allow,QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue"

```

Hmm, basically, I don't see anything exciting in my config compared with yours. What's not working anyway with your config?  :Smile: 

Uhm: just noticed: Why do you use

```

# If you are interested in providing POP or IMAP before SMTP type relaying,

# emerge relay-ctrl, then uncomment the next 2 lines

QMAIL_TCPSERVER_PRE="${QMAIL_TCPSERVER_PRE} envdir /etc/relay-ctrl relay-ctrl-chdir"

QMAIL_SMTP_PRE="${QMAIL_SMTP_PRE} relay-ctrl-check" 
```

Regards,

Larde

----------

## maiku

All of the guides I read tell me to uncomment those lines.  In fact, those lines sound almost as if they NEED to be uncommented.  I tried re-emerging netqmail with qmail-spp support on.  It still doesn't force me to authenticate.  I wonder where I could have went wrong?

It is notable that the file also tells me to put "relay-ctrl-allow" in my /etc/courier/authlib/authdaemonrc file in the "authmodulelist" option but doing so breaks courier-authlib.  I swear I am very confused and not sure where I could be going wrong.

----------

## maiku

While these issues noted above are still not solved, I get to add a new issue to the list.  Now I notice that in IMAP (either through web-access or a client such as Outlook) when I delete a mail it just gets crossed out.  I can't actually delete it or empty the trash bin.

----------

## maiku

spamassassin is definitely not working.  I just hooked the server up live and I'm getting spam up the wazoo.  When I receive mails it says nothing in the log about spamassassin taking any action, the mails are just being delivered.  Could the issue be with my tcp.qmail-smtp config? *Quote:*   

> 127.0.0.1:allow,RELAYCLIENT="",RBLSMTPD=""
> 
> :allow,QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue"

 

----------

## maiku

Figured out the answer!  It was my spamassassin local.cf.  The "clear_headers" line literally cleared the headers that qmail-scanner looks for to test if spamassassin is installed and configured correctly.  Taking that out fixed the issue 100%!

----------

## JC99

Where did you find out how to configure spamassassin for qmail?

----------

## maiku

I'm guilty of reading walkthroughs and using their stuff literally (without knowing what's going on).  So I used the QmailRocksOnGentoo walkthrough on the gentoo-wiki.com site.  Still now sure what most of those options do, but I'm sure as time goes on I'll figure it out.  The good thing is the spam has been reduced greatly.

The more it works the better, of course.

----------

## maiku

How can I throw procmail into the equation?  'Cause, let's say I wanted to move Spam to the "Junk" folder.  Procmail looks like it'll do that but only if it's invoked...

----------

## maiku

I was able to add procmail to the equation by changing my /var/qmail/control/defaultdelivery to this *Quote:*   

> |dot-forward .foward
> 
> |procmail

 Then I created /etc/procmailrc *Quote:*   

> DROPPRIVS=yes
> 
> DEFAULT=$HOME/Maildir/
> 
> MAILDIR=$HOME/Maildir/
> ...

 and then it all came together.  Now all of the mail marked as "spam" gets moved to every user's Junk folder automatically.  With this configuration, users can also have .procmailrc files in their home directories for more personal mail filtering also.  Very cool in my opinion.

----------

