Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 195931

Summary: mail-mta/netqmail-1.05-r8 defautl configuration does not allow any kind of authentication neither in smtp nor in pop3
Product: Gentoo Linux Reporter: Ioannis Aslanidis (RETIRED) <deathwing00>
Component: Current packagesAssignee: Benedikt Böhm (RETIRED) <hollow>
Status: RESOLVED INVALID    
Severity: major CC: qmail-bugs+disabled
Priority: Highest    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: conf-pop3d.diff
conf-smtpd.diff

Description Ioannis Aslanidis (RETIRED) gentoo-dev 2007-10-15 09:55:20 UTC
On a fresh install, I have been trying to set up qmail with vpopmail and the virtualdomain files seem to be fine, however trying to log in to pop3 does not work, neither it does with smtp. Any issues?

http://forums.gentoo.org/viewtopic-t-599060.html

I'm always getting the following, no matter what:

# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK <6312.1192327157@mail2.virtualdomain.net>
user iaslanidis@virtualdomain.net
+OK
pass ***********
-ERR authorization failed
Connection closed by foreign host.


@40000000471177ff209d1d0c tcpserver: status: 1/30
@40000000471177ff209d347c tcpserver: pid 6312 from 127.0.0.1
@40000000471177ff22896c4c tcpserver: ok 6312 :::ffff:127.0.0.1:110 :::ffff:127.0.0.1::47389
@400000004711780e0090090c tcpserver: end 6312 status 256
@400000004711780e00901c94 tcpserver: status: 0/30

On SMTP:

auth login
334 VXNlcm5hbWU6
aWFzbGFuaWRpc0B0YW5nbzA0Lm5ldA
334 UGFzc3dvcmQ6
RnJpZ29waWUwOTg
535 authentication failed (#5.7.1) 


What exactly is missconfigured in the default qmail installation? And the guide could definitely cover all these details...
Comment 1 Ioannis Aslanidis (RETIRED) gentoo-dev 2007-10-15 14:29:27 UTC
Solved.

Please, be so kind to add a NOTICE to the vpopmail ebuild or to automatically configure somehow netqmail when emergin vpopmail.

The manual is also missing this.

In order for virtual domains authentication to work, the following has to be added:


mail2 qmail # cat /var/qmail/control/conf-pop3d
# Configuration file for qmail-pop3d
# $Header: /var/cvsroot/gentoo-x86/mail-mta/netqmail/files/conf-pop3d,v 1.1 2006/02/12 18:42:33 hansmi Exp $

# Stuff to run before tcpserver
#QMAIL_TCPSERVER_PRE=""
# Stuff to run before the authenticator
#QMAIL_POP3_PREAUTH=""
# Stuff to run after the user has authenticated successfully
#QMAIL_POP3_POSTAUTH=""

# this should contain the FQDN of your server
# by default it pulls the value from qmail
# which should be correct
QMAIL_POP3_POP3HOST="$(<${QMAIL_CONTROLDIR}/me)"

# If you want POP3 before SMTP, and you are using this POP3 daemon
# uncomment the next two lines
#QMAIL_TCPSERVER_PRE="${QMAIL_TCPSERVER_PRE} envdir /etc/relay-ctrl relay-ctrl-chdir"
#QMAIL_POP3_POSTAUTH="${QMAIL_POP3_POSTAUTH} /usr/bin/relay-ctrl-allow"

# This controls what password authentication tool POP3 uses
# It must support DJB's checkpassword interface (http://cr.yp.to/checkpwd.html)
#QMAIL_POP3_CHECKPASSWORD="/bin/checkpassword"
# cmd5checkpw only validates passwords from /etc/poppasswd
#QMAIL_POP3_CHECKPASSWORD="/bin/cmd5checkpw"

QMAIL_POP3_CHECKPASSWORD="/var/vpopmail/bin/vchkpw"

# The name of the maildir in each user's directory.
# This should be the same thing that defaultdelivery points to
QMAIL_MAILDIR="./Maildir"




mail2 qmail # cat /var/qmail/control/conf-smtpd
# 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
#QMAIL_TCPSERVER_PRE=""
# Stuff to run qmail-smtpd
#QMAIL_SMTP_PRE=""
# Stuff to after qmail-smtpd
#QMAIL_SMTP_POST=""

# this turns off the IDENT grab attempt on connecting
TCPSERVER_OPTS="${TCPSERVER_OPTS} -R"

# fixcrio inserts missing CRs at the ends of lines. See:
# http://cr.yp.to/ucspi-tcp/fixcrio.html
# http://cr.yp.to/docs/smtplf.html
# DO NOT enable this when you are using SSL/TLS (USE=ssl)!
#QMAIL_SMTP_PRE="${QMAIL_SMTP_PRE} fixcrio"

# You might want to use rblsmtpd with this, but you need to fill in a RBL
# server here first, see http://cr.yp.to/ucspi-tcp/rblsmtpd.html for more
# details
#QMAIL_SMTP_PRE="${QMAIL_SMTP_PRE} rblsmtpd -r RBL-SERVER"

# 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"
# In /etc/courier-imap/authdaemonrc add the next line to the end:
#authmodulelist="${authmodulelist} relay-ctrl-allow"
# Then in /etc/courier-imap/{imapd,imapd-ssl,pop3d,pop3d-ssl}
# Add this at the end
#PRERUN="${PRERUN} envdir /etc/relay-ctrl relay-ctrl-chdir"

# This next block is for SMTP-AUTH

# WARNING: If you've installed qmail with USE=noauthcram, and you want to use
# the following programs, you proably need to install them.

# Example using cmd5checkpw
# See the manpage for cmd5checkpw for details on the passwords
#QMAIL_SMTP_CHECKPASSWORD="/bin/cmd5checkpw"

# Example for checkpassword-pam (emerge checkpassword-pam)
# Don't forget to make /usr/bin/checkpassword-pam sticky (see README.auth)
#QMAIL_SMTP_CHECKPASSWORD="/usr/bin/checkpassword-pam -s system-auth"

QMAIL_SMTP_CHECKPASSWORD="/var/vpopmail/bin/vchkpw"

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


Comment 2 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2007-10-15 19:57:41 UTC
Please give diffs, thanks.
Comment 3 Ioannis Aslanidis (RETIRED) gentoo-dev 2007-10-16 07:18:18 UTC
Created attachment 133599 [details, diff]
conf-pop3d.diff

Patch to allow the correct use of vpopmail virtualdomains. Allows proper authentication using POP3.
Comment 4 Ioannis Aslanidis (RETIRED) gentoo-dev 2007-10-16 07:18:56 UTC
Created attachment 133600 [details, diff]
conf-smtpd.diff

Patch to allow the correct use of vpopmail virtualdomains. Allows proper authentication using SMTP.
Comment 5 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2007-10-16 07:29:45 UTC
Handing over to Benedikt Böhm (hollow) as it's vpopmail related.
Comment 6 Benedikt Böhm (RETIRED) gentoo-dev 2007-10-21 08:21:34 UTC
http://www.gentoo.org/doc/en/qmail-howto.xml#doc_chap5_pre1

"(Uncomment the SMTP-AUTH variables and set QMAIL_SMTP_CHECKPASSWORD to /var/vpopmail/bin/vchkpw)"
Comment 7 Ioannis Aslanidis (RETIRED) gentoo-dev 2007-10-22 18:16:08 UTC
It's still missing the pop3 one. Notice that a user might not want to use courier-imap to handle pop3. Adding a note about it wouldn't harm anyone.