# HOWTO: qmail vpopmail qmail-scanner courier squirrelmail

## sabrex

1) ensure that the proper USE flags are set

```
> nano -w /etc/make.conf

add apache2, maildir, and mysql as USE flags.
```

2) install qmail

```
First of all, make sure that you unmerge the other mail handlers that may be installed, such as ssmtp, sendmail, or postfix:

> emerge -C ssmtp sendmail postfix

> emerge qmail

> ebuild /var/db/pkg/net-mail/qmail-1.03-r13/qmail-1.03-r13.ebuild config

 

> ln -s /var/qmail/supervise/qmail-send /service/qmail-send

> ln -s /var/qmail/supervise/qmail-smtpd /service/qmail-smtpd

> rc-update add svscan default

> /etc/init.d/svscan start
```

3) install vpopmail

```
> emerge vpopmail

First log into mysql as your mysql root user and pass. Then:

> create database vpopmail;

> use mysql;

> grant select, insert, update, delete, create, drop on vpopmail.* to vpopmail@localhost identified by 'your password';

> flush privileges;

 

If you have problems with vpopmail not accepting mail properly,

please ensure that /etc/vpopmail.conf is chmod 600 and

owned by vpopmail:vpopmail
```

4) install spam database clients. net-ping and dcc may need to be force-emerged.

```
> emerge pyzor

> emerge /usr/portage/dev-perl/net-ping/net-ping-2.31.ebuild

> emerge razor

> emerge /usr/portage/net-mail/dcc/dcc-1.2.28.ebuild
```

5) install f-prot and Mail-SpamAssassin.  they must be running before installing qmail-scanner.

```
> emerge f-prot Mail-SpamAssassin

> nano -w /etc/conf.d/spamd.conf

  SPAMD_OPTS="-d -u vpopmail -v -x -C /etc/mail/spamassassin/local.cf"

> rc-update add spamd default

> /etc/init.d/spamd start

You'll want to set up a cron.daily job to update the f-prot definitions automatically:

> nano -w /etc/cron.daily/virus-update.cron

#!/bin/bash

/opt/f-prot/check-updates.pl -cron -quiet

> chmod 755 /etc/cron.daily/virus-update.cron

> crontab -e

# min hour day month weekday command

0 1 * * * /etc/cron.daily/virus-update.cron

Now to set up spam processing rules:

> nano -w /etc/mail/spamassassin/local.cf

required_hits  5.0

rewrite_subject  1

subject_tag  *****SPAM*****

report_safe  1

report_header  1

use_bayes  1

auto_learn  1

skip_rbl_checks  0

use_razor2  1

use_dcc  1

use_pyzor  1

ok_languages  all

ok_locales  all
```

6) install qmail-scanner.  for this to work, you may have to force the install of maildrop.

```
> emerge /usr/portage/net-mail/maildrop/maildrop-1.5.3-r1.ebuild

> emerge qmail-scanner

Please log into the "qmaild" account  and run

/var/qmail/bin/qmail-scanner-queue.pl -g

 

If you see the error "Can't do setuid", or "Permission denied", then

refer to the FAQ.

 

(e.g.  "setuidgid qmaild "/var/qmail/bin/qmail-scanner-queue.pl -g"

or "su qmaild -c "/var/qmail/bin/qmail-scanner-queue.pl -g")

The 'subject_tag' variable in /etc/mail/sendmail/local.cf does not seem to change the subject of detected spam.  As a workaround, do this:

> nano -w /var/qmail/bin/qmail-scanner-queue.pl

my $spamc_subject='*****SPAM*****';

Now update tcp.smtp to activate qmail-scanner

> nano -w /etc/tcp.smtp

# Qmail-Scanner disabled for mail from 127.0.0.1

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

# Qmail-Scanner enabled (virus only) for mail from local network

192.168.1.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"

# Qmail-Scanner enabled (virus and spam) for mail from external internet

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

save tcp.smtp and then:

> tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp

> chmod 644 /etc/tcp.smtp*
```

7) install courier-imap as imap and pop3 server

```
> emerge courier-imap

> nano -w /etc/courier-imap/authdaemonrc

  authmodulelist="authvchkpw"

> nano -w /etc/courier-imap/imapd

  IMAPDSTART=YES

  MAILDIR=Maildir

> nano -w /etc/courier-imap/pop3d

  POP3DSTART=YES

  MAILDIR=Maildir

> rc-update add courier-imapd default

> rc-update add courier-pop3d default

> /etc/init.d/courier-imapd start

> /etc/init.d/courier-pop3d start
```

8) update the smtpd config to allow smtp-auth using vpopmail

```
> nano -w /var/qmail/control/conf-smtpd

QMAIL_SMTP_POST="mail.mydomain.com /var/vpopmail/bin/vchkpw /bin/true"

> svc -t /var/qmail/supervise/qmail-smtpd

> chmod u+s /var/vpopmail/bin/vchkpw

The following step makes sending mail a lot faster under some circumstances, and I highly recommend that you do the following if you notice delays of 30 to 45 seconds sending mail:

> nano -w /var/qmail/control/conf-common

TCPSERVER_OPTS="-H -R -l 0" (that's lower-case L followed by zero)

```

9) install qmailadmin

```
> emerge ezmlm-idx-mysql

> wget http://www.inter7.com/devel/autorespond-2.0.2.tar.gz

> tar -zxvf autorespond-2.0.2.tar.gz

> cd autorespond-2.0.2

> make

> make install

> wget http://www.inter7.com/qmailadmin/qmailadmin-1.0.6.tar.gz

> tar -zxvf qmailadmin-1.0.6.tar.gz

> cd qmailadmin-1.0.6

> ./configure --enable-htmldir=/var/www/localhost/htdocs/ --with-htmllibdir=/var/www/localhost/htdocs/qmailadmin --enable-cgibindir=/var/www/localhost/cgi-bin/ --enable-autoresponder-bin=/usr/local/bin --enable-ezmlmdir=/usr/bin --enable-ezmlmidx=y --enable-vpopuser=vpopmail --enable-vpopgroup=vpopmail

> make

> make install
```

10) install squirrelmail

```
> emerge squirrelmail

> perl /var/www/localhost/htdocs/squirrelmail/config/conf.pl

set up squirrelmail

You can also set up the vpopmail squirrelmail plugin as follows. For this to work though, you'll need to run apache as vpopmail:vpopmail by editing /etc/apache2/conf/commonapache2.conf.  This may be a security risk, so follow at your own risk:

> wget http://www.squirrelmail.org/plugins/vpopmail.1.00-1.4.0.tar.gz

> cd /<your squirrelmail dir>/plugins

> tar -zxvf /<location of vpopmail.1.00-1.4.0.tar.gz>

> cd vpopmail

> nano -w config.php

$vpopmail_autorespondpath = '/usr/local/bin';

> perl /var/www/localhost/htdocs/squirrelmail/config/conf.pl

activate the vpopmail plugin

```

Last edited by sabrex on Sat Feb 07, 2004 6:41 am; edited 18 times in total

----------

## dodger10k

First of all thanks for this howto. I set everything up as you wrote it and when booting everything seems to start properly.

But looking deeper qmailctl gives me this:

 *Quote:*   

> /service/qmail-send: up (pid 11007) 1 seconds
> 
> /service/qmail-send/log: up (pid 6215) 784 seconds
> 
> /service/qmail-smtpd: up (pid 6217) 784 seconds
> ...

 

First of all I was wondering about the "-1" mails in queue but more I was wondering about the uptime of qmail-send, which obviously doesn´t seem to be correct.

And then a ps gives me this:

 *Quote:*   

> root      1550  0.0  0.0  1316  228 ?        S    02:44   0:00 readproctitle service errors: ...: temporary failure?supervise: fatal: unable to acquire log/supervise/lock: temporary failure?supervise: fatal: unable to acquire log/supervise/lock: temporary failure?supervise: fatal: unable to acquire qmail-send/supervise/lock: temporary failure?supervise: fatal: unable to acquire log/supervise/lock: temporary failure?supervise: fatal: unable to acquire log/supervise/lock: temporary failure?
> 
> root      6210  0.0  0.0  1328  268 ?        S    02:56   0:00 supervise qmail-send
> 
> root      6212  0.0  0.0  1328  264 ?        S    02:56   0:00 supervise qmail-smtpd
> ...

 

What´s going wrong here? Any hints would be appreciated  :Smile: 

----------

## sabrex

not 100% sure what the problem could be, but it looks like it could be related to the smtp-auth step (step 10).  If you don't need smtp-auth, then you don't need to follow step 10.  Try to reverse the changes you made in step 10 and see if that fixes things up.  Also, this howto assumes that you are running 1.03-r13 or higher.  If not, then I suggest doing an `emerge qmail` again to update it.

also, re-run the tcprules command from step 9 just to be safe, since your errors seem to indicate something may be wrong with tcp.smtp.cdb ...

----------

## SpoKKe

Hi, 

I've tried to install all the mailservers programs indicated in your simple and very util post, the installation was perfect, no erros no problem, the only problem is that the pop3 auth fail !!  :Sad: 

I've installed vqadmin for create the virtual domains under vpopmail, i create the domain then  the mail account, then i try to auth whit my mail-client and always the same error :

Dec  8 13:25:24 elk pop3d: Connection, ip=[80.182.80.113]

Dec  8 13:25:24 elk pop3d: LOGIN: DEBUG: ip=[80.182.80.113], command=USER

Dec  8 13:25:24 elk pop3d: LOGIN: DEBUG: ip=[80.182.80.113], command=PASS

Dec  8 13:25:24 elk pop3d: LOGIN: DEBUG: ip=[80.182.80.113], username=XXXXXX

Dec  8 13:25:24 elk pop3d: LOGIN: DEBUG: ip=[80.182.80.113], password=XXXXXXX

Dec  8 13:25:24 elk authdaemon: authdaemon: s_connect() failed: Connection refused

Dec  8 13:25:29 elk pop3d: LOGIN FAILED, ip=[80.182.80.113]

Dec  8 13:25:30 elk pop3d: LOGIN: DEBUG: ip=[80.182.80.113], command=QUIT

Dec  8 13:25:30 elk pop3d: Disconnected, ip=[80.182.80.113]

Can you tell me someting about it?

I can't debug more specfic errors with courier ;(

Tnks 

Spokke

----------

## sabrex

spokke, make sure that you have followed step 7.  Specifically, make sure that authmodulelist only contains authvchkpw, and no other modules.

----------

## SpoKKe

Now I'll try to reemerge the complete procedure  :Smile: 

But i'va another question regard the point 7:

Why you change the MAILDIR variable from .maildir to Maildir?

The default qmail gentoo installation change the Maildir in .maildir, why you make another change?

(sorry for my english it'snt good)   :Smile: 

----------

## salk

Hi sabrex,

Absolutly brilliantly easy howto  :Smile:   :Smile:   :Smile: 

I have been looking for something like this for ages.

now... linking up ezmlm ... do you know if its a hassle ? what do you suggest.

----------

## sabrex

 *salk wrote:*   

> Hi sabrex,
> 
> Absolutly brilliantly easy howto   
> 
> I have been looking for something like this for ages.
> ...

 

Thanks  :Smile:  I got pretty frustrated setting up qmail/vpopmail myself, so after I finally figured it all out, decided to write a howto.  Partly so I'd have a reference for the future, and also to help out the great Gentoo community...

As for ezmlm, here's step 11 ... although I'm not sure if it will do exactly what you want it to.  This is for setting up qmailadmin, which utilizes ezmlm, though I'm not sure if it uses the ezmlm-idx-mysql package or not.  You may just want to emerge ezmlm-idx instead if things don't work out.

11) install qmailadmin

```
> emerge qmail-autoresponder ezmlm-idx-mysql

> wget http://www.inter7.com/qmailadmin/qmailadmin-1.0.6.tar.gz

> tar -zxvf qmailadmin-1.0.6.tar.gz

> ./configure --enable-htmldir=/var/www/localhost/htdocs/ --with-htmllibdir=/var/www/localhost/htdocs/qmailadmin --enable-cgibindir=/var/www/localhost/cgi-bin/ --enable-autoresponder-bin=/usr/bin --enable-vpopuser=vpopmail --enable-vpopgroup=vpopmail --enable-ezmlmdir=/usr/bin --enable-ezmlmidx=y

> make

> make install
```

----------

## salk

Hi All,

Not sure if anyone else will get this ... but i usually get the crap  :Razz: 

I had to add qmail as a group before emerging qmail.

----------

## capitanjackal

compliments for this howto!

but a simple question:

how can I know if qmail-scanner is going ?

Are scand and spamd logs reported in:

/var/log/mail/current ?

Strange thing:

su qmaild -c "/var/qmail/bin/qmail-scanner-queue.pl -g", give me the prompt without warning, while doppione etc # setuidgid qmaild "/var/qmail/bin/qmail-scanner-queue.pl -g" give:

setuidgid: fatal: unable to run /var/qmail/bin/qmail-scanner-queue.pl -g: file does not exist

I think that my problem is the suid of perl...

thanks

Giacomo

----------

## Ritter

I cant seem to prove that the clamav is really doing anything, I can send myself all forms of the eicar test virus signature and always get:

```
Received: from ***@mydomain.tld by yorke by uid 201 with qmail-scanner-1.16

 (clamscan: 0.60. spamassassin: 2.60.  Clear:SA:0(0.1/5.0):. 

 Processed in 2.197057 secs); 19 Dec 2003 19:36:20 -0000
```

Can anyone suggest how to prove or verify that clamav is really working?

I have this in /var/spool/qmailscan/qmail-queue.log:

```
19/12/2003 12:36:18:7407: +++ starting debugging for process 7407 by uid=201 at 19/12/2003 12:36:18

19/12/2003 12:36:18:7407: setting UID to EUID so subprocesses can access files generated by this script

19/12/2003 12:36:18:7407: program name is qmail-scanner-queue.pl, version 1.16

19/12/2003 12:36:18:7407: incoming SMTP connection from via smtp from 24.2.89.214

19/12/2003 12:36:18:7407: w_c: mkdir /var/spool/qmailscan/yorke10718625784267407

19/12/2003 12:36:18:7407: w_c: start dumping incoming msg into /var/spool/qmailscan/working/tmp/yorke10718625784267407 [1071862578.18521]

19/12/2003 12:36:18:7407: w_c: rename new msg from /var/spool/qmailscan/working/tmp/yorke10718625784267407 to /var/spool/qmailscan/working/new/yorke10718625784267407 [1071862578.18873]

19/12/2003 12:36:18:7407: d_m: starting /usr/bin/reformime  -x/var/spool/qmailscan/yorke10718625784267407/ </var/spool/qmailscan/working/new/yorke10718625784267407 [1071862578.18925]

19/12/2003 12:36:18:7407: d_m: finished /usr/bin/reformime  -x/var/spool/qmailscan/yorke10718625784267407/ [1071862578.20244]

19/12/2003 12:36:18:7407: d_m: Checking all attachments to see if they're MS-TNEF

19/12/2003 12:36:18:7407: d_m: is /var/spool/qmailscan/yorke10718625784267407/1071862578.7409-0.yorke is a TNEF file?: 256 [1071862578.20759]

19/12/2003 12:36:18:7407: d_m: is /var/spool/qmailscan/yorke10718625784267407/eicar.com is a TNEF file?: 256 [1071862578.21203]

19/12/2003 12:36:18:7407: d_m: Manually unpack any zip files as some virus scanners don't do zip under Unix!

19/12/2003 12:36:18:7407: d_m: unpacking message took 0.023407 seconds

19/12/2003 12:36:18:7407: unsetting QMAILQUEUE env var

19/12/2003 12:36:18:7407: g_e_h: return-path is "jlarson@candlefire.org", recips is "jakl@candlefire.org"

19/12/2003 12:36:18:7407: from=Jason k Larson <jlarson@candlefire.org>,subj=test, x-qmail-scanner-message-id=<3FE35301.9040103@candlefire.org> via smtp from 24.2.89.214

19/12/2003 12:36:18:7407: ini_sc: start scanning

19/12/2003 12:36:18:7407: p_s: starting scan of directory "/var/spool/qmailscan/yorke10718625784267407"...

19/12/2003 12:36:18:7407: p_s:  '81:ILOVEYOU' = 'Virus-subject' = 'Love Letter Virus/Trojan'

19/12/2003 12:36:18:7407: p_s:  type is a header!

19/12/2003 12:36:18:7407: p_s:  checking for objects containing subject: ILOVEYOU

19/12/2003 12:36:18:7407: p_s:  '82:message/partial' = 'Virus-content-type' = 'Message/partial MIME attachments blocked by policy'

19/12/2003 12:36:18:7407: p_s:  type is a header!

19/12/2003 12:36:18:7407: p_s:  checking for objects containing content-type: message/partial

19/12/2003 12:36:18:7407: p_s:  '85:.{100,}' = 'Virus-date' = 'MIME Header Buffer Overflow'

19/12/2003 12:36:18:7407: p_s:  type is a header!

19/12/2003 12:36:18:7407: p_s:  checking for objects containing date: .{100,}

19/12/2003 12:36:18:7407: p_s:  '86:.{100,}' = 'Virus-mime-version' = 'MIME Header Buffer Overflow '

19/12/2003 12:36:18:7407: p_s:  type is a header!

19/12/2003 12:36:18:7407: p_s:  checking for objects containing mime-version: .{100,}

19/12/2003 12:36:18:7407: p_s:  '87:.{100,}' = 'Virus-resent-date' = 'MIME Header Buffer Overflow'

19/12/2003 12:36:18:7407: p_s:  type is a header!

19/12/2003 12:36:18:7407: p_s:  checking for objects containing resent-date: .{100,}

19/12/2003 12:36:18:7407: p_s:  type is a header!

19/12/2003 12:36:18:7407: p_s:  'eicar.com' = '69' = 'EICAR Test Virus'

19/12/2003 12:36:18:7407: p_s: type is a size!

19/12/2003 12:36:18:7407: p_s:  'happy99.exe' = '10000' = 'Happy99 Trojan'

19/12/2003 12:36:18:7407: p_s: type is a size!

19/12/2003 12:36:18:7407: p_s:  'zipped_files.exe' = '120495' = 'W32/ExploreZip.worm.pak virus'

19/12/2003 12:36:18:7407: p_s: type is a size!

19/12/2003 12:36:18:7407: p_s: skipping auto-generated file 1071862578.7409-0.yorke

19/12/2003 12:36:18:7407: p_s: checking eicar.com against perlscanner database...

19/12/2003 12:36:18:7407: p_s: file eicar.com is lowercased to eicar.com and has extension .com

19/12/2003 12:36:18:7407: p_s: compare eicar.com against perlscanner database

19/12/2003 12:36:18:7407: p_s:  finished scan of dir "/var/spool/qmailscan/yorke10718625784267407" in 0.007507 secs

19/12/2003 12:36:18:7407: ini_sc: recursively scan the directory /var/spool/qmailscan/yorke10718625784267407/

19/12/2003 12:36:18:7407: scanloop: starting scan of directory "/var/spool/qmailscan/yorke10718625784267407"...

19/12/2003 12:36:18:7407: clamscan: starting scan of directory "/var/spool/qmailscan/yorke10718625784267407"...

19/12/2003 12:36:18:7407: run /usr/bin/clamscan -r  --tempdir=/var/spool/qmailscan/yorke10718625784267407 --disable-summary --unzip --unrar --unace --unarj --zoo --lha --jar --tar --tgz  /var/spool/qmailscan/yorke10718625784267407 2>&1

19/12/2003 12:36:18:7407: --output of clamscan was:

--

19/12/2003 12:36:18:7407: clamscan: finished scan of dir "/var/spool/qmailscan/yorke10718625784267407" in 0.403599 secs

19/12/2003 12:36:18:7407: SA: run /usr/bin/spamc  -c -f < /var/spool/qmailscan/working/new/yorke10718625784267407

19/12/2003 12:36:18:7407: spamassassin: finished scan of dir "/var/spool/qmailscan/yorke10718625784267407" in 1.746304 secs

19/12/2003 12:36:18:7407: scanloop: finished scan of "/var/spool/qmailscan/yorke10718625784267407"...

19/12/2003 12:36:18:7407: ini_sc: scanning message took 2.158656 seconds

19/12/2003 12:36:18:7407: q_r: fork off child into /var/qmail/bin/qmail-queue...

19/12/2003 12:36:18:7407: cleanup: /bin/rm -rf /var/spool/qmailscan/yorke10718625784267407/ /var/spool/qmailscan/working/new/yorke10718625784267407

19/12/2003 12:36:20:7407: all finished. Total of 2.391649 secs
```

Any help figuring this out would be greatly appreciated.Last edited by Ritter on Fri Dec 26, 2003 7:46 pm; edited 1 time in total

----------

## sabrex

 *Ritter wrote:*   

> I cant seem to prove that the clamav is really doing anything, I can send myself all forms of the eicar test virus signature and always get:
> 
> <snip>
> 
> Any help figuring this out would be greatly appreciated.

 

Go through step 5 again.  I have made some changes recently that may accomplish this, although I haven't tested it much.  Tell me if making those changes makes a difference.

----------

## soroh6

Um.. so, I go to mydomain/squirrelmail, but it won't let me login..  :Neutral: 

Just says invalid user/pass.. any ideas? Heh.

-edit-

Hm, I can't even login via localhost:143 ...

----------

## Guybrush

THANKS ALOT!

My email-Server which was already running qmail (for smtp and pop3), courier-imap (for imap) and vpopmail for authenticating all 3 protocols didn't function well after upgrading my qmail-installation. But after following the steps (leaving out the spam things) got it up and running again. 

I'm going to try to include SpamAssassin for Spam filtering as described in this thread soon.

And btw, has anyone tried to include a virus scanner as well?

Once again, great tutorial.

----------

## sabrex

 *Guybrush wrote:*   

> 
> 
> And btw, has anyone tried to include a virus scanner as well?
> 
> 

 

The section on spamassassin also covers virus filtering via clamav.

----------

## irasnyd

I'm having problems getting it to authenticate.  I cannot send nor check mail, it always tells me that "Login Failed"

I don't know which log files I should post, so could someone please help me out?

Thanks!

EDIT: I've gotten qmailadmin and vqadmin working fine now.

EDIT2: Now I have the problem of getting logins working.  I can't login and I do not know what is wrong.  I have created the users, and they are in the database, but I do not know why they keep giving me login failed, both with Thunderbird and with Squirrelmail (which I may not have set up correctly to deal with virtual domains)

Thanks for your help!

----------

## sabrex

 *irasnyd wrote:*   

> I'm having problems getting it to authenticate.  I cannot send nor check mail, it always tells me that "Login Failed"
> 
> I don't know which log files I should post, so could someone please help me out?

 

Step 7 is the most important here.  Specifically, make sure that you have removed all other authmodules other than vchkpw.  You do not need to set up squirrelmail to work with vpopmail.  If courier-imap is set up to use vchkpw, then squirrelmail will automatically do the same.

As for the log files, the login info would be in the files in /var/log/mail/

----------

## irasnyd

I've just looked at it alot longer, and have turned on logging in both the courier-imapd and courier-pop3d.  They both are getting the correct usernames and passwords.  (as far as I know the username should be of the form ira@mydomain.com (with the domain after it. I have tried it both with and without))

EDIT: I now have it logging in via Mozilla Thunderbird, but squirrelmail still is not working.

What I had to change to get it working was to change /etc/courier-imap/imapd and /etc/courier-imap/pop3d

```

AUTHMODULES="authvchkpw"

```

I don't have any idea why squirrelmail isn't working, so if anyone knows please do tell.

Here is my /etc/courier-imap/authdaemonrc file:

```

root@server root # cat /etc/courier-imap/authdaemonrc

##VERSION: $Id: authdaemonrc.in,v 1.8 2001/10/07 02:16:22 mrsam Exp $

#

# Copyright 2000-2001 Double Precision, Inc.  See COPYING for

# distribution information.

#

# authdaemonrc created from authdaemonrc.dist by sysconftool

#

# Do not alter lines that begin with ##, they are used when upgrading

# this configuration.

#

# This file configures authdaemond, the resident authentication daemon.

#

# Comments in this file are ignored.  Although this file is intended to

# be sourced as a shell script, authdaemond parses it manually, so

# the acceptable syntax is a bit limited.  Multiline variable contents,

# with the \ continuation character, are not allowed.  Everything must

# fit on one line.  Do not use any additional whitespace for indentation,

# or anything else.

##NAME: authmodulelist:0

#

# The authentication modules that are linked into authdaemond.  The

# default list is installed.  You may selectively disable modules simply

# by removing them from the following list.  The available modules you

# can use are: authcustom authcram authuserdb authvchkpw authmysql authpam

authmodulelist="authvchkpw"

##NAME: authmodulelistorig:1

#

# This setting is used by Courier's webadmin module, and should be left

# alone

authmodulelistorig="authcustom authcram authuserdb authvchkpw authmysql authpam"

##NAME: daemons:0

#

# The number of daemon processes that are started.  authdaemon is typically

# installed where authentication modules are relatively expensive: such

# as authldap, or authmysql, so it's better to have a number of them running.

# PLEASE NOTE:  Some platforms may experience a problem if there's more than

# one daemon.  Specifically, SystemV derived platforms that use TLI with

# socket emulation.  I'm suspicious of TLI's ability to handle multiple

# processes accepting connections on the same filesystem domain socket.

#

# You may need to increase daemons if as your system load increases.  Symptoms

# include sporadic authentication failures.  If you start getting

# authentication failures, increase daemons.  However, the default of 5

# SHOULD be sufficient.  Bumping up daemon count is only a short-term

# solution.  The permanent solution is to add more resources: RAM, faster

# disks, faster CPUs...

daemons=5

##NAME: version:0

#

# When you have multiple versions of authdaemond.* installed, authdaemond

# just picks the first one it finds.  Set "version" to override that.

# For example:  version=authdaemond.plain

version=""

##NAME: authdaemonvar:0

#

# authdaemonvar is here, but is not used directly by authdaemond.  It's

# used by various configuration and build scripts, so don't touch it!

authdaemonvar=/var/lib/courier-imap/authdaemon

```

Any ideas what is wrong?  Anything else I can post to help make debugging this easier?

Thanks.

----------

## guitard00d

Well, I followed your instructions to the letter and it appears that everything is working because I can send mail to root@ my domain.

But, since I'm new to qmail, I don't know how to create virtual domains and create user accounts (I'm talking about non-system accounts). I've been using sendmail for years and when I switched to Gentoo, I decided that it would be better to switch to qmail because of the virtual domain features and added security.

Would you know of a HOWTO for administering this setup for virtual domains?

----------

## sabrex

 *guitard00d wrote:*   

> Well, I followed your instructions to the letter and it appears that everything is working because I can send mail to root@ my domain.
> 
> But, since I'm new to qmail, I don't know how to create virtual domains and create user accounts (I'm talking about non-system accounts). I've been using sendmail for years and when I switched to Gentoo, I decided that it would be better to switch to qmail because of the virtual domain features and added security.
> 
> Would you know of a HOWTO for administering this setup for virtual domains?

 

You can either use qmailadmin to administer accounts via the web, or use the vpopmail binaries located in /var/vpopmail/bin (I recommend the latter)

- To add a new domain with vpopmail, run `vadddomain yourdomain.com` ... it will ask you to set up a postmaster password.

- To add a new user, run `vadduser user@yourdomain.com password` ... if you leave out the password, it will ask you to create one for the user.

Those are the main two commands needed to get you up and running.  valiasdomain creates an alias to the domain itself, so that all_users@domain2.com will have an alias to all_users@domain1.com.  valias simply creates an alias to the email address itself.  Just play around with them and you'll get the hang of it.

Note, qmailadmin currently handles valias differently than the vpopmail binaries.  I suggest sticking to one or the other for alias administeration.  valias uses the mysql database, whereas qmailadmin uses qmail files (for aliases only, it still uses mysql for everything else).  Future versions of qmailadmin will use the valias binary, but that is not yet the case.

----------

## guitard00d

 *sabrex wrote:*   

> spokke, make sure that you have followed step 7.  Specifically, make sure that authmodulelist only contains authvchkpw, and no other modules.

 

I have the same problem, I have authmodulelist="authvchkpw" in my /etc/courier-imap/authdaemonrc and I've created a virtual domain using vadddomain, but when I try to log in as postmaster@[my domain] with imap or pop3, it always fails.

Any idea where else to look for the problem? I'm new to this qmail, vpopmail and courier thing, so I'm really wandering aimlessly trying to figure out what's what here.

----------

## sabrex

 *guitard00d wrote:*   

> I have the same problem, I have authmodulelist="authvchkpw" in my /etc/courier-imap/authdaemonrc and I've created a virtual domain using vadddomain, but when I try to log in as postmaster@[my domain] with imap or pop3, it always fails.
> 
> Any idea where else to look for the problem? I'm new to this qmail, vpopmail and courier thing, so I'm really wandering aimlessly trying to figure out what's what here.

 

I take it that the domain is properly hosted through bind (named)?  So `ping mail.yourdomain.com` resolves properly, etc?  Also, are the entries going into the vpopmail mysql database properly when you add a domain, user, etc?

I really can't think of why else you can't log in.  Make sure that the mysql database is indeed working, and that the username/password combination for the vpopmail database is the same as in /etc/vpopmail.conf

----------

## guitard00d

 *sabrex wrote:*   

> I take it that the domain is properly hosted through bind (named)?  So `ping mail.yourdomain.com` resolves properly, etc?  Also, are the entries going into the vpopmail mysql database properly when you add a domain, user, etc?
> 
> I really can't think of why else you can't log in.  Make sure that the mysql database is indeed working, and that the username/password combination for the vpopmail database is the same as in /etc/vpopmail.conf

 

I can ping mail.maxgfx.net and it definitely resolves and the MySQL database is working because I can look at it in phpmyadmin and see all the users in vpopmail.vpopmail table. Obivously vadddomain and vadduser are talking to MySQL, otherwise those entries wouldn't be in there. It just appears that courier-imapd and courier-pop3d can't read from the database.

Doesn't any of this software have any kind of logging facilites that would allow me to pinpoint the problem?

EDIT FOLLOW-UP

pop3d: /usr/lib/courier-imap/authlib/authvchkpw: No such file or directory

Why wouldn't that file exist?

----------

## guitard00d

 *guitard00d wrote:*   

> EDIT FOLLOW-UP
> 
> pop3d: /usr/lib/courier-imap/authlib/authvchkpw: No such file or directory
> 
> 

 

Is there any way to force courier-imap to build with authvchkpw included? Obviously something is broken in the ebuild because it's not detecting vpopmail installed on the system. That's the reason I can't authenticate via pop3 or imap on my system. Does anybody know a quick way to fix this or somehow force courier-imap to build this module?

----------

## sabrex

 *guitard00d wrote:*   

>  *guitard00d wrote:*   EDIT FOLLOW-UP
> 
> pop3d: /usr/lib/courier-imap/authlib/authvchkpw: No such file or directory
> 
>  
> ...

 

I'm not sure, but I think you found out the cause of the problem, as I do indeed have that file in that directory.  Other than making sure you have the correct USE flags before compiling, and compiling things in the same order as outlined in the HOWTO, I'm not sure what else to suggest.  Perhaps unmerge (emerge -C) and the emerge all of the packages?

----------

## salk

The other option is to make use of the pop3d daemon that is now included in the qmail ebuild.

I have also got the login error with courier-imap and activated the pop3d from qmail and was sorted out.

I do not make use of IMAP atm ... so its easier for me to do it that way.

----------

## salk

*had enough*

I have got everything up and actually running ... wow  :Smile: 

I moved to qmail-pop3d because courier-imap was not authenticating ... I tried to login and got messages saying $HOME/Maildir did not exist.

I went into the run script for pop3d and changed .maildir to Maildir and it now logs in ... 

I am firstly puzzled at why it logs in with steven and not steven@domain ... since its on a virtual setup.

BUT ... mail is not getting delivered to the Maildir in /var/vpopmail/domains/domain.net/steven/Maildir ... smtpd accepts the mail ... processes the queue ... but where does that mail go ?

The Maildir is a proper maildir created by vpopmail.

I have been through logs and all and cannot find any errors or notices that will have any impact on this.

Does anyone have any idea's ?

----------

## Sh4d0w

Good tutorial, thanks

----------

## guitard00d

 *sabrex wrote:*   

>  *Ritter wrote:*   I cant seem to prove that the clamav is really doing anything, I can send myself all forms of the eicar test virus signature and always get:
> 
> <snip>
> 
> Any help figuring this out would be greatly appreciated. 
> ...

 

I'm noticing the same thing here, it looks like clamav is loading and running, but it's not detecting viruses. I have sent several known viruses to myself from a separate server and they get right through. When I look at the message header, I see this:

Received: from administrator@*****.biz by server1 by uid 201 with qmail-scanner-1.16 

     (clamscan: 0.60. Clear:. 

     Processed in 0.123831 secs); 02 Jan 2004 19:55:25 -0000

Looks like clamav is actually running and processing the messages, it's just not detecting viruses.

----------

## Gatak

EDIT: I found the problem with qmail-pop3d. I am now using courier-pop3d and courier-imapd and both work fine. There is still the question from below:

How do I enable "SMTP AUTH" so mobile users can still send mail out from the server and unknown users (everyone on internet) can still mail into the server?

When I try to do "SMTP AUTH" I get a error in /var/log/messages:

```
vpopmail[4628]: vchkpw: password fail testuser (at) moment22.mine.nu:192.168.0.1
```

This only seem to happen when I use anything but plain-text authentication. The Bat! that I test with tries first with CRAM-MD5 and that seem to fail.

Thanks again for a great guide.

----------

## sabrex

 *Gatak wrote:*   

> How do I enable "SMTP AUTH" so mobile users can still send mail out from the server and unknown users (everyone on internet) can still mail into the server?
> 
> When I try to do "SMTP AUTH" I get a error in /var/log/messages:
> 
> ```
> ...

 

Did you follow step 8?  Activating smtp-auth is outlined in that step.

----------

## Gatak

Yes I followed that step too...

Maybe I misunderstood something because plain-text SMTP AUTH works but not CRAM-MD5.

----------

## sabrex

 *Gatak wrote:*   

> Yes I followed that step too...
> 
> Maybe I misunderstood something because plain-text SMTP AUTH works but not CRAM-MD5.

 

I don't think vpopmail uses CRAM-MD5 for authentication.  It uses something similar, but I'm not sure what it is.  The only thing that (I know of) that can encrypt to and read from the vpopmail database is the vchkpw program ... I don't know how to get vchkpw to accept cram-md5 encrypted passwords.

----------

## Gatak

 *sabrex wrote:*   

> I don't think vpopmail uses CRAM-MD5 for authentication.  It uses something similar, but I'm not sure what it is.  The only thing that (I know of) that can encrypt to and read from the vpopmail database is the vchkpw program ... I don't know how to get vchkpw to accept cram-md5 encrypted passwords.

 

At least the plain text authentication with the clients work. Perhaps it is up to us to ask the developers of vpopmail or vchkpw to implement it?

I read in the docks that there is a checkpassword (cmd5checkpw) included in qmail that does support. This is from the /var/qmail/control/conf-smtpd

```

# This next block is for SMTP-AUTH

# This provides the LOGIN, PLAIN and CRAM-MD5 types

# the 'cmd5checkpw' used in $QMAIL_SMTP_AUTHCHECKPASSWORD supports CRAM-MD5

# and reads it's data from /etc/poppasswd

# see the manpage for cmd5checkpw for details on the passwords

# uncomment the next four lines to enable SMTP-AUTH

#QMAIL_SMTP_AUTHHOST=$(<${QMAIL_CONTROLDIR}/me)

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

#QMAIL_SMTP_CHECKPASSWORD="/bin/cmd5checkpw"

#QMAIL_SMTP_POST="${QMAIL_SMTP_AUTHHOST} ${QMAIL_SMTP_CHECKPASSWORD} ${QMAIL_SMTP_POST}"
```

Problem here is that it is not using vpopmail but /etc/poppasswd instead. Maybe it is possible to create some work around?

----------

## zend

i can't see any code

----------

## sabrex

 *Gatak wrote:*   

> At least the plain text authentication with the clients work. Perhaps it is up to us to ask the developers of vpopmail or vchkpw to implement it?
> 
> I read in the docks that there is a checkpassword (cmd5checkpw) included in qmail that does support. This is from the /var/qmail/control/conf-smtpd
> 
> ```
> ...

 

Qmail itself supports cram-md5, as well as many other encryption methods ... you're right though, it is vpopmail that needs to handle the passwords, as the passwords are stored in the vpopmail mysql tables.  However, those passwords are encrypted somehow.  It looks like they are encrypted with CRAM-MD5, but they are not.  I'm sure a workaround probably exists, but haven't really had the need (yet) to find one.  Perhaps you will, and if you do, please post your results.

----------

## dylanr

I'm also having the problem mentioned upthread with SA and Clam running but producing no results.  All messages have this header:

```
X-Spam-Status:  No, hits=0.0 required=4.0
```

Zero hits regardless of what's scanned, even blatant spam.  The 4.0 score requirement is what I've set in /etc/mail/spamassassin/local.cf.  That suggests to me that SA is running *and* reading the correct config file... it's just not scoring any spam.  SA's local.cf file is set up exactly as the howto suggests and everything else is working just fine.

I'm not using vpopmail as I do smtp auth differently.  If I understand correctly, this means that /etc/conf.d/spamd should be set up thus:

```
SPAMD_OPTS="-a -c -d -u qmailq -C /etc/mail/spamassassin/local.cf"
```

BTW, I get the same score if I redirect a spam message to spamc:

```
# spamc -c < spammy_message

0.0/4.0
```

Am I missing something obvious?

Thanks for a great howto and TIA for any other help offered

----------

## dylanr

 *dylanr wrote:*   

> I'm also having the problem mentioned upthread with SA and Clam running but producing no results.  All messages have this header:
> 
> ```
> X-Spam-Status:  No, hits=0.0 required=4.0
> ```
> ...

 

I figured this out.  For anyone else having this problem, the issue is that SA's rules are installed into /usr/share/spamassassin.  Copy/move them to /etc/mail/spamassassin and all is well.

HTH

----------

## ian!

Moved to 'Documentation, Tips & Tricks'.

----------

## sabrex

 *guitard00d wrote:*   

> 
> 
> Looks like clamav is actually running and processing the messages, it's just not detecting viruses.

 

It appears that you're both correct.  clamav was not functioning, and after fiddling around with it, I could not get it to work.  I instead switched to f-prot which worked immediately.  Follow the updated steps 5 AND 6 again in that order (you must emerge qmail-scanner again for f-prot to work).  You can also get rid of clamav for now until somebody figures out how to get it to work.

For reference, here are the old clamav instructions (step 5) ... REMEMBER, THESE INSTRUCTIONS DO NOT WORK, FOLLOW THE MAIN INSTRUCTIONS ON TOP OF THE THREAD:

5) install clamav and Mail-SpamAssassin. they must be running before installing qmail-scanner.

```
> emerge clamav Mail-SpamAssassin

> nano -w /etc/conf.d/spamd.conf

  SPAMD_OPTS="-d -u vpopmail -v -x -C /etc/mail/spamassassin/local.cf"

> nano -w /etc/conf.d/clamd

  START_CLAMD=yes

> nano -w /etc/clamav.conf

  #Example (comment this line)

  ScanMail (uncomment this line)

> rc-update add spamd default

> rc-update add clamd default

> /etc/init.d/spamd start

> /etc/init.d/clamd start

You'll want to set up a cron.daily job to update the clamav definitions automatically:

> nano -w /etc/cron.daily/virus-update.cron

#!/bin/bash

/usr/bin/freshclam --quiet

> chmod 755 /etc/cron.daily/virus-update.cron

> crontab -e

# min hour day month weekday command

0 1 * * * /etc/cron.daily/virus-update.cron 

Now to set up spam processing rules:

> nano -w /etc/mail/spamassassin/local.cf

required_hits  5.0

rewrite_subject  1

subject_tag  *****SPAM*****

report_safe  1

report_header  1

use_bayes  1

auto_learn  1

skip_rbl_checks  0

use_razor2  1

use_dcc  0

use_pyzor  1

ok_languages  all

ok_locales  all

```

----------

## wetkitty

Thanks sabrex, this works just fine.  I would like to add just a bit of info that took me several days of forum searching and googling to come up with.

I've added a mailfilter setup borrowed and modified from here:

https://forums.gentoo.org/viewtopic.php?t=109599

/var/vpopmail/domains/domain.com/.mailfilter

```
import EXT

import HOST

import HOME

SPAMBOX=".Trash"

VERBOSE=1

logfile "/var/log/maildrop-filter-log"

SHELL="/bin/sh"

VHOME=`/var/vpopmail/bin/vuserinfo -d $EXT@$HOST`

VDOMHOME=`/var/vpopmail/bin/vdominfo -d $HOST`

VPOP=`cat $VDOMHOME/.qmail-default`

#VPOP="$VHOME/Maildir/"

if (/^X-Spam-Status: Yes, hits=*!.* !.*/)

{

        if ( $MATCH2 > 8 )

         {

         to /dev/null

         }

}

if ((/^X-Spam-Status:.*YES/))

{

   `test -d $VHOME/Maildir/.Trash`

   if( $RETURNCODE == 1 )

   {

   `/usr/bin/maildirmake $VHOME/Maildir/.Trash;chown -R vpopmail.vpopmail $VHOME/Maildir/.Trash`

   `echo "INBOX.Trash" >> $VHOME/Maildir/courierimapsubscribed`

   }

   to "$VHOME/Maildir/.Trash/"

}

to "$VHOME/Maildir/"
```

and 

/var/vpopmail/domains/domain.com/user/.qmail

```
| /var/qmail/bin/preline /usr/bin/maildrop /var/vpopmail/domains/domain.com/.mailfilter
```

So, fetchmail pulls from their ISP provided POP3 accounts and runs it through my little server.  Anything scoring above 3 gets moved to the Trash folder, anything scoring above 8 goes away .  All clients run Thunderbird which tags any missed spam and moves it to the Junk folder ( I'm planning to set up a cron job to run sa learn against the Junk folders).  The Trash folder is set to clear 3day and older email away thus keeping it from becoming a runaway and providing a place to check for false positives.

The particular reason I'm sharing this setup is this, Yes this is a very aggressive setup - most of the results I found while searching for this solution said the same thing "Don't delete anything" for the good reason of false positives.  But, my customers want an aggressive setup, they don't know how the internet or messenging works and they don't care, they just want the spam to go away with as little effort as possible.  Their ISP's are unable to (and rightly so) provide that, so I do.

Hopefully this is helpful and I'll add anything I can think off, again hats off to sabrex for the great how to.

ps. Clamav has been working fine and I followed your original instructions

----------

## sabrex

Thank you very much, this mailfilter howto is very useful indeed.  Have you figured out a way to automatically delete stuff from .Trash after it's been there for a while?  A lot of my users are using regular pop3, and not imap, so they never even see the Trash folder.  Would be nice if there was a way to automatically delete old stuff in that folder.

 *wetkitty wrote:*   

> ps. Clamav has been working fine and I followed your original instructions

 

Are you absolutely sure it's working?  I thought it was too, until I tried to send myself a test virus.  Get it from http://www.eicar.org/anti_virus_test_file.htm and then send it to one of your mail accounts.  qmail-scanner should prevent the message from going through, and should send a response to the sender informing them of the infection.  That didn't work with clamav, but works perfectly with f-prot.  Let me know if the test still works with clam, I'd be interested in finding out why it works for you but not for so many others (including me).[/url]

----------

## nianderson

well when i goto http://domain.com/cgi-bin/qmailadmin  i get 

```

file permission error /var/vpopmail/domains/domain.com/postmaster/Maildir/1073714040.qw

```

but when i goto that Maildir and ls i get just cur new and tmp ideas?

[edit]

on a side note i dont have any images on the login page either

----------

## salk

Hi there,

 *Quote:*   

> well when i goto http://domain.com/cgi-bin/qmailadmin i get 
> 
> Code: 
> 
> file permission error /var/vpopmail/domains/domain.com/postmaster/Maildir/1073714040.qw 
> ...

 

I had exactly the same error. All I did was delete the qmailadmin binary from my cgi-bin and re install qmail admin. <-- sorted me out

 *Quote:*   

> [edit] 
> 
> on a side note i dont have any images on the login page either

 

Did you make sure your paths to your htdocsdir are absolutly correct ? You did install qmailadmin as root ?

----------

## destr0yr

 *salk wrote:*   

> Hi there,
> 
> I had exactly the same error. All I did was delete the qmailadmin binary from my cgi-bin and re install qmail admin. <-- sorted me out

 

by reinstall do you mean from the inter7 tar or re-emerged?

i tried emerge -C qmailadmin, followed by emerge /usr/portage/net-mail-qmailadmin/qmailadmin-1.2.0_rc2.ebuild and get that error "file permission error /var/vpopmail/domains/destr0yr.com/postmaster/Maildir/1073718800.qw"

suggestions?

 *Quote:*   

> [edit] 
> 
> on a side note i dont have any images on the login page either

 

Did you make sure your paths to your htdocsdir are absolutly correct ? You did install qmailadmin as root ?[/quote]

He may have virtualhosts setup... in which he'll have to create an Alias in his commonapache2.conf... maybe like so:

```

Alias /qmailadmin /var/www/localhost/htdocs/qmailadmin

```

----------

## nianderson

i am using virtual hosts odly on an old instilation with a similar config it seemed to work out ok. ill alais the qmail dir and report back in a few

[edit]

btw i was not using emerge to install qmailadmin i did it exactly as in the stepbystep

i added an alias line but same results here is my vhost container

<VirtualHost *:80>

ServerName mailadmin.nanderson.com

DocumentRoot /var/www/nanderson.com

<Directory "/var/www/nanderson.com/">

        Options Indexes FollowSymLinks MultiViews ExecCGI Includes

        AddHandler cgi-script .cgi

        DirectoryIndex index.html index.htm index.cgi index.php index.pl

        AllowOverride AuthConfig

        Order allow,deny

        Allow from all

</Directory>

ScriptAlias /cgi-bin/ /var/www/nanderson.com/cgi-bin/

Alias /qmailadmin /var/www/nanderson.com/htdocs/qmailadmin

</VirtualHost>

----------

## destr0yr

anybody got this working with relay-ctrl?

----------

## nianderson

this morning it hit me that i had installed the unstable vpopmail so i unmerged it and merged 5.2.1-r9

replaced /etc/vpopmail.conf and edited it accordingly

now i no longer get the error i was getting ut after adding a domain when i tryt o use qmailadming to loginto it it says invalid login. and i still dont have graphics so i dunno whats goin on now

[edit]

just noticed that vchkpw isnt in my path .... most of the vpopmail bins arnt they are in /var/vpopmail was that supposed to be added to my path and it was just overlooked??

----------

## Diggs

I have problems on login with all and i dont'know why (I followed completely the tutorial).

These are my confs:

/etc/hosts 

```

127.0.0.1         localhost.daemon       localhost

192.168.1.1     gateway.daemon        gateway

192.168.1.2     pc-01.daemon            pc-01

192.168.1.3     pc-02.daemon            pc-02

```

N.B: 192.168.1.1 is eth1 on internal lan, 192.168.1.2 and 192.168.1.3 are are others pc on internal lan

I have dynamic ip and vhost "gentoo.servebeer.com" from www.no-ip.com to the same ip.

I set the value localhost on /var/qmail/control/conf-smtpd = QMAIL_SMTP_POST="localhost /var/vpopmail/bin/vchkpw /bin/true".

I set always value "localhost" for squirrelmail's config.

I added "gentoo.servebeer.com" as virtual domain on vpopmail.

Result: I can't login, any connection is reject both imapd and qmailadmin.

Can someone tell me where i wrong?

Your sincerely,

Leonardo

----------

## nianderson

well irestarted from scratch only to get back to where i was before ... no graphics and says invalid login 

ive got no clue what is wrong anyone have any ideas?

----------

## destr0yr

Hi.  Great howto.. followed it exactly (i think), however, i am having troubles with the .maildir and ./Maildir.  When i create an account with vpopmail, it adds the domain/domain.com/username/.maildir  I know i can run the vpopmail-Maildir-dotmaildir-fix.sh every time i create a new user, however, this is rather annoying... any suggestions?

----------

## wetkitty

 *Quote:*   

> Are you absolutely sure it's working? I thought it was too, until I tried to send myself a test virus. 

 

Yes and no - The first day I set it up I sent a test virus and it worked properly, after you asked I sent  another to double check and it came right on through. I'm running f-prot on the back up server since I borked the main one trying to switch away from clam av  (permission problem I think, when I get a resolution I'll post it too)

 *Quote:*   

> Have you figured out a way to automatically delete stuff from .Trash after it's been there for a while? A lot of my users are using regular pop3, and not imap, so they never even see the Trash folder. Would be nice if there was a way to automatically delete old stuff in that folder. 

 

/etc/courier-imapd/imapd

```
# IMAP_EMPTYTRASH=Trash:7,Sent:30
```

is the default, I changed mine to:

```
IMAP_EMPTYTRASH=Trash:3
```

----------

## nianderson

well it appears i have a problem with vpopmail ... after setting everything up and starting all the services .....

```

/var/vpopmail/bin/vadddomain nanderson.com test

```

then

```

/var/vpopmail/bin/vadddomain nick@nanderson.com test

```

run the fix maildir script just in case

```

/var/vpopmail/bin/vpopmail-Maildir-dotmaildir-fix.sh

```

now check if i can login to my account 

```

telnet localhost 110

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

+OK Hello there.

USER nick@nanderson.com

+OK Password required.

PASS test

-ERR Login failed.

```

any ideas??

----------

## JeffreyCentex

Several Revisions here to help some people out...

First, the new vpopmail ebuilds use the .maildir format...  So in this case, don't change the MAILDIR variable in the courier-imap ebuilds...

However, this breaks the QMAILADMIN ebuild which is hardcoded to use /Maildir...  I patched my QmailAdmin sources to change the references to /.maildir and everything works...

--

Also, if people have a difficult time using authenticated SMTP, make sure you go to the conf-common file and change the following entries:

QMAILDUID=`id -u vpopmail`

NOFILESGID=`id -g vpopmail`

This will allow authenticated SMTP...  (I'm not sure whether this is required or not for those of you using MySQL)...

--

I also have somewhat revised the howto to remove the MySQL integration..  This is proving much more stable on my machine and much easier to configure (VPOPMAIL and Courier did not want to authenticate with MySQL).  If anyone wants to know these steps, post back...

----------

## irasnyd

 *JeffreyCentex wrote:*   

> Several Revisions here to help some people out...
> 
> First, the new vpopmail ebuilds use the .maildir format...  So in this case, don't change the MAILDIR variable in the courier-imap ebuilds...
> 
> However, this breaks the QMAILADMIN ebuild which is hardcoded to use /Maildir...  I patched my QmailAdmin sources to change the references to /.maildir and everything works...
> ...

 

I'd like to know how to patch the qmailadmin ebuild to use .maildir instread of Maildir.  I'd also like to know how to get everything working without mysql, it seems not to be working for me very well.

----------

## JeffreyCentex

I did it the hard way - grabbed a copy of qmailadmin, untarred it, ran grep to find out which files referred to /Maildir and edited them to refer to /.maildir...

I did the same with vqadmin...

I would expect the ebuilds for these will be modified soon to reflect the .maildir since the vpopmail change was recent.

----------

## nianderson

maybe i am missing something but in step 7 if i change authmodule in /etc/courier-imap/pop3d to authvchkpw i can login as postmaster, but vpopmail dosnt appear to make any users with vadduser. all i see in /var/vpopmail/domains/nanderson.com is postmaster

and

```
mail nanderson.com # vadduser nick@nanderson.com

vadduser: error: user 'nick@nanderson.com' already exists.

mail nanderson.com # vuserinfo nick@nanderson.com

no such user nick@nanderson.com

mail nanderson.com #
```

obviously something wrong with vpopmail or my config but i cant figure out what it is

----------

## Diggs

 *JeffreyCentex wrote:*   

> 
> 
> First, the new vpopmail ebuilds use the .maildir format...  So in this case, don't change the MAILDIR variable in the courier-imap ebuilds...
> 
> 

 

 :Wink: 

Sorry I don't understand a point: 

1) In qmail's build i have to set:

```

USE="maildir mysql etc etc..." emerge qmail vpopmail etc etc

```

Then i have to set ".maildir/" in qmail's conf or i leave it as it is? (standard "Maildir")

----------

## nianderson

i believe .maildir is the way qmail is by default as is courier-imap qmailadmin has Maildir hard coded and thats probabbly why you see alot of the changes to .maildir ect.... so

if you dont touch any config files .maildir will be what is used. if you want to use qmailadmin then you will either have to either go through the source and change Maildir to .maildir or change the config files to use Maildir (that includes the new vpopmail ebuild)

if im wrong im sure someone will correct me . :Smile: 

----------

## Diggs

Well   :Wink: 

I'm going to re-start the procedure following last additions for this how-to and fixing for qmailadmin.   :Wink: 

Your Sincerely,

Leonardo Luzzi

----------

## Diggs

YEAH! JeffreyCentex's additional notes are good! IT WORKS!!!

I'm very happy   :Wink: 

I have only to fix qmailadmin   :Crying or Very sad:  - I will wait for it!!!   :Wink: 

----------

## Gatak

There is a patch for vpopmail 5.3.27 at http://www.fehcom.de/qmail/smtpauth.html to allow it to work with CRAM-MD5 and replace the qmail's checkpassword program.

Also, I learned that vpopmail 5.4.0-rc2 will include CRAM-MD5 support.

----------

## JeffreyCentex

Sorry...   I've been away...   :Sad: 

I actually followed the guide on page 1 and supplemented it with some of the instructions at http://www.qmailrocks.com.

If you build Courier IMAP and Vpopmail without MySQL support, it will work with no configuration (it puts a username and password file in the ~vpopmail/domains/mydomainname.com directory).  I don't know if this was causing my problems when trying to use Authenticated SMTP from outside my local LAN, but changing to the vpopmail uid and gid in the qmail control file helped solve it on my end...

Also, if anyone is interested, you can add a domain wide filtering script that will automatically move spam mail to a spam folder as well as run any user maildrop filter scripts...  

From Matt Simerson's toaster page:

 *Quote:*   

> 
> 
> Q: How do I add mail filtering for a domain using maildrop?
> 
> cd ~vpopmail/domains/example.com
> ...

 

Make sure you change your path references (this was written for FreeBSD).  If you want to have any user scripts, put a .mailfilter file in your /.maildir directory.  

I'll post post a copy of my mailfilter script tomorrow if anyone wants it...

Also, FWIW, clamav works OK on my system....

----------

## JeffreyCentex

Actually, here is my filter setup:

/etc/mail/maildrop

```

SHELL="/bin/sh"

import EXT

import HOST

VPOP="| /var/vpopmail/bin/vdelivermail '' bounce-no-mailbox"

VHOME=`/var/vpopmail/bin/vuserinfo -d $EXT@$HOST`

##

#  title:  mailfilter-domain

#  author: Matt Simerson

#  version 2.0

#  http://www.tnpi.biz/internet/mail/toaster/etc/mailfilter-domain

#

#  Usage: Install this file in ~vpopmail/domains/example.com/mailfilter

#

#  Create a .qmail-default file with the following:

#    "| maildrop /etc/mail/maildrop"

#

#  After your satisifed that this is working properly, comment out all

#  the lines that start with "log"

##

#log "====  BEGIN maildrop processing for $EXT@$HOST ==="

if ( $VHOME eq "" )

{

  to "$VPOP"

}

##

# Comment out this section if you run SpamAssassin via qmailscanner

# Spamassassin is slow enough, no point in doubling your expense

#

# Note that if you want to pass a message larger than 250k to spamd

# and have it processed, you'll need to also set spamc -s. See the 

# spamc man page for more details. 

##

if ( $SIZE < 256000 ) # Filter if message is less than 250k

{

        exception {

                xfilter '/usr/bin/spamassassin'

        }

}

##

# Include any rules set up for the user - this gives the 

#   administrator a way to override the domain's mailfilter file

#

#   this is also the "suggested" way to set individual values

#   for maildrop such as quota.

##

`test -r $VHOME/.mailfilter`

if( $RETURNCODE == 0 )

{

        exception {

                include $VHOME/.mailfilter

        }

}

## 

# create the maildirsize file if it doesn't already exist

# (could also be done via "deliverquota user@dom.com 10MS,1000C)

##

`test -e $VHOME/.maildir/.maildirsize`

if( $RETURNCODE == 1)

{

        `/var/vpopmail/bin/vuserinfo -Q $EXT@$HOST`

        `test -s "$VHOME/.maildir/.maildirsize"`

   if ( $RETURNCODE == 0 )

   {

      `/usr/sbin/chown vpopmail:vpopmail $VHOME/.maildir/.maildirsize`

                `/bin/chmod 640 $VHOME/.maildir/.maildirsize`

   }

}

##

# Set MAILDIRQUOTA. If this isn't set, maildrop and deliverquota

# will not enforce quotas for message delivery.

#

# I find this much easier than creating yet another config file

# to store this in. This way, any time the quota is changed in

# vpopmail, it'll get noticed by maildrop immediately.

##

MAILDIRQUOTA=`/usr/bin/head -n1 $VHOME/.maildir/.maildirsize`

##

# The message should be tagged, so let's bag it.

##

if ( /^X-Spam-Status: *Yes/)

{

        `test -d $VHOME/.maildir/.Spam`   # make sure .Spam folder exists

        if( $RETURNCODE == 1 )

        {

                `maildirmake -f Spam $VHOME/.maildir`

        }

        exception {

                xfilter "/usr/bin/deliverquota $VHOME/.maildir/.Spam"

        }

        if( $RETURNCODE == 77)

        {

                 to "|/var/qmail/bin/bouncesaying '$EXT@$HOST is over quota'"

        }

        exit

}

##

# Include any other rules that the user might have from

# sqwebmail or other compatible program

##

`test -r $VHOME/.maildir/.mailfilter`

if( $RETURNCODE == 0 )

{

        exception {

                include $VHOME/.maildir/.mailfilter

        }

}

exception {

        xfilter "/usr/bin/deliverquota $VHOME/.maildir"

}

## 

# check to make sure the message was delivered 

# returncode 77 means that out maildir was overquota - bounce mail

##

if( $RETURNCODE == 77)

{

        to "|/var/qmail/bin/bouncesaying '$EXT@$HOST is over quota'"

}

```

In the domain directory under vpopmail (i.e., ~vpopmail/domains/mydomain.com), create or edit the following file:

.qmail-default

```

| maildrop /etc/mail/maildrop

```

For personal rules, make a file named .mailfilter under your maildir directory (i.e., ~vpopmail/domains/mydomain.com/myusername/.maildir/.mailfilter).

```

SHELL="/bin/sh"

import EXT

import HOST

VPOP="| /var/vpopmail/bin/vdelivermail '' bounce-no-mailbox"

VHOME=`/var/vpopmail/bin/vuserinfo -d $EXT@$HOST`

if ( $VHOME eq "" )

{

  LOG "  ERROR: VHOME isn't set, falling back to vdelivermail"

  LOG "===  EXIT  ===  "

  to "$VPOP"

}

###

#

# Computer Mailing List Forwards

#

###

if ( /alg@austinlug.org/)

{

        xfilter "/usr/bin/deliverquota -c $VHOME/.maildir/.Computer-Mailing-Lists.Austin-LUG"

        exit

}

if ( /alamo.satlug.org/)

{

        xfilter "/usr/bin/deliverquota -c $VHOME/.maildir/.Computer-Mailing-Lists.San-Antonio-LUG"

        exit

}

```

Replace the rules to match your configuration..  

With this setup, you can have Qmail automatically sort the mail into subfolders, setup notifications, etc.

Hope this helps everyone....   :Smile: 

----------

## cristi1979

at step 8 i got this:

>svc -t /var/qmail/supervise/qmail-smtpd/

> ./run: line 1: Configuration: command not found

Anyone knows why?

----------

## salk

svc -t /service/qmail-smtpd /service/qmail-smtpd/log

Try that.

BTW: Read "Life With Qmail"

http://www.lifewithqmail.org/lwq.html <-- required reading

----------

## BlackB1rd

I've followed this howto, but didn't include vpopmail (don't need virtual domain support) and courier-pop3d. I was wondering if there is some way to activate the SpamAssassin with the qmail-pop3d? This is because I had already configured this mail server with qmail as smtp and pop3 server. It would be nice if I can set up the spamfilter for qmail  :Smile: 

----------

## destr0yr

 *BlackB1rd wrote:*   

> I've followed this howto, but didn't include vpopmail (don't need virtual domain support) and courier-pop3d. I was wondering if there is some way to activate the SpamAssassin with the qmail-pop3d? This is because I had already configured this mail server with qmail as smtp and pop3 server. It would be nice if I can set up the spamfilter for qmail 

 

www.lifewithqmail.org

pretty much the same way you would without vpopmail...  do the install or spamassassin (emerge Mail-Spamassassin) and a decent anti virus prog (clamav, fprot) then do qmail-scanner.  make sure you edit the conf-common and the tcp.smtp to set the QMAILQUEUE variable to pass through qmail-scanner-queue.pl.

----------

## BlackB1rd

 *destr0yr wrote:*   

> 
> 
> www.lifewithqmail.org
> 
> pretty much the same way you would without vpopmail...  do the install or spamassassin (emerge Mail-Spamassassin) and a decent anti virus prog (clamav, fprot) then do qmail-scanner.  make sure you edit the conf-common and the tcp.smtp to set the QMAILQUEUE variable to pass through qmail-scanner-queue.pl.

 

Thanks, but I already did take those steps. My question is qmail-pop3d specific, is there some line I've to add in /var/qmail/control/conf-pop3d? The received mail doesn't seem to get trough the scanner, because there's no report in /var/spool/qmailscan/qmail-queue.log and no mail headers are re-written. Though, smtp works fine with this scanner. It's just that tiny pop3 thing  :Wink: 

----------

## Lillstrumpa

When I try to do

```
/var/vpopmail/bin/vadduser user@stupidomain.something.com somepassword
```

 it tells me 

```
vmysql: sql error[3]: Table 'vpopmail.vpopmail' doesn't exist
```

Must have missed something but can anyone please give me a hint?

----------

## destr0yr

 *Lillstrumpa wrote:*   

> Must have missed something but can anyone please give me a hint?

 

set everything in vpopmail.conf ?

```

nano -w /etc/vpopmail.conf

```

make sure you have mysql running and followed step #3 in the howto.

----------

## Kilian

Been trying this for a few days now. SMTP-auth et alle seems to work fine, but whenever I send, the server replies with 'X-Q'. Inspection of my log files gets me this:

 *Quote:*   

> Jan 19 23:39:43 blizzard X-Qmail-Scanner-1.16: [blizzard10745807824263035] Unable to close pipe to /var/qmail/bin/qmail-queue (#4.3.0) -
> 
> Jan 19 23:39:44 blizzard X-Qmail-Scanner-1.16: [blizzard10745807824263035] Unable to queue message (111). (#4.3.0) - Illegal seek

 

Any hints?

----------

## nephros

 *dylanr wrote:*   

> 
> 
> ```
> X-Spam-Status:  No, hits=0.0 required=4.0
> ```
> ...

 

Thanks!

And while we're at it, let's train our bayesian Filter for all users:

This is from the SpamAssassin Wiki

 *Quote:*   

> 
> 
> In local.cf, tell SpamAssassin where to find the Bayesian database files: 
> 
> ```
> ...

 

You can download huge amounts of archived spam from ftp://spamarchive.org/pub/archives/submit

Note that if you're using mbox format (like me), replace --dir with --mbox and point it to an mbox file.

----------

## Kilian

 *Kilian wrote:*   

> Been trying this for a few days now. SMTP-auth et alle seems to work fine, but whenever I send, the server replies with 'X-Q'. Inspection of my log files gets me this:
> 
>  *Quote:*   Jan 19 23:39:43 blizzard X-Qmail-Scanner-1.16: [blizzard10745807824263035] Unable to close pipe to /var/qmail/bin/qmail-queue (#4.3.0) -
> 
> Jan 19 23:39:44 blizzard X-Qmail-Scanner-1.16: [blizzard10745807824263035] Unable to queue message (111). (#4.3.0) - Illegal seek 
> ...

 

Go this fixed now. Turned out my queue directory was entirely missing, for whatever reason. For future reference if anyone has this problem, here's the quick fix (instead of searching for hours):

```
cd /var/qmail

mkdir queue

chmod 777 queue

bin/queue-fix queue
```

----------

## jk0

I am having problems emergine Qmail, heres is whats happening:

```

root@services jkearney # emerge -p qmail

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild  N    ] sys-apps/ucspi-tcp-0.88-r5

[ebuild  N    ] net-mail/queue-fix-1.4-r2

[ebuild  N    ] net-mail/dot-forward-0.71-r1

[ebuild  N    ] net-mail/cmd5checkpw-0.22

[blocks B     ] net-mail/ssmtp ("virtual/mta" from pkg net-mail/qmail-1.03-r13)

[ebuild  N    ] sys-apps/daemontools-0.76-r3

[ebuild  N    ] net-mail/checkpassword-0.90-r1

[ebuild  N    ] net-mail/qmail-1.03-r13

root@services jkearney #

```

So basicly its not letting me emerge qmail... any ideas?

----------

## destr0yr

 *jk0 wrote:*   

> So basicly its not letting me emerge qmail... any ideas?

 

correct me if i'm wrong

try this:

```

emerge -C ssmtp

emerge qmail

```

----------

## jk0

hey it worked! thanks dude

----------

## jk0

Ok now I have another little setback:

```

>>> md5 src_uri ;-) qmail-1.03.tar.gz

>>> md5 src_uri ;-) qmailqueue-patch

>>> md5 src_uri ;-) big-todo.103.patch

>>> md5 src_uri ;-) qmail-link-sync.patch

>>> md5 src_uri ;-) big-concurrency.patch

>>> md5 src_uri ;-) qmail-0.0.0.0.patch

>>> md5 src_uri ;-) sendmail-flagf.patch

>>> md5 src_uri ;-) qmail-1.03-qmtpc.patch

>>> md5 src_uri ;-) qmail-smtpd-relay-reject

>>> md5 src_uri ;-) qmail-local-tabs.patch

!!! File is corrupt or incomplete. (Digests do not match)

>>> our recorded digest: 7553829a93411cdaffce31a29323697f

>>>  your file's digest: 413be7bb5b407c2964c3275c4d596947

!!! File does not exist: /usr/portage/distfiles//qmail-maildir++.patch

root@services jkearney #

```

Any suggestions?

----------

## destr0yr

 *jk0 wrote:*   

> Any suggestions?

 

im new at the whole gentoo thing... maybe do a "emerge sync" first, then try emerge qmail.

you may also want to check /usr/portage/distfiles and delete any qmail-* files or whichever it says is corrupt....

I have a question for ppl... the headers in my emails do not contain "X-Spam-Status:"...  any reason why i'd be missing this?

(edit) -- i managed to get the x-spam-status in.  pebkac on my part.   :Rolling Eyes: Last edited by destr0yr on Wed Jan 21, 2004 6:31 am; edited 1 time in total

----------

## jk0

Yeah I tried re-emerging sync several times and deleting the qmail files and redownloading them. Ive also tried a couple different rsync servers and gentoo mirrors. Is anyone else having this problem?

----------

## jk0

or does anyone know of a way around this?

[UPDATED}

n/m, i just emerged r15 instead of r13

----------

## nephros

 *jk0 wrote:*   

> or does anyone know of a way around this?

 

For future reference:

1. make sure the file in question really is not corrupt, or has been tampered with.

2. ebuild /usr/portage/net-mail/qmail/qmail-1.03-r13.ebuild digest

3. emerge qmail

portage records those digests to make sure the file the user downloads really is the same the developer used when s/he uploaded the ebuild.

Humans are not perfect, and sometimes wrong digest information gets uploaded. That's likely what's happened in this case. The abive commands regenerates these digests with the local distfiles.

Cheers,

   N.

----------

## Kilian

Alright... I've now got sending and receiving working fine, SMTP auth works, everything is going smoothly, *except* that f-prot/spamassassin seem to just be ignoring all email entirely. spamd is running, but never does anything, it doesn't even seem that messages are going to it. Very occassionally, maildrop will quietly tell syslog that it was unable to deliver something, but what or where is never recorded, so I have no idea what's happening with that. I have maildrop and mailfilter setup as per JeffreyCentex's example.

tcp.smtp

```
127.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"

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

----------

## destr0yr

did you copy all of spamassassin's files from /usr/share/spamassassin to /etc/mail/spamassassin ?

i emerged both f-prot and clamav.  

all my emails have something similar to the following in the header:

Received: from apache@gentoo.org by www by uid 201 with qmail-scanner-1.16 

 (. clamscan: 0.60. spamassassin: 2.60.  Clear:SA:0(0.4/5.0):. 

 Processed in 10.971902 secs); 21 Jan 2004 18:43:41 -0000

X-Spam-Status: No, hits=0.4 required=5.0

----------

## jk0

im using vpopmails personal auth db to do the authing instead of mysql. vpopmail seems to be working and creating everything alright. but when i try to login via courier-pop3, i get an auth failed. i tried re-emering it w/o mysql and it still doesnt work.

any ideas?

----------

## Kilian

Ok, here's the current situation:

SpamAssassin is occassionally scanning and marking emails. This appears to be entirely at random, and I can find no reason for it not to scan every message. When it does scan, it often fails to mark as spam e-mails with a score above 5.0, which doesn't make much sense to me either. F-prot does not appear to be functioning at all. I feel like I must be missing a crucial piece of the puzzle somewhere here, but I'm totally unclear where that might be.

----------

## Mindstab

Hmm.  Sligh compilation problem

With queue-fix

I get

```
./compile fmt_str.c

./compile: line 3: exec: -m: invalid option

exec: usage: exec [-cl] [-a name] file [redirection ...]

make: *** [fmt_str.o] Error 2

make: *** Waiting for unfinished jobs....

rm -f trymkffo.o trymkffo

make: *** Waiting for unfinished jobs....

!!! ERROR: net-mail/queue-fix-1.4-r2 failed.

!!! Function src_compile, Line 31, Exitcode 2

!!! (no error message)

```

Both -r1 and r2.  emerge sybc did nothing

Oddly, when I go into the distfiles, tar -xzf it, and make it, it works.  so it seems to be the patch causing problems ? (queue-fix-todo.patch) or the ebuild?

----------

## misplaced

I'm totally new to mail servers but think i've done pretty well so far... I followed the step-by-step by the letter and basically have a functional system but with 1 or 2 problems...

i can send email using squirrelmail or an email client from inside and outside of my network but i can only recieve email by using mutt locally on the server (haven't tried any others locally on the server)... squirrelmail and any client i use let me log in and attempt to recieve new messages but the don't find any.. altho i can browse to the directory and read all of the messages that way...

i intially set everything up exactly the same as the tutorial, then tried changing the mail directory back to the default "Maildir" - the mail is delivered there successfully but only mutt reads from there....

I hope i made some sense - i've been working on this for 3 days and spent 2 and a half on this issue alone so i'm burnt out and will worship whoever can help me out   :Rolling Eyes: 

----------

## radulucian

I've been using this howto for several email servers in all different stages that this howto had. It's a great document and it would be nice if it would be rechecked and updated with all the new stuff in the comments, as it's not obvious for the newbie which comment was good practice and which was not.

Now, correct me if i am wrong, but here are some errors still there in the original post, that might cause problems to some users:

in the howto, step 5

you have: 

 *Quote:*   

> > nano -w /etc/conf.d/spamd.conf 
> 
>   SPAMD_OPTS="-d -u vpopmail -v -x -C /etc/mail/spamassassin/local.cf" 
> 
> 

 

but apparently the corect file is 

```
> nano -w /etc/conf.d/spamd

```

that is: WITHOUT the .conf extension. if u do use the .conf extension it seems to me that you are creating a useless file and spamassassin is rendered useless. am i wrong ?

then some feedback, the .maildir vs Maildir problem which i also encountered.

the best solution is to leave .maildir as it is the default in all the packages except for qmailadmin, and you don't really need qmailadmin. if you do, you can indeed manually patch all files containing references to Maildir. i've done it and it works great, i could post a link to the patched sources but i think that you should consider my offer a security risk and you should do it yourselves. 

then, one thing that's not clear yet:

do /etc/courier-imap/imapd and /etc/courier-imap/pop3d 

need to read: 

```

AUTHMODULES="authvchkpw" 

```

or that is just an alternative or more direct way ??

Here's another question now, before i go check TFM  :Smile: 

How can you enable spamassassin to report verbosely what he did to an email. On another server (redhat i think), when i got spam, i received the spam message AS AN ATTACHEMENT and in the body it said something like this:

 *Quote:*   

> Spam detection software, running on the system "in.inregistrari.ro", has
> 
> identified this incoming email as possible spam.  The original message
> 
> has been attached to this so you can view it (if it isn't spam) or block
> ...

 

I like that kind of reporting. how do i enable it?

And yeah, one more for the road: 

if i don't want f-prot or whatever antivirus to REJECT emails that have executable files attached (even rejects clean ones), but instead notify me somehow about "a possible threat", how can i do that ??

hope to hear more on this soon.

best regards

----------

## nephros

Correction to the HOWTO, ad 6):

The correct location for tcpd config files is /etc/tcprules.d/tcp.qmail-* as this is set in /var/qmail/control/conf-common, at least with the newer qmail ebuilds, so the latter part of section 6) of the HOWTO should read:

```
> nano -w /etc/tcprules.d/tcp.qmail-smtp

<<< edit settings >>>

save tcp.smtp and then: 

> tcprules /etc/tcprules.d/tcp.qmail-smtp.cdb /etc/tcprules.d/.tcp.qmail-smtp.tmp < /etc/tcprules.d/tcp.qmail-smtp

> chmod 644 /etc/tcprules.d/tcp.qmail-smtp*
```

----------

## Kilian

Regular incoming mail seems to be scanned fine now, but I've noticed that any mail coming in via fetchmail/getmail/gotmail/etc. is never sent through the scanner. Not sure why this is the case, as with postfix these messages are scanned. Also, I started having several good messages filtered as spam... but when I try to teach spamassassin from a maildir (whether doing spam or ham) I inevitably get:

Learned from 0 message(s) (2 message(s) examined).

The frustrating part is these are maildirs which I know contain over 50 messages, some of them over 600. Any ideas?

----------

## lpmusix

Hey, thanks for the great tuturial, i'm having a bit of trouble:

```
ginger bin # ./vadddomain home.lp-musix.net

Please enter password for postmaster: 

enter password again: 

vmysql: sql error[c]: MySQL server has gone away

vmysql: sql error[b]: MySQL server has gone away

vmysql: sql error[3]: MySQL server has gone away

could not create limits table CREATE TABLE limits ( domain CHAR(64) PRIMARY KEY,       maxpopaccounts           INT(10) NOT NULL DEFAULT -1,       maxaliases               INT(10) NOT NULL DEFAULT -1,       maxforwards              INT(10) NOT NULL DEFAULT -1,       maxautoresponders        INT(10) NOT NULL DEFAULT -1,       maxmailinglists          INT(10) NOT NULL DEFAULT -1,       diskquota                INT(12) NOT NULL DEFAULT 0,       maxmsgcount              INT(12) NOT NULL DEFAULT 0,       defaultquota             INT(12) NOT NULL DEFAULT 0,       defaultmaxmsgcount       INT(12) NOT NULL DEFAULT 0,       disable_pop              TINYINT(1) NOT NULL DEFAULT 0,       disable_imap             TINYINT(1) NOT NULL DEFAULT 0,       disable_dialup           TINYINT(1) NOT NULL DEFAULT 0,       disable_passwordchanging TINYINT(1) NOT NULL DEFAULT 0,       disable_webmail          TINYINT(1) NOT NULL DEFAULT 0,       disable_relay            TINYINT(1) NOT NULL DEFAULT 0,       disable_smtp             TINYINT(1) NOT NULL DEFAULT 0,       perm_account             TINYINT(2) NOT NULL DEFAULT 0,       perm_alias               TINYINT(2) NOT NULL DEFAULT 0,       perm_forward             TINYINT(2) NOT NULL DEFAULT 0,       perm_autoresponder       TINYINT(2) NOT NULL DEFAULT 0,       perm_maillist            TINYINT(4) NOT NULL DEFAULT 0,       perm_quota               TINYINT(2) NOT NULL DEFAULT 0,       perm_defaultquota        TINYINT(2) NOT NULL DEFAULT 0 )

vmysql: sql error[p]: MySQL server has gone away

Error: (vadduser) can't read domain limits

```

the MySQL user for vpopmail has all the privileges it should need.

----------

## Radi

When i created the user vpopmail for the mysql db, i gave him a specific password.

When i want to login to squirrelmail it fails with login denied.

In Syslog i got following error msg:

```

Jan 28 14:24:34 tora imapd: Connection, ip=[127.0.0.1]

Jan 28 14:24:34 tora imapd: could not connect to mysql update server Access denied for user: 'vpopmail@localhost' (Using password: YES) with database

Jan 28 14:24:34 tora imapd: could not connect to mysql update server Access denied for user: 'vpopmail@localhost' (Using password: YES)

Jan 28 14:24:39 tora imapd: LOGIN FAILED, ip=[127.0.0.1]

Jan 28 14:24:39 tora imapd: DISCONNECTED, ip=[127.0.0.1], headers=0, body=0

```

i think he doesn't recognize the correct password. Can somebody help?

----------

## sabrex

 *radulucian wrote:*   

> I've been using this howto for several email servers in all different stages that this howto had. It's a great document and it would be nice if it would be rechecked and updated with all the new stuff in the comments, as it's not obvious for the newbie which comment was good practice and which was not.

 

Most suggestions have already been incorporated into the howto.

 *Quote:*   

> Now, correct me if i am wrong, but here are some errors still there in the original post, that might cause problems to some users:
> 
> in the howto, step 5
> 
> you have: 
> ...

 

If you look at /etc/init.d/spamd then you'll see that it is refering to /etc/conf.d/spamd.conf ... I had already tried it with /etc/conf.d/spamd and the settings did not take effect until I changed the filename to /etc/conf.d/spamd.conf

 *Quote:*   

> then some feedback, the .maildir vs Maildir problem which i also encountered.
> 
> the best solution is to leave .maildir as it is the default in all the packages except for qmailadmin, and you don't really need qmailadmin. if you do, you can indeed manually patch all files containing references to Maildir. i've done it and it works great, i could post a link to the patched sources but i think that you should consider my offer a security risk and you should do it yourselves. 

 

The issue, for me at least, is that vpopmail automatically creates a folder called Maildir for each user, and not .maildir.  I simply told courierimap to use Maildir instead of .maildir to retrieve mail via the imap and pop3 protocols.  I did not modify anything that tells vpopmail or qmail to place the mail in any particular folder.  If I did do so by mistake, please point out where I set such a setting, because at the moment, vpopmail does put mail in Maildir by default for me.

 *Quote:*   

> then, one thing that's not clear yet:
> 
> do /etc/courier-imap/imapd and /etc/courier-imap/pop3d 
> 
> need to read: 
> ...

 

vchkpw is the only program that can decrypt vpopmail-stored passwords.  I'm not sure what you mean by "an alternative or more direct way."  You could try to use the default settings and see if it works.

 *Quote:*   

> Here's another question now, before i go check TFM 
> 
> How can you enable spamassassin to report verbosely what he did to an email. On another server (redhat i think), when i got spam, i received the spam message AS AN ATTACHEMENT and in the body it said something like this:

 

spam messages are already saved as attachments with this setup, and I believe there is some sort of verbose command that can be set up in the spamassassin config file.  It should be listed in the man pages somewhere.

 *Quote:*   

> And yeah, one more for the road: 
> 
> if i don't want f-prot or whatever antivirus to REJECT emails that have executable files attached (even rejects clean ones), but instead notify me somehow about "a possible threat", how can i do that ??
> 
> hope to hear more on this soon.
> ...

 

No idea on that one.  Sending executables by email is generally not a good idea anyway, so I haven't really tested to see if it catches clean executables as well as virus executables.

----------

## Kilian

Alrighty, I've discovered my error with sa-learn (you need to specify the cur or new etc folder as well, not just the main maildir), and I've also found my problem with maildrop. It seems that the reason maildrop keeps failing to deliver is that aliases are not being checked at all. Any mail to an alias procedes through, unmodified, and qmail then discovers that the maildir does not exist, so it gets dropped after cycling through the queue a few times. Any idea why the aliases would just plain not be processed?

----------

## Diggs

I have this:

```
Requested action aborted: error in processing

Server replied: 451 qq temporary problem (#4.3.0)

```

I can't send o receive mail.

!!!   :Crying or Very sad: 

----------

## tecknojunky

 *jk0 wrote:*   

> I am having problems emergine Qmail, heres is whats happening:
> 
> ```
> 
> root@services jkearney # emerge -p qmail
> ...

 

Maybe you already have a MTA installed?

For myself, I followed somewhat the howto in first post.  I already had qmail + vmailmgr + courrier-imap + squirrelmail + omail-admin all working well.  With MyDoom making it's way thrue the mail server, I tought this was a good time to install a AV scanner.

I was hesitating to install spamassassin since rblsmtpd was doing a super job eleminating spam, but I said "what the heck".

So I followed the steps for razor, f-prot, maildrop, Mail-SpamAssassin and qmail-scanner (and pretty much everything that I did not have).  But now, when I try sending a mail to myself using Evolution, I get an error about DATA.  I can't find anything at all in the qmail logs.

Also, I noticed that I have razor's log into the root (/) of the file system instead of in /var/log.  In fact, I have absolutly no clue what's razor purpose.  No users log on that system, so the instructions at the end of the ebuild are not applying... at least, I don't dig them.

Please shed some lights

----------

## Diggs

Resolved my problem: it's seems there are some problems in qmail-scanner   :Shocked:  .

----------

## tecknojunky

 *proudhomm wrote:*   

> Resolved my problem: it's seems there are some problems in qmail-scanner   .

 

So it seem for me too, except it does qork from localhost only.

As soon as I remove the QMAILQUEUE from tcp.smtp, it works from everywhere.

The strange thing is that, with qmail-scanner-queue.pl in tcp.smtp, nothing is logged when mail is relayed from client's machine.  So it is clear something borks when that script is executed.  But since I get no log...

----------

## tecknojunky

 *tecknojunky wrote:*   

>  *proudhomm wrote:*   Resolved my problem: it's seems there are some problems in qmail-scanner   . 
> 
> So it seem for me too, except it does qork from localhost only.
> 
> As soon as I remove the QMAILQUEUE from tcp.smtp, it works from everywhere.
> ...

 

I resolved the no-delivrery problem by increasing softlimit value in qmail-smtpd supervise script.  It was set to 4000000 and I've increased it to 10000000.  Now mails go thrue the MTA.

I'm left with spam not detected, and virii infectd mail double bouncing (sent to root@mails.inet, bounce to root@localhost.mails.inet when it should bounce to postmaster@mails.inet).

----------

## Diggs

I did as above like you tecknojunky: qmail goes very well now.

I don't understand only why qmail-scanner doesn't go   :Shocked:  but it's not a problem   :Wink:  .

Your Sincerely.

----------

## tecknojunky

There is a test program in qmail-scanner archive.

```
# cd /usr/portage/distfiles

# tar -xzvf qmail-scanner-1.16

# cd qmail-scanner-1.16/contrib

# ./test-installation.pl -doit

You might want to edit the script and go put a manual $RECIP mail recipient in it.

```

This howto maybe good for a wall to wall solution, but it's a pain figuring out the parts only needed for existing setups.  Myself use vmailmgr, so no vpopmail nor qmailadmin, ...

I finaly ended up with the following tcp.smtp:

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

192.168.1.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"

192.168.2.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"

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

Be sure to regenerate the cdb file.

My qmail-smtpd supervise script:

```
#!/bin/sh

export QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"

QMAILDUID=`id -u qmaild`

NOFILESGID=`id -g qmaild`

MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`

if [ -z "$QMAILDUID" -o -z "$NOFILESGID" -o -z "$MAXSMTPD" ]; then

    echo QMAILDUID, NOFILESGID or MAXSMTPD is unset in

    echo /var/qmail/supervise/qmail-smtpd/run

    exit 1

fi

# Now run it all

exec /usr/bin/softlimit -m 10000000 /usr/bin/tcpserver -R -p -v -l 0 -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp /usr/bin/rblsmtpd -r relays.orbd.org -r bl.spamcop.net -r dev.null.dk -r list.dsbl.org -r multihop.dbsl.org -r orbs.dorkslayers.com -r orbz.gst-group.co.uk -r unconfirmed.dbsl.org /var/qmail/bin/qmail-smtpd 2>&1

```

Notice the QMAILQUEUE variable.

As it is always the case with qmail, it's a lot of trial and errors.  Persevere.  f-prot caught the first MyDoom.a lastnight  :Smile:  . So it works.  Now i'm left with that double bounce issue, and spam that are recognised as such in spamassassin logs but are not tagged.

----------

## Diggs

Yes!!!   :Wink: 

My error on tc.smtp was:

```

127.0.0.1:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-queue.pl"

```

instead of:

```

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

```

 :Shocked: 

Now It's going very well   :Wink: 

----------

## Kilian

Ok, I've got almost everything working now. In fact, I've even pinpointed my last (hopefully) problem, but can't come up with a good solution, so I figured I'd ask here. Essentially, what is happening is that when the previously posted maildrop script runs, it passes mail on to virtual users fine, but drops any mail before valias gets to send it on it's way. Is there any good way around this? Even if it involves making thins somehow so that valias email addresses don't get their mail filtered, I'd be ok with that, but the present setup is not doing what it really should be.

----------

## kurtech

I have tried everything, I just can't get this to work   :Sad: 

I have done everything that has been said on this forum, it still doesnæt work. When I try to send a test mail with the qmail tool, it only resolves in this:

```

excelsior contrib # ./test_installation.sh -doit

setting QMAILQUEUE to /var/qmail/bin/qmail-scanner-queue.pl for this test...

setting QMAILQUEUE to /var/qmail/bin/qmail-scanner-queue.pl for this test...

Sending standard test message - no viruses...

X-Qmail-Scanner-1.16:[excelsior107599656842610661] Unable to close pipe to /var/qmail/bin/qmail-queue (#4.3.0) -

X-Qmail-Scanner-1.16:[excelsior107599656842610661] Unable to queue message (111). (#4.3.0) - Ulovlig søkeoperasjon

qmail-inject: fatal: qq temporary problem (#4.3.0)

Bad error. qmail-inject died

excelsior contrib #

```

When I try to send a mail from another mailserver to mine, I get this:

```

... while talking to 195.***.***.***.:

>>> DATA

<<< 451 qq crashed (#4.3.0)

<kurt@mydomain.com>,<postmaster@mydomain.com>... Deferred: 451 qq

crashed 

```

Here is a tail of my log file:

 *Quote:*   

> 
> 
> tail -F /var/spool/qmailscan/qmail-queue.log
> 
> 05/02/2004 17:19:15:19314: run /usr/bin/clamscan -r  --tempdir=/var/spool/qmailscan/excelsior107599795542619314 --disable-summary --unzip --unrar --unace --unarj --zoo --lha --jar --tar --tgz  /var/spool/qmailscan/excelsior107599795542619314 2>&1
> ...

 

Please help! I have tried several times before to get Qmail to work on other Linux distros, but never got it to work. I'am so close now, I can log on to my pop account and my imap, I just can't send e-mail to my server.

Thanks for the great tutorial btw, I have learned a lot and I hope I will get this to work soon   :Shocked: 

I finally got it right!

I had to do two things, to fix the problem above I had to download qmail-qfilter-1.5 and set it up. After this I got another problem, something about the queue, to solve this I had to download the queue-fix and un it.

# emerge queue-fix

# mkdir /var/qmail/queue

# queue-fix -i -N /var/qmail/queue/

I love this!   :Very Happy: 

----------

## damned

Hi there, thanx for this guide. 

I have one simple question: How i can validate account name while qmail accepting mailmessage via smtp? All messages to non-existent-username@mydomain.com dropping directly to postmaster@mydomain.com, how i can disable it?

Sorry for my english x)

----------

## SuDZ

I followed the guide but have a problem. When I try going to

http://sudz.org/squirrelmail/

I get this error:

Not Found

The requested URL /cgi-bin/php/squirrelmail/index.php was not found on this server.

Apache/2.0.48 (Gentoo/Linux) PHP/4.3.4 Server at sudz.org Port 80

But the /cgi-bin/php directory does not exist.  If I tried to make it and copy in index.php from  /var/www/localhost/htdocs/squirrelmail/ 

Then I get this error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/2.0.48 (Gentoo/Linux) PHP/4.3.4 Server at sudz.org Port 80

Any Ideas?

SuDZ

----------

## SuDZ

bump  :Smile: 

SuDZ

----------

## quelx

Does anyone have a solution to the Maildir .maildir creation problem. I tried to change the defaultdelivery file to read.

```
# nano -w /var/qmail/control/defaultdelivery

# Uncomment the next line for .forward support

#|dot-forward .forward

./Maildir/

# mkdir /var/qmail/alias/Maildir

# ln -s var/qmail/alias/Maildir/Maildir /var/qmail/alias/Maildir/
```

then 

```
> /etc/init.d/svscan restart

# vdeldomain my.domain.com

# vadddomain my.domain.com
```

to reset the postmasters mailbox to use Maildir instead of .maildir

When logging into qmailadmin I was getting the following error

```
file permission error /var/vpopmail/domains/my.domain.com/postmaster/Maildir/1076795124.qw
```

Well, it would seem vpopmail qmail or something still insists on creating ./.maildir/ insead of ./Maildir/

So now I ask for help.  Where are the settings that define the creation of new user maildir's?

BTW when I do a 

```
# mv -f /var/vpopmail/domains/my.domain.com/postmaster/.maildir /var/vpopmail/domains/my.domain.com/postmaster/Maildir
```

I am at least able to login to qmailadmin, and that's a start.

I double checked the step in the instructions

```
> nano -w /etc/courier-imap/imapd

  IMAPDSTART=YES

  MAILDIR=Maildir

> nano -w /etc/courier-imap/pop3d

  POP3DSTART=YES

  MAILDIR=Maildir 
```

if that even matters in this case...

Oh and thanks for the great instructions!

__edit__

Ok, so I blew away everything and started over.  Still I was having '.maildir' folders created instead of 'Maildir' I guess I can live with this as everything else seems to be working fine.  Well except that courier seems to like all folders to be subfolders of INBOX rather than at the same level, but that I can live with too.  Now to get horde/IMP to work on top of all of this...

----------

## lpmusix

 *sabrex wrote:*   

> 
> 
> 7) install courier-imap as imap and pop3 server
> 
> ```
> ...

 

This was a major pain, until i figured it out, of course  :Smile: .  I hope this fixes anyone else's problems with authentication not working, for an unknown reason

----------

## merlin_nl

I had some minor hickups, but it works like a charm now  :Smile: 

thx for your good howto  :Smile: 

----------

## cartpullerjack

How do I do this?

```

First log into mysql as your mysql root user and pass. Then:

> create database vpopmail;

> use mysql;

> grant select, insert, update, delete, create, drop on vpopmail.* to vpopmail@localhost identified by 'your password';

> flush privileges;

```

----------

## lpmusix

 *cartpullerjack wrote:*   

> How do I do this?
> 
> ```
> 
> First log into mysql as your mysql root user and pass. Then:
> ...

 

```
mysql -u root -p
```

then after your logged in, just type what he told you to  :Smile: [/code]

----------

## lpmusix

 *quelx wrote:*   

> 
> 
> Well, it would seem vpopmail qmail or something still insists on creating ./.maildir/ insead of ./Maildir/
> 
> So now I ask for help.  Where are the settings that define the creation of new user maildir's?
> ...

 

I changed my courier-imap config to use .maildir, and that was the only place I changed that, and then, I edited the qmailadmin source, and am still in the process of making the patch, once i have it, i'll post it up  :Smile: 

----------

## cartpullerjack

 *lpmusix wrote:*   

>  *cartpullerjack wrote:*   How do I do this?
> 
> ```
> 
> First log into mysql as your mysql root user and pass. Then:
> ...

 

i get:

```
Enter password:

ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

```

----------

## quelx

 *lpmusix wrote:*   

> I changed my courier-imap config to use .maildir, and that was the only place I changed that, and then, I edited the qmailadmin source, and am still in the process of making the patch, once i have it, i'll post it up 

 

That would be very cool, it just seems as though the consistency between what expects /Maildir and /.maildir is mucking my installation up.  Funny, qmailadmin is coded by the same people who develop Courier is it not?  Maybe I am just running into version conflicts.

----------

## lpmusix

i can't seem to get the patch to come out right.  But it's not a huge deal to change it by hand. Might take 5-10 minutes.  I'll keep trying to get the patch, if you want

----------

## lpmusix

 *cartpullerjack wrote:*   

> 
> 
> i get:
> 
> ```
> ...

 

Stupid question, but are you sure mysql is running?  If it is, try restarting it, maybe?

----------

## quelx

 *lpmusix wrote:*   

> i can't seem to get the patch to come out right.  But it's not a huge deal to change it by hand. Might take 5-10 minutes.  I'll keep trying to get the patch, if you want

 

If you'd like..  I've given up on trying the gentoo ebuilds for installing these...  I'm gonna start from the sources see if I can get it working together that way.

----------

## kawa

First, thanks for that great howto! There's a problem... the relay is open after default instalation:

```

1) telnet mail.server.com 25

2) helo

3) mail from: userthatnotexits@microsoft.com

4) rcpt to: myrealuser@mydomail.com

5) data

6) print some text here

7) .

8) quit

```

Lets' enable SMTP-AUTH: edit /var/qmail/control/conf-smtpd

```

# This next block is for SMTP-AUTH

# This provides the LOGIN, PLAIN and CRAM-MD5 types

# the 'cmd5checkpw' used in $QMAIL_SMTP_AUTHCHECKPASSWORD supports CRAM-MD5

# and reads it's data from /etc/poppasswd

# see the manpage for cmd5checkpw for details on the passwords

# uncomment the next four lines to enable SMTP-AUTH

# Alex

QMAIL_SMTP_AUTHHOST=$(<${QMAIL_CONTROLDIR}/me)

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

QMAIL_SMTP_CHECKPASSWORD="/bin/cmd5checkpw"

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

```

----------

## janpk

Followed this great how-to to the letter and got all kinds of crap at first. Ended up unemerging everything plus rm'ing alot of other things that was left after the unemerge process. Then I did an emerge -u system and an emerge -u world, before starting the process of following the how-to. And it works , ehrm, almost everything. Had to 

```
sed -i 's|Maildir|.maildir|g' *.c
```

on qmailadmin src before doing the make for that one to work.

Now I got a working email server running and three domains defined. All three domains have their own virtual host definitions in apache2. 

Question 1:

How do I set up qmail to send system event email to a certain email account ? Maybe it's doing it already , but I cant figure it out.

Question 2: 

Is there some webmail software out there where a user can administer spam rules, forwards, mailinglists etc. without having to use different apps on different url's ?

----------

## Stalione

On step 8 I am getting the following error:

 *Quote:*   

> 
> 
> mirage root # svc -t /var/qmail/supervise/qmail-smtp
> 
> svc: warning: unable to chdir to /var/qmail/supervise/qmail-smtp: file does not exist
> ...

 

I can verify this exists:

 *Quote:*   

> 
> 
> mirage qmail-smtpd # ls -la
> 
> total 6
> ...

 

Am i missing something?

----------

## lpmusix

try checking the command you ran, and the output of pwd  :Smile:   I think you missed one letter  :Smile: 

----------

## Stalione

 *Quote:*   

> 
> 
> mirage root # svc -t /var/qmail/supervise/qmail-smtpd 
> 
> svc: warning: unable to control /var/qmail/supervise/qmail-smtpd: supervise not running
> ...

 

No i did it right...i must have made a mistake when copying and posting to the forum  :Sad: 

----------

## m3ph

I get this error:

@40000000403d76d22ee52a44 tcpserver: pid 12697 from 194.126.101.94

@40000000403d76d22f1667bc tcpserver: ok 12697 www.ekfl.ee:194.204.10.162:25 mail.hot.ee:194.126.101.94::54694

@40000000403d76d234b2baf4 X-Qmail-Scanner-1.16:[hs.electrumtrading.ee107776992842612698] hs.electrumtrading.ee107776992842612698 exits - try again later...

@40000000403d76d234f0b23c tcpserver: end 12697 status 0

@40000000403d76d234f0c5c4 tcpserver: status: 0/40

Can't figure out what's causing this... this error happens when mail comes from inet to the mailserver...

----------

## blubbi

Okay, I read thru all posts.

BUT ... nearly nothing works.

All programms ar running. No errors.

```
qmail-inject root << EOF

test root e-mail!

EOF
```

works fine.

I can read all mails thrue SquirrelMail and through any mailclient via pop. But I can't send mails. SquirrelMail just reports "Server replied: -ER ". Thats all.

This is all in /var/log/mail.err

```
Feb 26 16:42:42 ws1-iut pop3d: DISCONNECTED, user=XXX@XXX.de, ip=[XXX.XXX.XXX.XXX], top=0, retr=0
```

when I try to send a message with SquirrelMail.

Played around with the option in SquirrelMail Configuration but no success.

```
The Mailclient echo's following error:

Recipient error [553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)]
```

and "tail -f /var/log/qmail/qmail-smtpd/current" is as follows:

```
@40000000403e2135315aa6b4 tcpserver: status: 1/40

@40000000403e2135315d812c tcpserver: pid 6978 from 141.48.106.96

@40000000403e2135315e9684 tcpserver: ok 6978 0-p:141.48.106.85:25 :141.48.106.96::1600

@40000000403e213608ef2d94 tcpserver: end 6978 status 0

@40000000403e213608ef9edc tcpserver: status: 0/40
```

Can anyone help me ??

my /etc/tcprules.d/tcp.qmail-smtp looks like this:

```
# Qmail-Scanner disabled for mail from 127.0.0.1

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

# Qmail-Scanner enabled (virus only) for mail from local network

141.48.106.85.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-

141.48.106.93.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-

141.48.106.103.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner

# Qmail-Scanner enabled (virus and spam) for mail from external internet

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

my /etc/tcp.smtp looks like this:

```
# Qmail-Scanner disabled for mail from 127.0.0.1

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

# Qmail-Scanner enabled (virus only) for mail from local network

141.48.106.85.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-

141.48.106.93.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-

141.48.106.103.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner

# Qmail-Scanner enabled (virus and spam) for mail from external internet

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

If I tell my mailclient to use any AUTH mechanism the mailclient echoes the following:

```
Internal error [530 Must issue a STARTTLS command first (#5.7.0)]
```

tail -f /var/log/qmail/qmail-smtpd/current echoes the same with either LOGIN or no auth methode.

Any suggestions are wellcome

THX in advance.

Cu

blubbi

----------

## morlix

 *Quote:*   

> 
> 
> ```
>  
> 
> ...

 

are your domains listened in /var/qmail/control/rcpthosts ?

 *Quote:*   

> my /etc/tcprules.d/tcp.qmail-smtp looks like this: 
> 
> ```
>  
> 
> ...

 

should look like this!

```
 

# Qmail-Scanner disabled for mail from 127.0.0.1 

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

# Qmail-Scanner enabled (virus only) for mail from local network 

141.48.106.85.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner" 

141.48.106.93.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner" 

141.48.106.103.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner" 

# Qmail-Scanner enabled (virus and spam) for mail from external internet 

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

 *Quote:*   

> my /etc/tcp.smtp looks like this:
> 
> ```
>  
> 
> ...

 

should look like this!

```
 

# Qmail-Scanner disabled for mail from 127.0.0.1 

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

# Qmail-Scanner enabled (virus only) for mail from local network 

141.48.106.85.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner" 

141.48.106.93.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner" 

141.48.106.103.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner" 

# Qmail-Scanner enabled (virus and spam) for mail from external internet 

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

i hope i could help...

grZ morlix

----------

## outspoken

is there a reason for using the version specified in the HOWTO?

```
> wget http://www.inter7.com/devel/autorespond-2.0.2.tar.gz 

> tar -zxvf autorespond-2.0.2.tar.gz 

> cd autorespond-2.0.2 

> make 

> make install 

> wget http://www.inter7.com/qmailadmin/qmailadmin-1.0.6.tar.gz 

> tar -zxvf qmailadmin-1.0.6.tar.gz 
```

autoresponder is up to 2.0.5 now and qmailadmin is at 1.2.1

----------

## blubbi

 *morlix wrote:*   

>  *Quote:*   
> 
> ```
>  
> 
> ...

 

Thx for the try but nothing helped...

I can receive mail send from cron or from any local service. But no client in my network is able to send mails. Every time this error:

```
 

The Mailclient echo's following error: 

Recipient error [553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)] 
```

This is my /var/qmail/control/rcpthosts

```
ws1-iut.medizin.uni-halle.de

pc6-iut.medizin.uni-halle.de

pc2-iut.medizin.uni-halle.de

141.48.106.96

```

for testing I added pc2 (141.48.106.96) to the recipient list. But it doesn't help. Same logentry as bevore:

```
@40000000403f30b72641f00c tcpserver: status: 1/40

@40000000403f30b72644becc tcpserver: pid 8627 from 141.48.106.96

@40000000403f30b72645e3c4 tcpserver: ok 8627 0-p:141.48.106.85:25 :141.48.106.96::1303

@40000000403f30b7343ce2fc tcpserver: end 8627 status 0

@40000000403f30b7343cf29c tcpserver: status: 0/40
```

!!! I am going nuts !!!

Everyting seems to work except sending mails.

----------

## blubbi

Okay, I figured out the error ....

now the mailclient echoes another one.

```
Temporary server error [451 unable to exec qq (#4.3.0)]
```

Don't know what's wrong with qmailqueue. Everything is executabel ...

AAAARG

THX for any ideas

----------

## nephros

 *blubbi wrote:*   

> 
> 
> ```
> Temporary server error [451 unable to exec qq (#4.3.0)]
> ```
> ...

 

Had this too. Check that the tcprules have QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue" (no .pl !)

Also check permissions and ownership in /var/spool/qmailscan. Files there should be owned by qscand and writable by that user.

HTH

----------

## outspoken

ok since i didnt get a reply in time i went ahead and tried installing with the latest versions of autorespond and qmailadmin (2.0.5 and 1.2.1 respectively).. looks like there was an issue when i tried to isntall as qmailadmin 1.0.26 and above need the vlimits.h file placed in the includes directory. so i downloaded vpopmail 5.4.2 and unpacked it copying the vlimits.h file to ~vpopmail/includes. well that was probably a mistake since the version is much different than the vpopmail that is installed on my system. Even after doing an emerge sync i only get up to version 5.2.1-r1 which is not available for download from the project's homepage on sourceforge. here is the error info i get when doing a make install on qmailadmin:

```
gcc  -g -O2   -o qmailadmin  qmailadmin.o alias.o autorespond.o forwa

rd.o mailinglist.o user.o util.o auth.o template.o command.o show.o c

gi.o limits.o dotqmail.o -L/var/vpopmail/lib -lvpopmail -L/usr/lib/my

sql -lmysqlclient -lz -lshadow -lcrypt

user.o(.text+0xac5): In function `show_user_lines':

/installs/qmailadmin-1.2.1/user.c:171: undefined reference to `readus

erquota'

template.o(.text+0xe71): In function `send_template_now':

/installs/qmailadmin-1.2.1/template.c:525: undefined reference to `re

aduserquota'

limits.o(.text+0x17): In function `load_limits':

/installs/qmailadmin-1.2.1/limits.c:38: undefined reference to `vget_

limits'

dotqmail.o(.text+0x7d): In function `dotqmail_del_line':

/installs/qmailadmin-1.2.1/dotqmail.c:42: undefined reference to `val

ias_remove'

collect2: ld returned 1 exit status

make[1]: *** [qmailadmin] Error 1

make[1]: Leaving directory `/installs/qmailadmin-1.2.1'

make: *** [all] Error 2

```

this may all be related to not having the latest version of vpopmail installed. would it be a wise thing to compile the latest version doing make/make install?

please give some guidance on this one, big thanks!

i followed the LWQ to get qmail up and was using qmail-pop3d until i used this HOWTO incase anyone is wondering. I have had everything install fine up to this point which is point #9 'Install qmailadmin'

----------

## blubbi

I installed the lates version available in portage:

```
ACCEPT_KEYWORDS="~x86" emerge -p qmailadmin vpopmail

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] net-mail/qmailadmin-1.2.0_rc2-r1  

[ebuild   R   ] net-mail/vpopmail-5.4.0_rc1  

```

Installation worked fine, everything compiled fine.

May be your cflags are to agressive

I used this set:

```
CFLAGS="-march=pentium3 -mcpu=pentium4 -O2 -pipe -mmmx -msse -msse2 -mfpmath=sse -fomit-frame-pointer"
```

----------

## outspoken

I followed the safe flags for my system from this site:

http://www.freehackers.org/gentoo/gccflags/flag_gcc3.html

which is:

```

CHOST="i686-pc-linux-gnu"

CFLAGS="-march=pentium2 -O3 -pipe -fomit-frame-pointer"

CXXFLAGS="-march=pentium2 -O3 -pipe -fomit-frame-pointer"

```

and i've never had compile issues. i see you used a newer vpopmail, so i think that is where my problem is. why does my emerge show the older version after i have done an emerge sync today? 

```
Calculating dependencies ...done!

[ebuild   R   ] net-mail/vpopmail-5.2.1-r9  -clearpasswd -ipalias +mysql  0 kB

```

also i get this error when trying to emerge qmailadmin:

```
Calculating dependencies

!!! all ebuilds that could satisfy "qmailadmin" have been masked.

!!! possible candidates are:

- net-mail/qmailadmin-1.2.0_rc1 (masked by: ~keyword)

- net-mail/qmailadmin-1.2.0_rc2-r1 (masked by: ~keyword)

- net-mail/qmailadmin-1.2.0_rc2 (masked by: ~keyword)

!!! Error calculating dependencies. Please correct.

```

nm, i added the 'ACCEPT_KEYWORDS="~x86"' and it now shows them

thanks!

----------

## blubbi

 *nephros wrote:*   

>  *blubbi wrote:*   
> 
> ```
> Temporary server error [451 unable to exec qq (#4.3.0)]
> ```
> ...

 

I'll give it a try ... but I dont think that this is the problem .... (I am not abel to test it over the weekend with a Mailclient) But SquirrelMail (1.4.2) echoes still following error:

```
ERROR:    

Server replied: -ER

```

(The error code is not shown completly ..... dont know why)

Any suggestions ??

----------

## outspoken

ok ive updated lots of packages since my initial isntall of qmail. i had qmail working with qmailpop3d, now with this setup my pop3 is not working. also the qmailadmin dir in my http documents folder only contains an /images directory with .png's in it, where are the guts of this qmailadmin suite?

/etc/vpopmail.conf:

```

# Copyright 1999-2002 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License, v2 or later

# Author Nicholas Jones <carpaski@gentoo.org>

# Spaces and tabs are fine. Just don't use them

# In the password or usernames

MYSQL_UPDATE_SERVER     localhost

MYSQL_UPDATE_USER       vpopmail

MYSQL_UPDATE_PASSWD     secret

MYSQL_READ_SERVER       localhost

MYSQL_READ_USER         vpopmail

MYSQL_READ_PASSWD       secret

```

this user/pass does not exist, should it be created?

/var/qmail/control/conf-common

```

# Common Configuration file for all qmail daemons

# $Header: /home/cvsroot/gentoo-x86/net-mail/qmail/files/1.03-r13/conf-common,v 1.1 2003/10/27 09:42:54 robbat2 Exp $

# Qmail User IDS to run daemons as

QMAILDUID=`id -u qmaild`

NOFILESGID=`id -g qmaild`

# Qmail Control Dir (this is actually set in /etc/env.d/99qmail)

#QMAIL_CONTROLDIR=/var/qmail/control

# Host and port to listen on

# We listen on the IPv4 local ip by default

TCPSERVER_HOST=my.mailserver.com

TCPSERVER_PORT=${SERVICE}

# you do not need to specify -x, -c, -u or -g in this variable as those are

# added later

#TCPSERVER_OPTS="-p -v"

TCPSERVER_OPTS="-H -R -l 0"

# we limit data and stack segments to 8mbytes, you may need to raise this if

# you are using a filter in QMAILQUEUE

SOFTLIMIT_OPTS="-m 8000000"

# We don't have anything to set QMAILQUEUE to at the moment, so we leave it alone

QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"

# tcpserver maximum concurrency, defaults to 40 in tcpserver

# this controls the maximum number of incoming connections that it will accept

[ -e ${QMAIL_CONTROLDIR}/concurrencyincoming ] && MAXCONN=$(<${QMAIL_CONTROLDIR}/concurrencyincoming) || MAXCONN=40

```

/var/qmail/control/defaultdelivery

```

# Uncomment the next line for .forward support

#|dot-forward .forward

./.maildir/

```

this is the text from 'ps aux | grep pop | grep -v grep':

```

qmaild    3241  0.0  0.6  2768  776 ?        S    11:45   0:00 /usr/bin/tcpserver -H -R -l 0 -R -x /etc/tcp.smtp.cdb -c 20 -u 201 -g 200 my.mailserver.com smtp /var/qmail/bin/qmail-smtpd my.mailserver.com /var/vpopmail/bin/vchkpw /bin/true

root      3405  0.0  0.7  4016  992 ?        S    11:45   0:00 /usr/lib/courier-imap/couriertcpd -address=0 -stderrlogger=/usr/lib/courier-imap/courierlogger -stderrloggername=pop3d -maxprocs=40 -maxperip=4 -pid=/var/run/pop3d.pid -nodnslookup -noidentlookup 110 /usr/sbin/pop3login /usr/lib/courier-imap/authlib/authdaemon /usr/sbin/courier-pop3d Maildir

root      3423  0.0  0.6  3408  872 ?        S    11:46   0:00 /usr/lib/courier-imap/courierlogger pop3d

```

if anything else is needed let me know.. i cant seem to find the proper log files for vpop.

also i ran across a forum post that said to do this:

```

Run qmail as the vpopmail user and group. See the /var/qmail/control/conf-common. Near the top. 

Second, chmod 4750 on /var/vpopmail/vchkpw. 

```

but that didnt change things at all.

----------

## aahz

During the merge of f-prot and SpamAssasin, I get a failure on compilcation of one of the dependencys.

```
robot/ua-get..........HTTP Server terminated

robot/ua-get..........FAILED tests 1-3, 5, 7

        Failed 5/8 tests, 37.50% okay

robot/ua..............HTTP Server terminated

robot/ua..............FAILED tests 1-3, 5, 7

        Failed 5/7 tests, 28.57% okay

local/autoload-get....ok

local/autoload........ok

local/get.............ok

local/http-get........HTTP Server terminated

local/http-get........NOK 7Can't call method "is_redirect" on an undefined value at local/http-get.t line 216, <DAEMON> line 1.

local/http-get........dubious

        Test returned status 115 (wstat 29440, 0x7300)

DIED. FAILED tests 1-19

        Failed 19/19 tests, 0.00% okay

local/http............HTTP Server terminated

local/http............NOK 7Can't call method "is_redirect" on an undefined value at local/http.t line 189, <DAEMON> line 1.

local/http............dubious

        Test returned status 115 (wstat 29440, 0x7300)

DIED. FAILED tests 1-18

        Failed 18/18 tests, 0.00% okay

local/protosub........ok

Failed Test      Stat Wstat Total Fail  Failed  List of Failed

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

local/http-get.t  115 29440    19   30 157.89%  1-19

local/http.t      115 29440    18   28 155.56%  1-18

robot/ua-get.t                  8    5  62.50%  1-3 5 7

robot/ua.t                      7    5  71.43%  1-3 5 7

Failed 4/28 test scripts, 85.71% okay. 47/388 subtests failed, 87.89% okay.

make: *** [test] Error 255

!!! ERROR: dev-perl/libwww-perl-5.76 failed.

!!! Function src_compile, Line 25, Exitcode 2

!!! (no error message)

```

Can anyone help me here, the error message is pretty cryptic and I don't know what it's saying.

----------

## outspoken

not sure why that error message is coming up but i do know that is not the latest libwww-perl, here is my updated emerge -pv libwww-perl output:

```

[ebuild   R   ] dev-perl/libwww-perl-5.69-r2  +ssl  0 kB

```

do 'emerge sync' to get the latest updates on your system and then try again.

----------

## aahz

I updated, it's still version 5.76 which is greater than the 5.69 listed in your code list. Have you updated your portage?

I really can't figure out whats wrong, whether it's that I need to re-emerge perl or the stuff it's installing is corupt. I can't tell from the error message what's wrong other than some HTTP tests are failing and it's not related to apache so it must be contained in the ebuild itself. 

Anyone else have any ideas?

----------

## outspoken

haha.. thats funny, i was reading it backwards. oops!

long day today for me.

----------

## ARC2300

okay. . .I set everything up, yet something's quirky with the vadddomain.

```
Failure while attempting to remove_line() the locals file

Error. Failed to add domain to assign file

Error: Could not update file

```

That's what I get when trying to put in my domain.

When I try to remove the domain, this is what happens:

```
Warning: Could not access (/var/vpopmail/domains/cruea.net)

Warning: Failed while attempting to delete domain from auth backend

Warning: Failed to delete directory tree: cruea.net

```

Hmmm. . .can't delete from teh auth backend (mysql).  Hmmm.

I've granted all permissions in mysql to vpopmail for vpopmail, too.

Did I miss a step somewhere?  I got pulled away from the install several times, so it's possible something got screwed up somewhere.

----------

## SpoKKe

Hi

I have a little problem with qmailadmin, i've read and applyed all the points of the "HOWTO", the installation it's correct and the server work fine, but when i compile qmailadmin, it install a cgi without extension (.cgi) and the browser don't look at it how a cgi....netscape or konqueror open a page full of strange caracters....

If i try to rename qmailadmin to qmailadmin.cgi it work, but at the first operation (login) apache prompt "file not found qmailadmin.cgi"....

Where I make mistake?

Tnks Spokke

P.S.

I hope my English it's readable

----------

## blubbi

Jeeeha

Everything works fine except SMTP-AUTH.......

But this has time.

I am working on that problem. If I solved the AUTH problem I will post it here.

----------

## blubbi

 *SpoKKe wrote:*   

> Hi
> 
> I have a little problem with qmailadmin, i've read and applyed all the points of the "HOWTO", the installation it's correct and the server work fine, but when i compile qmailadmin, it install a cgi without extension (.cgi) and the browser don't look at it how a cgi....netscape or konqueror open a page full of strange caracters....
> 
> If i try to rename qmailadmin to qmailadmin.cgi it work, but at the first operation (login) apache prompt "file not found qmailadmin.cgi"....
> ...

 

Dont know where the mistake is. But the missing .cgi is not the problem.

```
-rwsr-sr-x    1 vpopmail vchkpw     214400 Dec 16 14:02 qmailadmin
```

But do the following (it ommits also the .maildir Maildir problem)

```

rm -rf /dir/to/your/cgi-bin/qmailadmin

emerge -C qmailadmin

emerge /usr/portage/net-mail/qmailadmin/qmailadmin-1.2.0_rc2-r1.ebuild

point your browser to

http://yourhost/cgi-bin/qmailadmin

Thats all folks

```

Be shure to create a domain with vadddomain bevor logging in  :Smile: 

hope I could help

----------

## xmehx

Hi everyone.

I followed the instructions on the first page and ran into a crapload of problems, but got most of them fixed with the following pages.  However, there is one error I can not solve:

```

@400000004045257436de804c starting delivery 32: msg 378145 to local mehownzu@*********

@400000004045257436de9ba4 status: local 1/10 remote 0/20

@4000000040452574373f843c delivery 32: deferral: Unable_to_chdir_to_maildir._(#4.2.1)/

@4000000040452574373f9bac status: local 0/10 remote 0/20

or 

@40000000404527113414060c info msg 415515: bytes 1909 from <apache@gentoo.org> qp 4430 uid 204

@4000000040452711368af97c starting delivery 35: msg 415515 to local mehownzu@********

@4000000040452711368b10ec status: local 1/10 remote 0/20

@40000000404527120c0fc6b4 delivery 35: deferral: Unable_to_chdir_to_maildir._(#4.2.1)/

@40000000404527120c126694 status: local 0/10 remote 0/20

```

Whenever I attempt to send an email inbound to my server, I get an error such as this one.  I am able to send emails with this server, and I am able to log in -- I just cant recieve any emails.  Does anyone have any input? Thanks in advance  :Smile: 

----------

## blubbi

 *xmehx wrote:*   

> Hi everyone.
> 
> ```
> 
> @40000000404527113414060c info msg 415515: bytes 1909 from <apache@gentoo.org> qp 4430 uid 204
> ...

 

READ the Thread complete

Install the latest version of vpopmail, qmail, qmailadmin.

Or edit the qmailbuild to use ./Maildir instead of ./.maildir/

in /var/qmail/control/defaultdelivery.

Have a look in /var/vpopmail/domains/yourdomain/ and you'll see all users have a Maildir and not a .maildir.

I recommand to install the latest versions.

----------

## blubbi

Jeeeha

Server is now running stabel.

Still 2 things to do

1.) SMTP AUTH

2.) Spam controll isn't working.

In my headerfiles I can find the following:

```
Received: from blub@XXXX.medizin.uni-halle.de by XXXX by uid 89 with qmail-scanner-1.20 

     (clamscan: 0.67. f-prot: 4.3.1/3.14.7. Clear:RC:1(xxx.xxx.xxx.xxx):. 

     Processed in 0.010823 secs); 03 Mar 2004 16:02:27 -0000
```

In other posts I saw header which included the following:

```
X-Spam-Status:  No, hits=0.0 required=4.0
```

Is my spamchecking not working, or con I turn on this sort of reporting ?

----------

## blubbi

Jeeeha

Server is now running stabel.

Still 2 things to do

1.) SMTP AUTH

2.) Spam controll isn't working.

In my headerfiles I can find the following:

```
Received: from blub@XXXX.medizin.uni-halle.de by XXXX by uid 89 with qmail-scanner-1.20 

     (clamscan: 0.67. f-prot: 4.3.1/3.14.7. spamassassin: 2.63. Clear:RC:1(xxx.xxx.xxx.xxx):.Processed in 0.519031 secs
```

In other posts I saw header which included the following:

```
X-Spam-Status:  No, hits=0.0 required=4.0
```

Is my spamchecking not working, or con I turn on this sort of reporting

In /var/spool/qmailscan/qmail-queue.log I can read the following when sending the eicar Test virus

```
Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: checking eicar.com against perlscanner database...

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: file eicar.com is lowercased to eicar.com and has extension .com

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: compare eicar.com (size 257,14090586) against perlscanner database

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: checking eicar_com.zip against perlscanner database...

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: file eicar_com.zip is lowercased to eicar_com.zip and has extension .zip

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: compare eicar_com.zip (size 22,14090587) against perlscanner database

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: checking eicarcom2.zip against perlscanner database...

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: file eicarcom2.zip is lowercased to eicarcom2.zip and has extension .zip

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: compare eicarcom2.zip (size 132,14090588) against perlscanner database

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: skipping auto-generated file textfile2

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: checking eicar.com against perlscanner database...

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: file eicar.com is lowercased to eicar.com and has extension .com

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: compare eicar.com (size 257,14090586) against perlscanner database

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: checking eicar_com.zip against perlscanner database...

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: file eicar_com.zip is lowercased to eicar_com.zip and has extension .zip

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: compare eicar_com.zip (size 22,14090587) against perlscanner database

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: checking eicarcom2.zip against perlscanner database...

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: file eicarcom2.zip is lowercased to eicarcom2.zip and has extension .zip

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s: compare eicarcom2.zip (size 132,14090588) against perlscanner database

Wed, 03 Mar 2004 18:14:27 +0100:9942: p_s:  finished scan of dir "/var/spool/qmailscan/tmp/ws1-iut10783340674619942" in 0.002

Wed, 03 Mar 2004 18:14:27 +0100:9942: ini_sc: scanning message took 0.508694 seconds

Wed, 03 Mar 2004 18:14:27 +0100:9942: q_r: fork off child into /var/qmail/bin/qmail-queue...

Wed, 03 Mar 2004 18:14:27 +0100:18397: q_r: xstatus=0

Wed, 03 Mar 2004 18:14:27 +0100:9942: qmail-scanner: Clear:RC:1(141.48.106.85): 0.515971        1873    blub@XXX.medizin.

Wed, 03 Mar 2004 18:14:27 +0100:9942: cleanup: /bin/rm -rf /var/spool/qmailscan/tmp/XXX10783340674619942/ /var/spool/qmai

03/03/2004 18:14:27:9942: all finished. Total of 0.538799 secs

```

Last edited by blubbi on Wed Mar 03, 2004 5:22 pm; edited 1 time in total

----------

## Skywacker

I followed this install so I'm going to post my question in this thread. I need to get the defaultdomain working as cmrl.wustl.edu. Currently if users login with their username without @cmrl.wustl.edu the login fails. 

I tried putting cmrl.wustl.edu in:

/var/qmail/controls/defaultdomain

and

~vpopmail/etc/defaultdomain

I just added this line to /usr/portage/net-mail/vpopmail/vpopmail-5.2.1-r9.ebuild-

--enable-default-domain=cmrl.wustl.edu \

and then i 'emerge vpopmail' again.

emerge -p vpopmail had this output:

Calculating dependencies ...done!

[ebuild   R   ] net-mail/vpopmail-5.2.1-r9

I'm a gentoo noob(1 week), but I thought that would re-emerge vpopmail with that option added to the ./configure

Can someone please help me? I have some old Mac users who's mail clients can't handle a @ or % in their usernames.

Thanks!

----------

## blubbi

 *Skywacker wrote:*   

> I followed this install so I'm going to post my question in this thread. I need to get the defaultdomain working as cmrl.wustl.edu. Currently if users login with their username without @cmrl.wustl.edu the login fails. 
> 
> I tried putting cmrl.wustl.edu in:
> 
> /var/qmail/controls/defaultdomain
> ...

 

Read the Tread !!!

And think about the Maildir .maildir problem...

I have answered this questions just a few posts above !!!

----------

## Skywacker

----nevermind----fixed

[well first let me say I have read the entire thread MANY times.  Sometimes it's hard to see a solution when you've read/reread posts so many times trying to solve other problems. Anyway, I had almost everything working except the defaultdomain. When updating to the latest vpopmail just now I broke everything. Downgrading to the older vpopmail has not fixed things. I now get this in my logs everytime someone tries to get their mail:

pop3d: could not connect to mysql update server Access denied for user: 'root@localhost' (Using password: YES) with database

I don't know why it's trying to use root instead of vpopmail@localhost. I'd appreciate a fast response any one can help me. 

Thanks alot!]

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

upgrading changes the /etc/vpopmail.conf

i assumed that changing 'secret' to my actual password would work, but the new vpopmail didn't seem to even read that file. When I downgraded, I had the new conf file still. I deleted it, re-emerged, and Im back where I was.

----------

## ARC2300

I am having approximately the same problem also, so it'd be nice if someone could shed some light on the subject.

----------

## blubbi

Are you running qmail-pop3d or the courier pop3d ?

In any case, check your password in /etc/vpopmail.conf.

Check the permissions the user has for mysql:

```
vpopmail localhost SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD)
```

Permissions on the database vpopmail:

```
localhost Ja SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD
```

More info wouldn't hurt  :Smile: 

----------

## blubbi

This is how it should look if spamassassin and maildrop are working:

tail -f /var/log/mail.log

```

Mar  4 12:36:58 xyz spamd[5753]: connection from localhost [127.0.0.1] at port 59995

Mar  4 12:37:10 xyz spamd[2578]: checking message <050301c401d3$ab2a2650$9cb40a0a@MCONTEXP04> for someone@xyz.medizin.uni-halle.de:89.

Mar  4 12:38:45 ws1-iut spamd[2578]: clean message (0.2/5.0) for someone@xyz.medizin.uni-halle.de:89 in 106.8 seconds, 20345 bytes.
```

tail -f /var/log/qmail/qmail-send/current

```
@400000004047154f1b57a81c info msg 3129370: bytes 20707 from <sender@lalala-mannheim.de> qp 16136 uid 89

@400000004047154f1da4d824 starting delivery 89: msg 3129370 to local pc6-iut.medizin.uni-halle.de-felix.glahn@xyz.medizin.uni-halle.de

@400000004047154f1da516a4 status: local 2/10 remote 0/20

@400000004047154f24dbebb4 new msg 3129381

@400000004047154f24dcc674 info msg 3129381: bytes 20859 from <sender@lalala-mannheim.de> qp 8235 uid 89

@400000004047154f2578bc3c starting delivery 90: msg 3129381 to local xyz.medizin.uni-halle.de-someone@xyziut.medizin.uni-halle.de

@400000004047154f2578d794 status: local 3/10 remote 0/20

@400000004047154f2578e34c delivery 89: success: did_0+1+0/qp_8235/

@400000004047154f2578eb1c status: local 2/10 remote 0/20

@400000004047154f2578f2ec end msg 3129370
```

The Header of the Mail:

```
Received: from sender@xyz.medizin.uni-halle.de by xyz by uid 89 with qmail-scanner-1.20 

     (clamscan: 0.67. f-prot: 4.3.1/3.14.7. spamassassin: 2.63. Clear:RC:1(141.48.xxx.xxx):. 

     Processed in 0.044765 secs); 04 Mar 2004 11:32:07 -0000

.

.

.

User-Agent: SquirrelMail/1.4.2

MIME-Version: 1.0

Content-Type: text/plain;charset=iso-8859-1

Content-Transfer-Encoding: 8bit

X-Priority: 3

Importance: Normal

X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on 

     ws1-iut.medizin.uni-halle.de

X-Spam-Level: *

X-Spam-Status: No, hits=1.2 required=5.0 tests=PRIORITY_NO_NAME,

     RCVD_NUMERIC_HELO autolearn=no version=2.63
```

There is just one more problem:

tail -f /var/log/mail.log

```
Mar  4 12:39:40 ws1-iut X-Qmail-Scanner-1.20: [ws1-iut107840038046132122] d_m: output spotted from /usr/bin/ripmime  --unique_names -i - -d /var/spool/qmailscan/tmp/ws1-iut107840038046132122/ (uuencode.c:275:UUENCODE_is_uuencode_header:WARNING: Cannot read permissions for UUENCODED data file (begin
```

and

tail -f /var/log/qmail/qmail-send/current

```
/usr/bin/head:_cannot_open_`/var/vpopmail/domains/xyz.medizin.uni-halle.de/xyz/.maildir/.maildirsize'_for_reading:_No_such_file_or_directory/
```

mmmh, I wonder what happens when I yust create this file .... I'll give it a try.

----------

## m3ph

Hi,

I'm having the same problem as one person here already posted:

```
 @4000000040472e8a0e0b7774 new msg 87890

@4000000040472e8a0e0b8afc info msg 87890: bytes 693 from <meph@clubarena.com> qp 20510 uid 201

@4000000040472e8a113ef09c starting delivery 6: msg 87890 to local meph@clubarena.com

@4000000040472e8a113f0424 status: local 1/10 remote 2/20

@4000000040472e8a116fb4fc delivery 6: deferral: Unable_to_chdir_to_maildir._(#4.2.1)/

```

There isn't a problem with .maildir and Maildir. That's for sure. It all started after I tried to get qmail-scanner working. Any help would really be appreciated.

I tried disabling qmail-scanner and getting the system to the state it was before qmail-scanner, but that didn't help.

----------

## blubbi

have a look at

/var/qmail/control/defaultdelivery

It must look like this:

```
# Uncomment the next line for .forward support

#|dot-forward .forward

./.maildir/
```

and check the permissions in /var/vpopmail

By the way: check /var/qmail/users/ if there is something wired.

Hope I could help

----------

## m3ph

premissions on /var/vpopmail:

```

clubarena vpopmail # ls -la

total 5

drwxr-xr-x    8 vpopmail vpopmail      224 Feb 26 05:56 .

drwxr-xr-x   16 root     root          432 Feb 26 05:52 ..

drwx------    2 vpopmail vpopmail      112 Mar  4 01:30 .spamassassin

drwxr-xr-x    2 root     root          752 Feb 26 02:56 bin

lrwxrwxrwx    1 root     root           34 Feb 26 02:56 doc -> /usr/share/doc/vpopmail-5.4.0_rc1/

drwxr-xr-x    4 vpopmail vpopmail      144 Feb 26 04:10 domains

drwxr-xr-x    2 root     root          160 Feb 26 02:56 etc

drwxr-xr-x    2 root     root          200 Feb 26 02:56 include

drwxr-xr-x    2 vpopmail vpopmail       80 Feb 26 02:56 lib

```

The only thing in /var/qmail/users is the assign file and it looks like this:

```

clubarena users # cat assign

+test.clubarena.com-:test.clubarena.com:89:89:/var/vpopmail/domains/test.clubarena.com:-::

+clubarena.com-:clubarena.com:89:89:/var/vpopmail/domains/clubarena.com:-::

.

```

edit: actually there are assign.lock and a cdb file too...

edit2: the defaultdelivery looks like it should

----------

## Skywacker

blubbi, 

I feel you mixed up my original post for help with defeaultdomain with other people's posts about default delivery. If I am mistaken, maybe you could elaborate about what it was you said fixed the defaultdomain issue?

I have no problems with mail delivery at all. F-prot and Spamassassin work perfectly for me. Squirrelmail works perfectly, as do several POP3 email clients(Outlook, OE, Eudora, Os X Mail, kmail).

The problem is users have to enter their full email address for the username. I need users to be able to log in with the Pop3 clients without using @domain.com in their usernames. 

If you are saying that upgrading to the latest vpopmail/qmail is the fix, and since you have upgraded to vpopmail-5.4.0_rc1 and qmail-1.03-r15, can you show me what your /etc/vpopmail.conf looks like?

I ran into two problems when I upgraded vpopmail/qmail  from versions [5.2.1-r9] and [1.03-r13]. 

1) in /var/log/messages --  pop3d: could not connect to mysql update server Access denied for user: 'root@localhost' (Using password: YES) with database

	I used etc-update to update the conf files being careful not to lose settings specific to my server. I allowed the /etc/vpopmail.conf to be updated to the new format, and then changed the secret to my password. I tested this password from the command line, and it worked before I upgraded and after I down graded back to 5.2.1-r9. It appeared vpopmail wasn't using this file at all, but the user was also specified as 'vpopmail', not root. 

2) in /var/log/qmail/qmail-send/current --  delivery 58: failure: vmysql:_sql_error[3]:_MySQL_server_has_gone_away/Sorry,_no_mailbox_here_by_that_name._(#5.1.1)/

Maybe these errors are symptoms of the same problem since both are about connecting to the db. 

You should also know that I can login and check for new mail while the server is in the above broken state. I could also send emails, but they just dissapeared into the void. Not sure if I could actually receive them either, but I doubt it.

Thanks for any help!

-Sky

----------

## blubbi

IMHO there is no way arround the user@domain.bla

This is because of vpopmail. In some way it must know to which domain the user belongs. You con have the same user at different domains.

for example: blub@lala.de and blub@somedomain.com

With the mySQL error I have no idea.

Sorry I couldn't help

.... ah? check if the host is allowd to connect 

add the user for localhost and any or something like that.

Good luck

----------

## Skywacker

Thanks for trying  :Smile:  This howto has saved me TONS of time, even if I've hit a few snairs along the way. 

It is is possible to have a defaultdomain. So even if user joe sits in multiple virtual domains, if he tries to login without specifying a domain it will append @defaultdomain.com to his username. 

qmail does this with /var/qmail/control/defaultdomain

vpopmail is supposed to do this with ~vpopmail/etc/defaultdomain, but this isn't working as advertised. I found a link on the web stating that you can either compile the --enable-default-domain=$DEFAULTDOMAIN into vpopmail, or upgrade to the latest version of vpopmail. Unfortunately I didn't notice the date of that post and I've had the above problems trying to upgrade. I'll keep trying though. 

If I ever get this working, I'll be onto the SMTP-Auth problem. I would love to know if you make any headway.

Thanks again.

-Sky

----------

## Skywacker

Oh, can I see your /etc/vpopmail.conf file?

[edit] don't wanna see your password, just wondering the format.  :Smile: 

----------

## m3ph

resolved my problem with vpopmail...

now i just have to get that spamassassin to work... virus scanners work, but no spamassassin for some reason

----------

## blubbi

 *Skywacker wrote:*   

> Oh, can I see your /etc/vpopmail.conf file?
> 
> [edit] don't wanna see your password, just wondering the format. 

 

Here it is:

```
# Read-only DB

localhost|0|vpopmail|hidden|vpopmail

# Write DB

localhost|0|vpopmail|hidden|vpopmail

```

One other thing:

As someone statet bevor, vmailmanager is ommittet when using maildrop

```
#| /var/vpopmail/bin/vdelivermail '' bounce-no-mailbox

| maildrop /etc/mail/maildrop
```

Now thats a bit mmmmh, how can I now make vpopmail manage the .qmail files for forwarding, vacation notice etc ....

one other little thing: maildrop is not able to make the file .maildirsize

somewhere in that code here is a misstake. But I can't figure it out

```
##

# create the maildirsize file if it doesn't already exist

# (could also be done via "deliverquota user@dom.com 10MS,1000C)

##

`test -e $VHOME/.maildir/.maildirsize`

if( $RETURNCODE == 1)

{

        `/var/vpopmail/bin/vuserinfo -Q $EXT@$HOST`

        `test -s "$VHOME/.maildir/.maildirsize"`

   if ( $RETURNCODE == 0 )

   {

#This line was added from me, but it still dosn't work

#`/bin/touch $VHOME/.maildir/.maildirsize`

        `/bin/touch $VHOME/.maildir/.maildirsize`

        `/usr/sbin/chown vpopmail:vpopmail $VHOME/.maildir/.maildirsize`

        `/bin/chmod 640 $VHOME/.maildir/.maildirsize`

   }

}
```

Any coders here ??

----------

## blubbi

This is worth to be mentioned:

Spamassassin KonfiguratorLast edited by blubbi on Mon Mar 08, 2004 3:25 pm; edited 1 time in total

----------

## nianderson

im getting this when i try to add a domain.

i have set the /etc/vpopmail.conf  to the correct password and created the database as shown 

```
mail etc # vadddomain nanderson.com

Please enter password for postmaster:

enter password again:

vmysql: sql error[c]: MySQL server has gone away

vmysql: sql error[b]: MySQL server has gone away

vmysql: sql error[3]: MySQL server has gone away

could not create limits table CREATE TABLE limits ( domain CHAR(64) PRIMARY KEY,       maxpopaccounts           INT(10) NOT NULL DEFAULT -1,       maxaliases               INT(10) NOT NULL DEFAULT -1,       maxforwards              INT(10) NOT NULL DEFAULT -1,       maxautoresponders        INT(10) NOT NULL DEFAULT -1,       maxmailinglists          INT(10) NOT NULL DEFAULT -1,       diskquota                INT(12) NOT NULL DEFAULT 0,       maxmsgcount              INT(12) NOT NULL DEFAULT 0,       defaultquota             INT(12) NOT NULL DEFAULT 0,       defaultmaxmsgcount       INT(12) NOT NULL DEFAULT 0,       disable_pop              TINYINT(1) NOT NULL DEFAULT 0,       disable_imap             TINYINT(1) NOT NULL DEFAULT 0,       disable_dialup           TINYINT(1) NOT NULL DEFAULT 0,       disable_passwordchanging TINYINT(1) NOT NULL DEFAULT 0,       disable_webmail          TINYINT(1) NOT NULL DEFAULT 0,       disable_relay            TINYINT(1) NOT NULL DEFAULT 0,       disable_smtp             TINYINT(1) NOT NULL DEFAULT 0,       perm_account             TINYINT(2) NOT NULL DEFAULT 0,       perm_alias               TINYINT(2) NOT NULL DEFAULT 0,       perm_forward             TINYINT(2) NOT NULL DEFAULT 0,       perm_autoresponder       TINYINT(2) NOT NULL DEFAULT 0,       perm_maillist            TINYINT(4) NOT NULL DEFAULT 0,       perm_quota               TINYINT(2) NOT NULL DEFAULT 0,       perm_defaultquota        TINYINT(2) NOT NULL DEFAULT 0 )

vmysql: sql error[p]: MySQL server has gone away

Error: (vadduser) can't read domain limits

```

----------

## m3ph

erm... can anyone tell me how i can make spamassassin delete mails that it thiks are spam?

----------

## nianderson

well i was trying to use vpopmail  5.4 from portage. i unmerged it and merged whatever the latest was in the stable tree and adding domains at least is working now. 

anyone using 5.4 vpopmail?

----------

## m3ph

using 5.4.0-rc1 here without no problems...

just need to figure out how to make spamassassin delete mail that it thiks are spam :\

----------

## nianderson

any idea why with pre  5.4.0 

i was getting 

```
vmysql: sql error[c]: MySQL server has gone away

vmysql: sql error[b]: MySQL server has gone away

vmysql: sql error[3]: MySQL server has gone away

could not create limits table CREATE TABLE limits ( do
```

when i try to do vadddomain?

works flawless with net-mail/vpopmail-5.2.1-r9

also i dont seem to have smtp auth working

----------

## outspoken

its sad.. i had qmail-pop3d and qmail-smtpd working 100% and along came this great thread with the promise of spam filter, anti-virus and squirrelmail! well i was pulled in instantly and spent the last two weeks in agony. gentoo 2004.0 just came out so i download it last night and reinstalled my system, im going to give this setup a chance with a clean sltart to see if things will work. ill post news on it when its complete.

thanks for the help and its too bad i couldnt get things working right..

nianderson: i too had the mysql server has gone away message, and i couldnt fix it.

----------

## m3ph

started working without a hitch here... no errors :\

----------

## nianderson

 *outspoken wrote:*   

> 
> 
> nianderson: i too had the mysql server has gone away message, and i couldnt fix it.

 

what version of vpopmail ? cause it works if i use pre 5.4

----------

## outspoken

 *nianderson wrote:*   

>  *outspoken wrote:*   
> 
> nianderson: i too had the mysql server has gone away message, and i couldnt fix it. 
> 
> what version of vpopmail ? cause it works if i use pre 5.4

 

yes, i was running 5.4+ at the end, but before it was the earlier one and i did not get that error. but it was many multiple things that went wrong which made me decide to wipe the drive clean. the server is not in production yet so it did not bother me. the issue i was running into was no authentication from vpop, following things to the T on the isntall. but i did an emerge on qmailadmin and the others rather than ./configure.

----------

## nianderson

yeh its driving me nuts cause i need to get my mailserver back up heh and i want to run several more domains

----------

## outspoken

one question before i get started again, is it ok to use the latest versions of vpopmail/autoresponder/qmaildmin?

currently these are the latest versions of each:

vpopmail - 5.4.0 (http://sourceforge.net/projects/vpopmail/)

qmailadmin - 1.2.0 (http://sourceforge.net/projects/qmailadmin/)

autorespond - 2.0.5 (http://www.inter7.com/develop.html)

should i use these versions or go with the exact version numbers from the install document here?

what are some version numbers you are using? (all replies welcome)

thanks!

----------

## nianderson

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

there is that too

----------

## outspoken

 *nianderson wrote:*   

> http://www.gentoo.org/doc/en/qmail-howto.xml
> 
> there is that too

 

nice, thanks. i have never seen this guide before. ive used life with qmail, this thread and one other that was written by someone on these boards. ill try this one because i actually would prefer to use horde.

----------

## nianderson

let me know how it goes .... it uses vpopmail 5.4 so interested to know if it has a fix for that mysql is gone error.

----------

## nianderson

FOUND ANSWER UPTHREAD

it does not exist but did not work until renamed .conf as thats what /etc/init.d/spamd was looking for.

question on step 5 anyone else notice that /etc/conf.d/spamd.conf does not exist?

at least with the current stable version  2.63

its /etc/conf.d/spamd 

also when i start spamd i get 

```

* Starting spamd...

unix dgram connect: No such file or directory at /usr/bin/spamd line 282  [ ok ]

```

 *sabrex wrote:*   

> 
> 
> 5) install f-prot and Mail-SpamAssassin.  they must be running before installing qmail-scanner.
> 
> ```
> ...

 Last edited by nianderson on Mon Mar 08, 2004 2:00 pm; edited 1 time in total

----------

## ARC2300

Okay. . .I cleaned, then re-emerged all the packages. . .

Everything goes great now.  I can create a user, create domains, and otherwise set up the post office.

But I can't read any mail.  After setting the debug up for POP3D, this is what I get in my logs:

```

Mar  7 22:06:54 [pop3d] Connection, ip=[192.168.0.118]

Mar  7 22:06:54 [pop3d] LOGIN: DEBUG: ip=[192.168.0.118], command=CAPA

Mar  7 22:07:05 [pop3d] LOGIN: DEBUG: ip=[192.168.0.118], command=USER

Mar  7 22:07:05 [pop3d] LOGIN: DEBUG: ip=[192.168.0.118], command=PASS

Mar  7 22:07:05 [pop3d] LOGIN: DEBUG: ip=[192.168.0.118], username=xxxx

Mar  7 22:07:05 [pop3d] LOGIN: DEBUG: ip=[192.168.0.118], password=xxxxxxxxxxxxxxxxxxxx

Mar  7 22:07:05 [pop3d] could not connect to mysql update server Access denied for user: 'root@localhost' (Using password: YES) with database

Mar  7 22:07:05 [pop3d] could not connect to mysql update server Access denied for user: 'root@localhost' (Using password: YES)

Mar  7 22:07:10 [pop3d] LOGIN FAILED, ip=[192.168.0.118]
```

But, this is my vpopmail.conf file that I'm telling it to access the DB with:

```
<snip># Note:

#   The value of host may be either a hostname or an IP address.

#   If host is 'localhost', then sockets (Unix) or named pipes (Windows)

#   will be used instead of TCP/IP to connect to the server.

# Read-only DB

localhost|0|dbusername|pazzwordz|dbname

# Write DB

localhost|0|dbusername|pazzwordz|dbname
```

What the heck is going on??  I never told it to try to log onto the db as root at any time.  Does the latest vpopmail that works with qmailadmin have a mind of it's own and just log on as whatever it feels like?

~

~

----------

## nianderson

did we find out if this was necessary for mysql instilations

 *JeffreyCentex wrote:*   

> 
> 
> QMAILDUID=`id -u vpopmail`
> 
> NOFILESGID=`id -g vpopmail`
> ...

 

----------

## nianderson

check your /etc/hosts file

you need to add your hostname to the line so if your box is named mail your hosts file would need to be at least like this

```

127.0.0.1       localhost       mail

```

 *aahz wrote:*   

> During the merge of f-prot and SpamAssasin, I get a failure on compilcation of one of the dependencys.
> 
> ```
> robot/ua-get..........HTTP Server terminated
> 
> ...

 

----------

## Skywacker

read up to my posts, I have the exact same problem. The issue is certainly with vpopmail 5.4

It is trying to connect to the db as root@localhost. It's obviously not reading the /etc/vpopmail.conf file where I have the username specified to be vpopmail with secret pass. 

The only reason for upgrading to 5.4 is the hope it will fix the SMTP-AUTH problems. Everything else works fine for me (fprot, spamassassin, pop3d, imap, squirrelmail).

 :Question:  Since SMTP-Auth is broken, anyone know how to get pop before smtp to work?

Thanks,

Skywacker

----------

## Skywacker

I did the below, it did not fix smtp-auth for mysql setups.

 *nianderson wrote:*   

> did we find out if this was necessary for mysql instilations
> 
>  *JeffreyCentex wrote:*   
> 
> QMAILDUID=`id -u vpopmail`
> ...

 

----------

## nianderson

so does anyone have smtp auth with mysql workin by this document?

----------

## nianderson

 *Skywacker wrote:*   

> read up to my posts, I have the exact same problem. The issue is certainly with vpopmail 5.4
> 
> It is trying to connect to the db as root@localhost. It's obviously not reading the /etc/vpopmail.conf file where I have the username specified to be vpopmail with secret pass. 
> 
> 

 

did you check your /etc/vpopmail.conf file?

it appears the format changed i had merged an earlier one first and thats why i could not connect to the database.

here is what my vpopmail.conf looks like

```
# MYSQL CONNECTION SETTINGS FOR VPOPMAIL

#

# Line 1 defines the connection to use for database reads,

# Line 2 defines the connection to use for database updates/writes.

#

# If you omit line 2, then the same settings will be

# used for both read and write.

#

# settings for each line:

# host|port|user|password|database

#

#

# Note:

#   The value of host may be either a hostname or an IP address.

#   If host is 'localhost', then sockets (Unix) or named pipes (Windows)

#   will be used instead of TCP/IP to connect to the server.

# Read-only DB

localhost|0|vpopmail|password|vpopmail

# Write DB

localhost|0|vpopmail|password|vpopmail

```

----------

## Skywacker

Yes I had. Perhaps I will try again if you got it working. I'm going after pop-before-smtp for now until someone has success with smpt-auth. This servers in production and I have a lot of people travelling this week. I need something working fast besides Squirrelmail.

-Sky

----------

## blubbi

ATTENTION:

in the scriptfile /etc/mail/maildrop is .maildirsize spezified.

But the newest build vrom vpopmail, courier-IMAP, squirrelmail use maildir instead of .maildirsize.

My installed packages:

```

root@xyz$ ACCEPT_KEYWORDS="~x86" emerge -p vpopmail qmail qmailadmin squirrelmail maildrop

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] net-mail/vpopmail-5.4.0_rc1

[ebuild   R   ] net-mail/qmail-1.03-r15

[ebuild   R   ] net-mail/qmailadmin-1.2.0_rc2-r1

[ebuild     U ] net-mail/squirrelmail-1.4.2-r3 [1.4.2-r1]

[ebuild   R   ] net-mail/maildrop-1.5.3-r1

[ebuild   R   ] net-mail/qmail-scanner-1.20

```

So change every .maildirsize in /etc/mail/maildrop to maildirsize

here the lines I am talking about:

```
##

# create the maildirsize file if it doesn't already exist

# (could also be done via "deliverquota user@dom.com 10MS,1000C)

##

`test -e $VHOME/.maildir/maildirsize`

if( $RETURNCODE == 1)

{

        `/var/vpopmail/bin/vuserinfo -Q $EXT@$HOST`

        `test -e "$VHOME/.maildir/maildirsize"`

   if ( $RETURNCODE == 0 )

   {

#        `/bin/touch $VHOME/.maildir/maildirsize`

        `/usr/sbin/chown vpopmail:vpopmail $VHOME/.maildir/maildirsize`

        `/bin/chmod 640 $VHOME/.maildir/maildirsize`

   }

}
```

```
##

# Set MAILDIRQUOTA. If this isn't set, maildrop and deliverquota

# will not enforce quotas for message delivery.

#

# I find this much easier than creating yet another config file

# to store this in. This way, any time the quota is changed in

# vpopmail, it'll get noticed by maildrop immediately.

##

MAILDIRQUOTA=`/usr/bin/head -n1 $VHOME/.maildir/maildirsize`

```

----------

## nianderson

so no one has smtp-auth working with vpopmail???

----------

## blubbi

seems so ..... I am working on that .... reading articles in google, asking in IRC ... etc etc ... nothing helpt up to now

----------

## nianderson

heh love it when the howtos dont work  :Wink:  think after we get it all working agin we may have to fork a new thread to clean up the mess  :Razz: 

----------

## ARC2300

 *nianderson wrote:*   

> heh love it when the howtos dont work  think after we get it all working agin we may have to fork a new thread to clean up the mess 

 

No kidding.

Everything works perfectly but the logging in part.   :Sad: 

I've checked, and the mail gets sent, goes into the correct user's box.  I just can't log in to read it.   :Sad: 

----------

## nianderson

arch you have smtp-auth working?

ive had it sending mail with out auth but not with auth

http://www.mail-archive.com/vchkpw@inter7.com/msg16232.html this may help someone smarter than I

looks like with new versions the domain needs to be left off the smtp auth config part

----------

## nianderson

on another note it seems that im having problems with qmail-scanner

gettting this error when sending mail

qq temporary problem (#4.3.0)

thats with no auth

----------

## puke

 *nianderson wrote:*   

> qq temporary problem (#4.3.0) thats with no auth

 

That is a qmail error, so probably nothing to do with qmail-scanner.  You may have a queue problem.  It has happened to me once.  Emerge or download a qmail queue fixing utility (there are a few) and see if that resolves your problem.

View the qmail log realtime in a window whilst you're testing with

```
tail -f /var/log/qmail/qmail-smtpd/current &
```

Also viewing the qmail-scanner log realtime helps too.

----------

## Skywacker

 *ARC2300 wrote:*   

>  *nianderson wrote:*   heh love it when the howtos dont work  think after we get it all working agin we may have to fork a new thread to clean up the mess  
> 
> No kidding.
> 
> Everything works perfectly but the logging in part.  
> ...

 

Arc,

sounds like you have maildir issues. Keep in mind that some apps seem to be configured for mail to be in Maildir while others are using .maildir. There's a script in ~vpopmail/bin that fixes the issue by moving all Maildir's to .maildir and then making a link from Maildir to .maildir. Make sure you read the complete thread and check you /var/log/messages for vpopmail mail logging in problems. If youre using vdomains/vusers, make sure your username is the complete email address. 

-Sky

----------

## Skywacker

I tried doing what was suggested in the /var/qmail/control/conf-smtpd and conf-pop3d to enable pop-before-smtp but it didn't work. 

Does anyone have this working?

-Skywacker

----------

## outspoken

 *nianderson wrote:*   

> let me know how it goes .... it uses vpopmail 5.4 so interested to know if it has a fix for that mysql is gone error.

 

already having simple troubles right form the beginning. not sure what the issue here is, could be dns on my end.

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

one thing that is missing is:

```

Code Listing 2.5: Test delivery service

 

# ssh vapier@localhost

# maildirmake

 

```

maildirmake requires a name after the command, so i used:

```

maildirmake Maildir

```

simple enough, then the document goes on to use mutt for testing local and in that arrises a somewhat commonly known problem where mutt complains if there are missing dirs in the ~./maildir/ directory which are "new, tmp and cur" so that fixed that.

however when i send myself some test mails locally i get errors in the logs as follows:

```

>cat /var/log/qmail/qmail-send/current

return:

@40000000404cd9a20a910654 status: local 0/10 remote 0/20

@40000000404cdcf23666f6bc new msg 225859

@40000000404cdcf2366721b4 info msg 225859: bytes 267 from <me@my.domain.com> qp 2811 uid 1000

@40000000404cdcf239d9a394 starting delivery 1: msg 225859 to local root@my.domain.com

@40000000404cdcf239dd1e34 status: local 1/10 remote 0/20

@40000000404cdcf311afb3cc new msg 225858

@40000000404cdcf311c4e594 info msg 225858: bytes 383 from <me@my.domain.com> qp 2814 uid 200

@40000000404cdcf3197305b4 starting delivery 2: msg 225858 to local me@my.domain.com

@40000000404cdcf3197330ac status: local 2/10 remote 0/20

@40000000404cdcf31973404c delivery 1: success: did_0+1+0/qp_2814/

@40000000404cdcf3197357bc status: local 1/10 remote 0/20

@40000000404cdcf31973675c end msg 225859

@40000000404cdcf3204e7454 delivery 2: deferral: Unable_to_chdir_to_maildir._(#4.2.1)/

@40000000404cdcf3204ea334 status: local 0/10 remote 0/20

```

then it just keeps repeating that basically and no mail shows up locally when i check. also it gets to the point in the logs where it just says bounce/triple bounce and user has reached quota.

btw, if you think this 'howto thread' is complicated.. take a look at this beast of a howto:

https://forums.gentoo.org/viewtopic.php?t=1085

i think im going to have nightmares after looking at this one.

----------

## blubbi

 *nianderson wrote:*   

> heh love it when the howtos dont work  think after we get it all working agin we may have to fork a new thread to clean up the mess 

 

I'll write one. With all the expierience I have made. It will nearly cover everything menthioned in this howto.

But first off all I'll write it down in a siple txt file on the web. If I finished, I would appreciate it if someone would test this on a fresh install bevore I post it here.

I'll post the URL to my HOWTO in this thread.

----------

## blubbi

 *nianderson wrote:*   

> heh love it when the howtos dont work  think after we get it all working agin we may have to fork a new thread to clean up the mess 

 

I'll write one. With all the expierience I have made. It will nearly cover everything menthioned in this howto.

But first off all I'll write it down in a siple txt file on the web. If I finished, I would appreciate it if someone would test this on a fresh install bevore I post it here.

I'll post the URL to my HOWTO in this thread.

----------

## nianderson

post it i do fresh installs all the time.ill do one as son as you post the howto

----------

## blubbi

 *nianderson wrote:*   

> post it i do fresh installs all the time.ill do one as son as you post the howto

 

here it is:

Blubbis 

Qmail vpopmail qmail-scanner courier-IMAP SquirrelMail ezmlm-idx-mysql maildrop Mail-SpamAssassin f-prot clamav pyzor razor net-ping dcc

HOWTOget them work together

 for Gentoo-Linux

http://ws1-iut.medizin.uni-halle.de/qmail-howto.htm

If you want to contact me so we can work out the perfekt howto, you'll find my mailaddress on this site http://ws1-iut.medizin.uni-halle.de/contact_en.htm in the "contact" sektion. Just mailto the Webmaster  :Smile: 

nianderson: one thing you could test at once: try without the USE flag "clearpasswd"

----------

## Skywacker

will your howto have working smtp-auth or pop-before-smtp?

-Sky

----------

## blubbi

 *Skywacker wrote:*   

> will your howto have working smtp-auth or pop-before-smtp?
> 
> -Sky

 

mmmh, I didn't bother about pop befor smtp. But this shouldn't be the problem. I'll include smtp after pop. SMTP-AUTH still doesn't work I have no clue why.

----------

## nianderson

id be more than happy to help ya work out the kinks ill get in contact with you later today. and ill do a reinstall asap. 

i was thinking it would be nice to just have a qmail-toaster ebuild wonder if thats possible.

----------

## Skywacker

[

mmmh, I didn't bother about pop befor smtp. But this shouldn't be the problem. I'll include smtp after pop. SMTP-AUTH still doesn't work I have no clue why.[/quote]

well, anything that allows remote email clients send email through the server. Squirrelmail is nice, but many people prefer to use their usual client even while travelling.

----------

## nianderson

pop before smtp is an ok temporary solution but i dont use pop we prefer imap solutions so it will be really nice when we figure out how to get smtp-auth working.

----------

## blubbi

 *Skywacker wrote:*   

> [
> 
> well, anything that allows remote email clients send email through the server. Squirrelmail is nice, but many people prefer to use their usual client even while travelling.

 

It's a bit tricky to get smtp after pop to work with courier-pop3d. For qmails pop3d it is no problem. I'll see If i can figure out how it works wit the courier pop3d.

-------------EDIT----------------

I have updated my howto. now it contains a section for smtp after pop/imap.

I can not verify if it is woking, cause I have no system to test it on.

Oh, I vorgot one thing to mention: DONT FORGETT TO EDIT YOUR TCP RULES to allow every IP to relay (if it's that what you want smtp after pop for)

http://ws1-iut.medizin.uni-halle.de/qmail-howto.htm

-----------EDIT-------------------

----------

## blubbi

Added info how to fix permissinoproblems with the qmail-scanner-queue.

----------

## SpanKY

qmail (and everything maildir related in portage) work off of .maildir

it slipped my mind to add in the '.maildir' arguement after `makemaildir` which is why the howto reads incorrectly

ive fixed it in cvs

----------

## blubbi

 *SpanKY wrote:*   

> qmail (and everything maildir related in portage) work off of .maildir
> 
> it slipped my mind to add in the '.maildir' arguement after `makemaildir` which is why the howto reads incorrectly
> 
> ive fixed it in cvs

 

Had no problems with .maildir and Maildir .... oki

But do you have any clou why SMTP-AUTH isn't working ?

----------

## outspoken

well i was able to get my installation to work!!

following this howto:

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

there were some issues that i ran into when first installation but they were cleared up rather quickly and the howto has been updated to reflect those issues.

one thing im running into now that others may run into as well if trying to install qmail-scanner is that the berkley db version 4.1.25_p1-r3 is not happy with maildrop-1.5.3.-r1, so if you plan on emerging qmail-scanner then you need to either unmerge db-4.1.25_p1-r3 and emerge db-4.0.14-r3 or muddle with the ebuild scripts for maildrop or econf respectively. I've done neither as I'm currently syncing my system to get db-4.2.52_p1 and test that out as I would rather go forwards than backwards in versions if I can help it.

best of luck to all your qmail hopefuls, i'm very happy with the above mentioned howto and was able to get my qmail/vpopmail/ssl/horde/imap system up and running rather quick.

----------

## blubbi

 *outspoken wrote:*   

> well i was able to get my installation to work!!
> 
> following this howto:
> 
> http://www.gentoo.org/doc/en/qmail-howto.xml
> ...

 

Where was the problem with maildrop ??? It works like a charm for me no problems with mysql. Ther was no problem to get qmail running with this howto (just a view permission problems an the starrting problem with Maildir and .maildir due to some version missmatches)

----------

## SpanKY

 *blubbi wrote:*   

> But do you have any clou why SMTP-AUTH isn't working ?

 

afaik SMTP-AUTH utilizes vchkpw which should have been setup in /var/qmail/control/conf-smtpd ... so if vchkpw (and vpopmail) are working correctly, and you setup the QMAIL_SMTP_CHECKPASSWORD vars correctly in conf-smtpd, everything else should fall into place

----------

## nianderson

im using kmail for a client and it does not appear to be able to work with smtp-auth

want to see any configs to verrify?

----------

## SpanKY

make sure you tell it to use user@host as the username (i.e. vapier@wh0rd.org) instead of just user (i.e. vapier)

i use kmail as my client and it works as advertised  :Mad: 

----------

## outspoken

 *blubbi wrote:*   

>  *outspoken wrote:*   well i was able to get my installation to work!!
> 
> following this howto:
> 
> http://www.gentoo.org/doc/en/qmail-howto.xml
> ...

 

it was a known issue between maildrop 1.5.3 and certain versions of db. there are many threads on it here in the forums. it worked fine for me using maildrop 1.5.3-r1 and db-4.2.52_p1.

i'm using your howto for anti-virus and spam busting blubbi. ive just finished the merging, now im going to install a new HD before i update the spam list as you say it takes a lot of space and im running out on that pc. im going to make a new directory specifically for the spam and just call it /spam, giving it the same permissions and details as the /root directory. is that what you would suggest?

thanks!

----------

## nianderson

 *SpanKY wrote:*   

> make sure you tell it to use user@host as the username (i.e. vapier@wh0rd.org) instead of just user (i.e. vapier)
> 
> i use kmail as my client and it works as advertised 

 

i do when i try to auth without encryption it says i must starttls first and when i try with tls it says something abut not being able too

----------

## Skywacker

blubbi, your link to your howto is broken.

----------

## SpanKY

 *nianderson wrote:*   

> i do when i try to auth without encryption it says i must starttls first and when i try with tls it says something abut not being able too

 

hrm, that smily wasnt the one i wanted ... oh well ...

try using tls with plain login ... if that doesnt work, try clicking the 'check what server supports' button

----------

## Skywacker

spanky,

are you saying that you have a vpopmail install with MySQL that has smtp-auth working?

----------

## SpanKY

 *Skywacker wrote:*   

> spanky,
> 
> are you saying that you have a vpopmail install with MySQL that has smtp-auth working?

 

considering thats what my HOWTO describes, i would say yes  :Razz: 

----------

## Skywacker

Link to your howto?

As far as I can see you didnt show up in this thread until page 9. Sorry if I missed the link to your thread.

-Skywacker

----------

## outspoken

 *Skywacker wrote:*   

> Link to your howto?
> 
> As far as I can see you didnt show up in this thread until page 9. Sorry if I missed the link to your thread.
> 
> -Skywacker

 

hes got a great howto.. thats where i finally was able to get my qmail working from. http://www.gentoo.org/doc/en/qmail-howto.xml

----------

## Skywacker

I'll give it a try.

ty

----------

## nianderson

i looked at your smtp auth section spanky mine should be fine.

When I try to send mail with auth encryption none and authentication method login i get

```

Sending failed:

Your SMTP server doesn't support authentication.

The server responded: "Must Issue a STARTTLS command first (#5.7.0)"

```

i get the same with encryption none and authentication method plain and cram-md5

when i try to send mail with auth and tls with plain i get 

```

Sending Failed:

Unknown error code 50

Your SMTP server does not support tls. Disable TLS, if you want to connect without encryption.

```

kmail crashes if i try to detect automatically

here is the relevent section in my conf-smtpd

```

QMAIL_SMTP_AUTHHOST=$(<${QMAIL_CONTROLDIR}/me)

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

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

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

```

ideas?

----------

## happy

I followed the gentoo / qmail-howto, then removed the qmail directory, and installed qmail from vanilla source, then instead of installing mysql/vpopmail, I just installed squirrelmail and all worked fine. I even applied the spamcontrol patch to qmail, and that is working flawlessly.

Cheers,

----------

## SpanKY

 *nianderson wrote:*   

> when i try to send mail with auth and tls with plain i get 
> 
> ```
> 
> Sending Failed:
> ...

 

make sure you emerged with USE=ssl and you're using the qmail version i suggested in the howto

----------

## blubbi

tls is working for me, but I can's AUTH:

```
root@xyz $ telnet localhost 25

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

220 xyz.medizin.uni-halle.de ESMTP

ehlo

250-xyz.medizin.uni-halle.de

250-STARTTLS

250-SIZE 0

250-PIPELINING

250 8BITMIME

starttls

220 ready for tls

AUTH LOGIN

Connection closed by foreign host.

```

This line "250 AUTH LOGIN PLAIN CRAM-MD5" is missing

after "250 8BITMIME"

I am realy going nuts .....

----------

## blubbi

[quote="outspoken"][quote="blubbi"] *outspoken wrote:*   

> well i was able to get my installation to work!!
> 
> i'm using your howto for anti-virus and spam busting blubbi. ive just finished the merging, now im going to install a new HD before i update the spam list as you say it takes a lot of space and im running out on that pc. im going to make a new directory specifically for the spam and just call it /spam, giving it the same permissions and details as the /root directory. is that what you would suggest?
> 
> thanks!

 

no no, /root/spam/ was just where I put that spamcrap  :Smile:  Put your spam where you want. The spamdatabase in /etc/mail will only be a tenth of the spam you feed it with. But you need this space to download und unpack the spamy messages. But you can but the spam in any dir you want. Just point salern to your choosen dir.

------------------EDIT----------------------

Updated the howto:

3.Installing qmail amd vpopmail

comment out QMAIL_SMTP_POST="..." at the top of conf-smtp

-----------------EDIT-----------------------

----------

## nianderson

 *SpanKY wrote:*   

> 
> 
> make sure you emerged with USE=ssl and you're using the qmail version i suggested in the howto

 

my flags did include ssl however we are mergng r-15 ebuild ...... maybe there is a problem with the ebuild?

----------

## happy

 *SpanKY wrote:*   

>  *nianderson wrote:*   when i try to send mail with auth and tls with plain i get 
> 
> ```
> 
> Sending Failed:
> ...

 

TLS works fine with spamcontrol if you use it with version 2.2.5. I've got both here if you would like to give it a try:

http://www.trustworthy.net/spamcontrol-225.tgz

http://www.trustworthy.net/spamcontrol-tls-2.2.5.patch

Again, this is against the vanilla qmail source.

----------

## blubbi

 *nianderson wrote:*   

>  *SpanKY wrote:*   
> 
> make sure you emerged with USE=ssl and you're using the qmail version i suggested in the howto 
> 
> my flags did include ssl however we are mergng r-15 ebuild ...... maybe there is a problem with the ebuild?

 

I don't know how it works with kmail, try telnet. after connect type starttls

this works for me ... Try to enable tls somwhere in kmail.

But wondering about a thing: 

my /var/log/qmail/qmail-smtpd/current

stays empty .... even if I send a message via telnet .... curious .... someone else out here with an empty log ??

```
root     21351     1  0 17:04 pts/0    00:00:00 /usr/bin/svscan /service

root      8184 21351  0 17:04 pts/0    00:00:00 supervise qmail-send

root      6731 21351  0 17:04 pts/0    00:00:00 supervise log

root     12677 21351  0 17:04 pts/0    00:00:00 supervise qmail-smtpd

root     17731 21351  0 17:04 pts/0    00:00:00 supervise log

qmails    7878  8184  0 17:04 pts/0    00:00:00 [qmail-send]

vpopmail 28979 12677  0 17:04 pts/0    00:00:00 [tcpserver]

qmaill   31885 17731  0 17:04 pts/0    00:00:00 /usr/bin/multilog t s2500000 n10 /var/log/qmail/qmail-smtpd

qmaill   16213  6731  0 17:04 pts/0    00:00:00 /usr/bin/multilog t s2500000 n10 /var/log/qmail/qmail-send

root     11549  7878  0 17:04 pts/0    00:00:00 qmail-lspawn |dot-forward .forward?./.maildir/

qmailr   27839  7878  0 17:04 pts/0    00:00:00 [qmail-rspawn]

qmailq   22473  7878  0 17:04 pts/0    00:00:00 [qmail-clean]

root     31195 23207  0 17:06 pts/0    00:00:00 ps -ef
```

everything seems to be wonderfull  :Smile: 

----------

## blubbi

problem solved ......

I forgot "-v" in tcpserver options  :Smile: 

----------

## outspoken

hey blubbi, or anyone who has recently done a 'salearn' for their spamassassin with all of the files downloaded:

about how many dots show up on the screen when it is done learning?

this is how many i have now:

......................

and its been running for 2 days! =P if its one dot per file then i have a long, long ways to go. any rough idea on how many? 4/5 lines worth of dots, etc etc. i wish it showed a percentage instead, or time estimation.

----------

## nianderson

i did it a few days ago off blubis howto it was over 80 i believe

----------

## destr0yr

Hi.  I'm having difficulties when emerging qmail-scanner 1.20.  I am using the line

```

ACCEPT_KEYWORDS="~x86" emerge qmail-scanner

```

and it poops out the following error

```

>>> md5 src_uri ;-) qmail-scanner-1.20.tgz

>>> Unpacking source...

>>> Unpacking qmail-scanner-1.20.tgz to /var/tmp/portage/qmail-scanner-1.20/work

 * Replacing obsolete head/tail with POSIX compliant ones

 * Adding items to the SILENT_VIRUSES list (bagle,beagle,mydoom,sco,maldal,mimail,novarg,shimg)

 * Forcing use of clamscan instead of clamuko due to detection bug

>>> Source unpacked.

Building Qmail-Scanner 1.20...

Fatal Error: Qmail-Scanner must be installed and run as a separate

account.

Please create the username and group "qscand" before continuing.

e.g.

groupadd qscand

useradd -c "Qmail-Scanner Account" -g qscand  -s /bin/false qscand

!!! ERROR: net-mail/qmail-scanner-1.20 failed.

!!! Function src_compile, Line 58, Exitcode 1

!!! ./configure failed!

```

not sure what other logs/error messages i can post... any suggestions?

----------

## blubbi

 *destr0yr wrote:*   

> 
> 
> ```
> 
> ACCEPT_KEYWORDS="~x86" emerge qmail-scanner
> ...

 

you posted your answere self  :Smile: 

of some reason the group "qscand" hasn't been created yet. Create it and it should work

```
groupadd qscand

useradd -c "Qmail-Scanner Account" -g qscand  -s /bin/false qscand
```

----------

## blubbi

 *outspoken wrote:*   

> hey blubbi, or anyone who has recently done a 'salearn' for their spamassassin with all of the files downloaded:
> 
> about how many dots show up on the screen when it is done learning?
> 
> this is how many i have now:
> ...

 

hehe how fast is your PC ??? It took a very long time 1 Day or 2 (I started it in a screen and forgott it  :Smile:  So I actuallly cannot say if it tooks a day or 2 on a PIV 3000 with 1GB of RAM. But there were a lot more dots  :Smile:  HANG ON  :Smile: 

----------

## nianderson

see i have an 800 mhz and it only took me like 6-8 hours

----------

## outspoken

 *nianderson wrote:*   

> see i have an 800 mhz and it only took me like 6-8 hours

 

how could you have a p3 800Mhz (or duron?) and it only take 6-8 hours, but blubbi's took him 1-2 days for a P4 3Ghz! That makes no sense at all. Perhaps you didn't download all of the updates?

It's going to be taking me a long time still. =/

----------

## nianderson

yeh i was supprised. i may have not gotten all the updates. ... its a p3 866 with 512 meg pc133

----------

## blubbi

I forgott I ran emereg -UD world at the same Time (kde3.2.0 and other large packages ...) sorry for the confusion  :Smile:  Ah, thats not good, If you have 5 screens at once running .... I happened to run a screen session in a screen session this was the update session in the salearn session .... out of the eyes, out of the mind  :Smile: 

So no Idea how long it took. *G*

----------

## blubbi

by the way, there is a new version of clamav 0.70-rc. It's not in the portage system, but just follow these steps (the new version works fine on my system):

* cd /usr/src/distfiles/

* wget http://heanet.dl.sourceforge.net/sourceforge/clamav/clamav-0.70-rc.tar.gz

* mv clamav-0.70-rc.tar.gz clamav-0.70.tar.gz

* mv /usr/portage/net-mail/clamav/clamav-0.67.ebuild /usr/portage/net-mail/clamav/clamav-0.70.ebuild

* /etc/init.d/clamd stop

* emerge /usr/portage/net-mail/clamav/clamav-0.70.ebuild

* /etc/init.d/clamd start

* freshclam

----------

## eltech

ok .. so i tried to install qmailadmin using the same method as stated here.. i tried this before on my own before reading this thread and after having problems and searching i found this thread and thought its relative to the question i have ..

when i get to the qmailadmin sign in page .. i acan sign in, but no accounts are present. Note: this is for every domain i host ..

Its not much info .. 

but.. anyone have a clue as to whats happening?

Why i cant get any users or domain mail info using qmailadmin?

Suggestions ..

----------

## Skywacker

Anyone tell me how I can have qmail-scanner notify an admin email address when viruses are detected? Following this howto the emails are block, the sender is notified, but thats it. I would like to be notified as well when my user gets them. 

When using these ebuilds I'm not sure how to alter the default configuration. If I can adjust this post install, I also don't know where any qmail-scanner or fprot configuration files are.

Thanks,

Skywacker

----------

## Skywacker

to answer my own question in case anyone else wants to know in the future-

edit /var/qmail/bin/qmail-scanner-queue.pl to adjust the virus detection notifications. It was already setup by default to alert both the sender and admin. I had forgotten my admin account wasn't forwarding to my main email account on my new setup so I wasn't seeing these admin warnings.

-Skywacker

----------

## blubbi

 *eltech wrote:*   

> ok .. so i tried to install qmailadmin using the same method as stated here.. i tried this before on my own before reading this thread and after having problems and searching i found this thread and thought its relative to the question i have ..
> 
> when i get to the qmailadmin sign in page .. i acan sign in, but no accounts are present. Note: this is for every domain i host ..
> 
> Its not much info .. 
> ...

 

do you have added user to the domain ?? do you see the postmaster account ?? Have you tryed to look up a user with "vuserinfo" ??

more info pleas

----------

## blubbi

 *Skywacker wrote:*   

> to answer my own question in case anyone else wants to know in the future-
> 
> edit /var/qmail/bin/qmail-scanner-queue.pl to adjust the virus detection notifications. It was already setup by default to alert both the sender and admin. I had forgotten my admin account wasn't forwarding to my main email account on my new setup so I wasn't seeing these admin warnings.
> 
> -Skywacker

 

*G* I just wanted you to redirect you to my HowTo  :Smile: 

Edit qmail-scanner-queue.pl  :Smile: 

----------

## slott_hansen

Hmmm, I also have problems loging in. I tried to telnet to my server to see what is going on. I have a server hosting multiple sites so here is an example for vbinvest.dk:

```
$ telnet vbinvest.dk 110

Trying 62.61.137.47...

Connected to vbinvest.dk.

Escape character is '^]'.

+OK Hello there.

USER msh@vbinvest.dk

+OK Password required.

PASS ******

-ERR Login failed.
```

If I try to login with one of the normal user accounts everything works fine - so I guss it's not looking in the mysql database to authenticate... Any suggestions to what might have gone wrong ?

----------

## eltech

 *blubbi wrote:*   

>  *eltech wrote:*   ok .. so i tried to install qmailadmin using the same method as stated here.. i tried this before on my own before reading this thread and after having problems and searching i found this thread and thought its relative to the question i have ..
> 
> when i get to the qmailadmin sign in page .. i acan sign in, but no accounts are present. Note: this is for every domain i host ..
> 
> Its not much info .. 
> ...

 

Dunno why you would ask if those questions ..

As i said ..

```

when i get to the qmailadmin sign in page .. i acan sign in, but no accounts are present. Note: this is for every domain i host ..
```

[rant]why whould i say[/rant] ... you know what .. i wont go there ..

But to answer the question .. 

yes users are added to the domains ..

No postmaster account is not visible ..

yes vuserinfo returns the correct user information ..

my setup is all working correct .. qmail,clamav,qmail-pop3d,vpopmail,spamassassin,qmail-scanner and more ..

qmailadmin seems to be the only thing which doesnt work .. or doesnt work correctly i should say ..

Thanks ..

----------

## slott_hansen

 *slott_hansen wrote:*   

> Hmmm, I also have problems loging in. I tried to telnet to my server to see what is going on. I have a server hosting multiple sites so here is an example for vbinvest.dk:
> 
> ```
> $ telnet vbinvest.dk 110
> 
> ...

 

I just took a closer look my "/etc/courier-imap/pop3d" file and saw that "AUTHMODULES" wasnt changed to use the new auth.  program.  It's not stated in the walkthrough so maybe others have made the same mistake as I  :Smile: 

#AUTHMODULES="authdaemon"

# Use vpopmail auth.

AUTHMODULES="authvchkpw"

----------

## slott_hansen

I've been reading all postings on this forum regarding Squirrelmail - I think and not one of them helped me solve my problem  :Sad: 

I have setup everything according to the 10 steps in the begining of this forum and when ever I connect to my mail server using Squirrelmail I get the following error message (FEJL = Error - it's danish language):

```
FEJL:

ERROR : Connection dropped by imap-server.
```

I tried to access the mail account  using telnet to port 110 with the same user - and it works.  I also tried establishing an imap connection from my outlook - but again it fails.

Can anyone tell me where I made a mistake ?

I even ran a strace on the process and this is what I get:

```
[pid 18676] read(0, "A001 LOGIN \"msh@vbinvest.dk\" \"ra"..., 8192) = 43

[pid 18676] rt_sigaction(SIGCHLD, {SIG_DFL}, {SIG_DFL}, 8) = 0

[pid 18676] wait4(-1, 0xbfffb6c0, 0, NULL) = -1 ECHILD (No child processes)

[pid 18676] alarm(0)                    = 60

[pid 18676] close(3)                    = -1 EBADF (Bad file descriptor)

[pid 18676] open("/dev/null", O_RDWR)   = 3

[pid 18676] pipe([4, 5])                = 0

[pid 18676] fork(Process 18678 attached

)                      = 18678

...

...

[pid 18676] execve("/usr/lib/courier-imap/authlib/authvchkpw", ["/usr/lib/courier-imap/authlib/au"..., "/usr/sbin/courier-imapd", "Maildir"], ["ADDRESS=0", "IMAP_USELOCKS=0", "IMAP_TLS_REQUIRED=0", "IMAPDSSLSTART=NO", "TLS_PROTOCOL=TLS1", "IMAP_ENHANCEDIDLE=0", "IMAP_DISABLETHREADSORT=0", "TLS_CERTFILE=/etc/courier-imap/i"..., "AUTHMODULES_ORIG=authdaemon", "IMAP_IDLE_TIMEOUT=60", "IMAP_CAPABILITY_TLS=IMAP4rev1 UI"..., "MAXDAEMONS=40", "TLS_VERIFYPEER=NONE", "TLS_CACHESIZE=524288", "IMAP_CAPABILITY_TLS_ORIG=IMAP4re"..., "MAXPERIP=4", "IMAP_CAPABILITY=IMAP4rev1 UIDPLU"..., "TLS_STARTTLS_PROTOCOL=TLS1", "PWD=/var/vpopmail/domains/vbinve"..., "MAILDIR=Maildir", "IMAP_ULIMITD=65536", "TLS_CACHEFILE=/var/lib/courier-i"..., "HEADERFROM=X-IMAP-Sender", "DEBUG_LOGIN=0", "PIDFILE=/var/run/imapd.pid", "SSLPORT=993", "IMAPDSTART=YES", "SHLVL=1", "IMAP_CHECK_ALL_FOLDERS=0", "IMAP_EMPTYTRASH=Trash:7", "TCPDOPTS=-nodnslookup -noidentlo"..., "IMAP_TRASHFOLDERNAME=Trash", "COURIERTLS=/usr/sbin/couriertls", "IMAP_OBSOLETE_CLIENT=0", "AUTHMODULES=authvchkpw", "PORT=143", "IMAP_CAPABILITY_ORIG=IMAP4rev1 U"..., "SSLADDRESS=0", "SSLPIDFILE=/var/run/imapd-ssl.pi"..., "IMAPDSTARTTLS=YES", "IMAP_MOVE_EXPUNGE_TO_TRASH=0", "SENDMAIL=/usr/sbin/sendmail", "_=/usr/lib/courier-imap/couriert"..., "TCPREMOTEIP=::ffff:127.0.0.1", "TCPREMOTEPORT=41120", "TCPLOCALIP=::ffff:127.0.0.1", "TCPLOCALPORT=143", "AUTHUSER=/usr/sbin/imaplogin", "AUTHENTICATED=", "AUTHARGC=4", "AUTHARGV0=/usr/sbin/imaplogin", "AUTHARGV1=/usr/lib/courier-imap/"..., "AUTHARGV2=/usr/sbin/courier-imap"..., "AUTHARGV3=Maildir", "AUTHEXPIRE=1079795430", "PROTOCOL=IMAP", "IMAPLOGINTAG=A001"] <unfinished ...>

[pid 18678] <... close resumed> )       = -1 EBADF (Bad file descriptor)

[pid 18676] <... execve resumed> )      = 0

[pid 18678] close(5)                    = 0

[pid 18676] uname( <unfinished ...>
```

----------

## Skywacker

Well Squirrel mail connects via IMAP. You telneted into the POP3 port. Make sure your IMAP server is running.

----------

## slott_hansen

I know I tested with port 110 (pop3) but I assure you IMAP is up and running  :Smile: 

```
[msh@wild_swan msh]$ telnet vbinvest.dk 143

Trying 62.61.137.47...

Connected to vbinvest.dk.

Escape character is '^]'.

* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE] Courier-IMAP ready. Copyright 1998-2003 Double Precision, Inc.  See COPYING for distribution information.
```

Tadaaaaa....

But I have no idea how to manually talk to the IMAP server the same way I did with the pop3 server - anyone know how to ?

----------

## slott_hansen

I found out how to telnet to port 143 and here is the result.

```
[msh@wild_swan msh]$ telnet vbinvest.dk 143

Trying 62.61.137.47...

Connected to vbinvest.dk.

Escape character is '^]'.

* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE] Courier-IMAP ready. Copyright 1998-2003 Double Precision, Inc.  See COPYING for distribution information.

1 login msh@vbinvest.dk ******

Connection closed by foreign host.

```

As you can se I get kicked out right away. Looking in the log file I see the following.

```
Mar 21 13:01:15 [imapd] Connection, ip=[::ffff:213.237.10.36]

Mar 21 13:01:15 [imapd] LOGIN: DEBUG: ip=[::ffff:213.237.10.36], command=CAPABILITY

Mar 21 13:01:15 [imapd] LOGIN: DEBUG: ip=[::ffff:213.237.10.36], command=LOGIN

Mar 21 13:01:15 [imapd] LOGIN: DEBUG: ip=[::ffff:213.237.10.36], username=msh@vbinvest.dk

Mar 21 13:01:15 [imapd] LOGIN: DEBUG: ip=[::ffff:213.237.10.36], password=******

Mar 21 13:01:15 [imapd] setgid: Operation not permitted
```

Does anyone have a clue to what is going on here ? I have a hunch it has something to do with permissions but I even tried to du a chmod a+rwx on my mail folders but that didnt helt...

----------

## nianderson

 *eltech wrote:*   

> ok .. so i tried to install qmailadmin using the same method as stated here.. i tried this before on my own before reading this thread and after having problems and searching i found this thread and thought its relative to the question i have ..
> 
> 

 

which method?

there is blubbis howto and the one at the begining of the thread

----------

## eltech

Well .. i dunno bout this blubiss .. or whatever it is ..

I  tried installing qmailadmin similar to the begining of this thread .. 

can you direct me to this blubis method .. 

thanks..

----------

## blubbi

You'll find my howto here:

Qmail-Howto

It is updated as soon as nianderson or I make any new "discoveries"  :Smile: 

----------

## blubbi

 *outspoken wrote:*   

> hey blubbi, or anyone who has recently done a 'salearn' for their spamassassin with all of the files downloaded:
> 
> about how many dots show up on the screen when it is done learning?
> 
> this is how many i have now:
> ...

 

Jupp, it's one dot for one file. Just tested it  :Smile: 

----------

## Skywacker

Blubbi-

You can confirm that the pop-before-smtp works via your howto. I used your howto for that portion and it's working for me.

Thanks a lot!

-Skywacker

----------

## eltech

 *blubbi wrote:*   

> You'll find my howto here:
> 
> Qmail-Howto
> 
> It is updated as soon as nianderson or I make any new "discoveries" 

 Thanks for the link .. very nice howto ..   :Wink:  however; this takes me into the x86 tree and i dont want to go there .. cat afford to take the chance of downtime and fixing things ..

----------

## Skywacker

Just use whats in portage then. Works for me.

Though i havent had time to verify if smtp auth is working since pop-before-smtp is working.

Also, read up for Spanky's tut. It uses what is in portage without bleeding edge.

-Sky

----------

## eltech

 *Skywacker wrote:*   

> Just use whats in portage then. Works for me.
> 
> Though i havent had time to verify if smtp auth is working since pop-before-smtp is working.
> 
> Also, read up for Spanky's tut. It uses what is in portage without bleeding edge.
> ...

 

qmailadmin is not in the stable portage tree ..

----------

## smukec

I haven't got /var/spool/qmailscan and qmailctl which are mentioned in some posts. 

Can these be the reason?

----------

## Skywacker

Eltech- qmailadmin- you are correct, but this howto has you install it manually from source.

Blubbi - regarding your howto: i just updated my qmail-scanner to 1.2 and used your section 6 to get it working. where you said: "do chown -R qscand:vpopmail /var/spool/qmailscan && chmod -R 664 /var/spool/qmailscan/* and try again"

It needs to be qmaild not qscand as the user. Once I did this all was well. 

-Sky

PS. I actually used all three howto's to get things working. This thread for everything from the beginning. Then Blubbi's for Pop-before-smtp, and then Spanky's for ssl-enable pop/imap and smtp-auth. Still working on the ssl stuff.

----------

## eltech

 *Skywacker wrote:*   

> Eltech- qmailadmin- you are correct, but this howto has you install it manually from source.
> 
> Blubbi - regarding your howto: i just updated my qmail-scanner to 1.2 and used your section 6 to get it working. where you said: "do chown -R qscand:vpopmail /var/spool/qmailscan && chmod -R 664 /var/spool/qmailscan/* and try again"
> 
> It needs to be qmaild not qscand as the user. Once I did this all was well. 
> ...

  um .. you may be a bit behind .. i have already tried installing from source .. read back some ..

thanks ..

----------

## Skywacker

Well, I apologize for not fully reading when giving you a response.

After reading your posts again, only thing i can possibly add is that I am running apache as vpopmail.vpopmail, and the perms on qmailadmin are "-rwsr-sr-x    1 vpopmail vpopmail   214008 Feb 27 03:03 qmailadmin"

I phrasing this poorly, but also think about if vpopmail domains/users/passwords being kept in MySQL. Perhaps qmail is setup to not look inside MySQL. But if you can log in as postmaster, I doubt it.

Not that it will help, but out of curiosity, can you log into qmailadmin as non-postmaster users? 

-Sky

----------

## Skywacker

FYI-

when updating to qmail-scanner 1.20 the options for spamd are kept in /etc/conf.d/spam instead of /etc/conf.d/spam.conf.

This is noted somewhat in Blubbi's howto, but I'm just saying that it's qmail-scanner being updated that breaks/changes this. 

I kept getting a bunch of this in my logs till i figured out why:

" cmrlmail spamd[9428]: connection from localhost [127.0.0.1] at port 50583

Mar 22 18:40:45 cmrlmail spamd[9553]: handle_user: unable to find user 'user@domain'!

Mar 22 18:40:45 cmrlmail spamd[9553]: Still running as root: user not specified with -u, not found, or set to root.  Fall back to nobody.

Mar 22 18:40:45 cmrlmail spamd[9553]: checking message (unknown) for user@domain:65534.

Mar 22 18:40:47 cmrlmail spamd[9553]: identified spam (8.8/5.0) for user@domain:65534 in 1.6 seconds, 10167 bytes.

"

----------

## jbmohler

I've just installed a fresh emerge of courier.  I can sendmail to myself and get messages in ~/Maildir/ since I've changed the config to point to Maildir (rather than .maildir).

pop3d and imapd seem to point to Maildir as in /etc/courier/pop3d

```

POP3DSTART=YES

##NAME: MAILDIRPATH:0

#

# MAILDIRPATH - directory name of the maildir directory.

#

MAILDIRPATH=Maildir

```

However, after starting courier, I get the following output with getmail.

```

getmail started for joel@friedrich:110

  POP3 greeting:  +OK Hello there.

  POP3 user response:  +OK Password required.

  POP3 protocol error (-ERR Maildir: No such file or directory) (joel@friedrich:110)

Resetting connection and aborting (POP3 protocol error (-ERR Maildir: No such file or directory) (joel@friedrich:110))

getmail finished for joel@friedrich:110

```

I get a different error when I bork my password in the getmailrc, so it seems to be a configuration error.

The strangest thing of all is if I change the MAILDIRPATH=Maildir in the pop3d config file to something totally bizarre I still get "-ERR Maildir: ...".  

Where is pop3d attempting to get it's messages from?  Did anyone else have this problem?

thanks

Joel

----------

## eltech

 *Skywacker wrote:*   

> Well, I apologize for not fully reading when giving you a response.
> 
> After reading your posts again, only thing i can possibly add is that I am running apache as vpopmail.vpopmail, and the perms on qmailadmin are "-rwsr-sr-x    1 vpopmail vpopmail   214008 Feb 27 03:03 qmailadmin"
> 
> I phrasing this poorly, but also think about if vpopmail domains/users/passwords being kept in MySQL. Perhaps qmail is setup to not look inside MySQL. But if you can log in as postmaster, I doubt it.
> ...

 ok .. well here is my qmailadmin dir ...

```

-rwsr-sr-x    1 vpopmail vpopmail   297619 Mar 19 20:09 qmailadmin
```

My Apache runs as apache.apache ..

I dont have vpopmail working with mysql ..

Yes i can login as a regular user and modify user settings only ...

EDIT:

Just curous .. should anything pertaining to vpopmail (vadduser,etc) be within the cgi-bin directory?

EDIT2:   :Wink: 

I can add a user with no problem ..

EDIT3: ..

I can also set and view forward aliases ..

Just cant see and accounts .. under email accounts

----------

## petterg

Thanks for this great howto!

I'm totally new to gentoo. Just switched from RH9. So far I love it!

I'm reading through this thread, got to posts dated March 8th. I know that if I don't respond now, I will forget, so excuse me if this is already answered in some postes I have not yet read.

There is quite a lot of ppl having trouble with vpopmail.conf after installing version 5.4. I had it too, but figured it out:

Here's the thing the smpt part requires a vpopmail.conf to be like this:

```

# Read-only DB

localhost|0|vpopmail|password|vpopmail

# Write DB

localhost|0|vpopmail|password|vpopmail

```

However the pop / imap still tries to read this:

```

MYSQL_UPDATE_SERVER     localhost

MYSQL_UPDATE_USER       vpopmail

MYSQL_UPDATE_PASSWD     password

 

MYSQL_READ_SERVER       localhost

MYSQL_READ_USER         vpopmail

MYSQL_READ_PASSWD       password

```

To make both parts happy you can do this:

```

# Read-only DB

localhost|0|vpopmail|password|vpopmail

# Write DB

localhost|0|vpopmail|password|vpopmail

MYSQL_UPDATE_SERVER     localhost

MYSQL_UPDATE_USER       vpopmail

MYSQL_UPDATE_PASSWD     password

 

MYSQL_READ_SERVER       localhost

MYSQL_READ_USER         vpopmail

MYSQL_READ_PASSWD       password

```

Hope this helps someone.

MY PROBLEMS

What I have problems with is SMTP-AUTH and SPAM.

The smpt-auth works.... kind of. I can provide a username and a password, and send mails using the smtp server. If I enter the wrong user and/or password, I can not send mails. So far, so good. But here's the thing: If someone wants to make use of my smtp server, someone who are not supposed to be able to use it, makes the sender adress look like an exsisting user on my domain, they don't need to authorize!

Lets say my domain is pgdom.com. If some guy is sending a mail to someone@somewhere.com using my smtp server, and puts postmaster@pgdom.com in the <from> field (or any other users on my server) he is able to missuse my smtp server.

The other problem, which probebly is at least 3 problems is:

#spamc -c < spam-nasty.eml

returns 0/0

I think I've tried all the tricks listed in this thread, but it still doesn't work!

Eventhough spamc doesn't detect anything, isn't is supposed to be a headerfield in the incomming mails indicating that it has passed trough a spamcheck? I don't get anything like that. However I do get a header field saying the mail is checked for viruses.

My server often get virus infected mails sent to [some unknown user]@pgdom.com. Is there any way to just drop these mails? It is really pointless that the server stores a new infected mail every 10 minuttes when it wasn't even adressed to any of my users! It is also wased resources that it responds to the sender saying that it found a virus in these cases, and notifies postmaster.

And last, but not least, I need a spamfilter that totally drops all mails with postmaster@[whatever] or mailer-deamon@[whatever] addressed to [some unknown user]@pgdom.com, without wasting resources on checking for further spam or viruses. Nor sending any reply to the fake-sender nor postmaster@pgdom.com about it.

My server receives between 14.000 and 36.000 of these mails everyday, wich is quite a lot for a server serving only 5 users!

Thank you all.

-pg

----------

## 9uSt00

 *petterg wrote:*   

> To make both parts happy you can do this:
> 
> ```
> 
> # Read-only DB
> ...

 

Schweet!! thank you that was exactly what i needed!  there you go, you did help someone!  :Smile: 

-gZZt00

----------

## ja

Hi, 

everything is working fine for me (used this and the howto on gentoo.org)

I've got only one problem.

My Setup:

Local Users have their personal .maildir in /home for:

domain1.com

and i've added

domain2.com

domain3.com

domain4.com

to vpopmail.

Everything works but courier only works for the vpopmail domains, shell users of /home have no problem using mutt... but how to get courier also working for them?

in authdaemonrc i've done:

authmodulelist="authvchkpw"

Every guide says to ONLY add this module, but local users can't auth now. According to the logs their are not known.

So is there a way to get it working for both kinds of users?

----------

## jbmohler

Hi,

thought I would reply to my own note above with a solution which I found (appears like a bit of bug to me).

In the file '/usr/sbin/courier-pop3d', the final line passes the path based from the user home directory which houses the pop3 mail.  Thus, it appears that the default gentoo install of courier ignores this setting in the '/etc/courier/pop3d' file.

I haven't looked into how to fix this at all.

-Joel

----------

## petterg

Ok, so tried the howto at http://www.gentoo.org/doc/en/qmail-howto.xml on a 3rd server. There I got spam checking and smtp-auth working. At least that is what it looks like in the log. This server does not put mails in the mailboxes! (I have no idea of where they go!)

While the two servers I put up using the howto in this thread are sending and recieving mail, but does not do any spam-check nor smtp-auth.

It's time to compare config files.

---

There is still a couple of things I need some help to figure out:

My server often get virus infected mails sent to [some unknown user]@mydomain.com. Is there any way to just drop these mails? It is really pointless that the server stores a new infected mail every 10 minuttes when it wasn't even adressed to any of my users! It is also wasted resources that it responds to the sender saying that it found a virus in these cases. Just as pointless to fill the postmaster mailbox with this.

And I also need a spamfilter that totally drops all mails from postmaster@[whatever] or mailer-deamon@[whatever] addressed to [some unknown user]@mydomain.com, without wasting resources on checking for further spam or viruses. Nor sending any reply to the fake-sender nor postmaster@pgdom.com about it. 

My server receives between 14.000 and 36.000 of these mails everyday, wich is quite a lot for a server serving only 5 users! Storing them takes up a lot of space - sending replys is killing my 768kbit upload capacity!

Once again, thanks for these two great howtos.

-pg

----------

## blubbi

 *Skywacker wrote:*   

> Blubbi-
> 
> You can confirm that the pop-before-smtp works via your howto. I used your howto for that portion and it's working for me.
> 
> Thanks a lot!
> ...

 

THX for the reply that a good news  :Smile: 

----------

## blubbi

 *Skywacker wrote:*   

> Eltech- qmailadmin- you are correct, but this howto has you install it manually from source.
> 
> Blubbi - regarding your howto: i just updated my qmail-scanner to 1.2 and used your section 6 to get it working. where you said: "do chown -R qscand:vpopmail /var/spool/qmailscan && chmod -R 664 /var/spool/qmailscan/* and try again"
> 
> It needs to be qmaild not qscand as the user. Once I did this all was well. 
> ...

 

THX a lot I will update my HowTo as soon as possible.

----------

## blubbi

 *Skywacker wrote:*   

> FYI-
> 
> when updating to qmail-scanner 1.20 the options for spamd are kept in /etc/conf.d/spam instead of /etc/conf.d/spam.conf.
> 
> This is noted somewhat in Blubbi's howto, but I'm just saying that it's qmail-scanner being updated that breaks/changes this. 
> ...

 

have you specified the correct user "-u someuser" in spamd ?

SPAMD_OPTS="-d -u vpopmail -v -L -x -C /usr/share/spamassassin/local.cf"

----------

## petterg

Those who have trouble with smtp-auth may have forgotten to do this:

chmod 4711 /var/vpopmail/bin/vchkpw

----------

## petterg

Does anyone else have trouble with spamc spending upto 60 seconds checking each mail?

Any clues why it is so slow? I haven't changed any settings relevant to spamassassin other than those mentioned in this howto.

----------

## Sull

i got some problem with mysql  and vpopmail

igot this error when i try to add a domain

 *Quote:*   

> Please enter password for postmaster: 
> 
> enter password again: 
> 
> Failure while attempting to remove_line() the locals file
> ...

 

and when i try to add a user

 *Quote:*   

> vmysql: sql error[3]: Table 'vpopmail.vpopmail' doesn't exist
> 
> Error: Unable to chdir to vpopmail/domains directory
> 
> 

 

and that is my vpopmail.conf

 *Quote:*   

> # Read-only DB
> 
> localhost|0|vpopmail|topsecret|vpopmail
> 
> # Write DB
> ...

 

what can i do?

* i already have deleted and remake the sql database*

----------

## Skywacker

Further update on this- 

At 3am a my daily cron job ran this script: /etc/cron.daily/qmail-scanner

It's contents were: 

#!/bin/bash

/var/qmail/bin/qmail-scanner-queue -z

This reset the permissions on /var/spool/qmailscan and mail stopped being accepted/delivered.

qmail-scanner-queue-version.txt was getting reset to qscand.root with 600 permissions. I tried mutiliple owner/group's but they were always reset. 

I ultimately added this line to /etc/cron.daily/qmail-scanner:

chmod +r /var/spool/qmailscan/qmail-scanner-queue-version.txt

Now everything works perfectly. 

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

 *blubbi wrote:*   

>  *Skywacker wrote:*   Blubbi - regarding your howto: i just updated my qmail-scanner to 1.2 and used your section 6 to get it working. where you said: "do chown -R qscand:vpopmail /var/spool/qmailscan && chmod -R 664 /var/spool/qmailscan/* and try again"
> 
> It needs to be qmaild not qscand as the user. Once I did this all was well. 
> 
>  
> ...

 

----------

## Skywacker

 *blubbi wrote:*   

>  *Skywacker wrote:*   FYI-
> 
> when updating to qmail-scanner 1.20 the options for spamd are kept in /etc/conf.d/spam instead of /etc/conf.d/spam.conf.
> 
> This is noted somewhat in Blubbi's howto, but I'm just saying that it's qmail-scanner being updated that breaks/changes this. 
> ...

 

Blubbi-

I was just saying that qmail-scanner started looking in a different config file when I updated. Copying the contents of spamd.conf to spamd is all I needed to do to get it to work. 

-Sky

----------

## skh

beat me if this has been answered yet but shouldnt this whole thing work so that all users have a .maildir dir in their homedir to wich all mail is delivered and which is used by courier-imap?

i got all that working and i encountered no probs with auth and stuff (at least none i couldnt figure out yet) the only thing is that courier-imap reads from /var/vpopmail/domains/mydomain.bleh/mailman/.maildir instead of /home/mailman/.maildir.

however qmail and all the other progs seem to work right since i never get any mail to that dir but to .maildir in the homedir (which is exactly what i want).

please somebody enlighten me.

any hints really really much appreciated

thanks in advance

----------

## Skywacker

The setup following the 3 howto's in this thread (my setup is a hybrid of them all), will put mail in /var/vpopmail/domains/mydomain.com/skywacker/.maildir/

If you want things in /home/skywacker/.maildir, just make a link one way or the other.

ln -s /var/vpopmail/domains/mydomain.com/skywacker/ /home/skywacker/

If you have tons of accounts/domains and your /home is your large partition, just move the entire /var/vpopmail/domains over there and create a link.

-Skywacker

----------

## skh

thats what i had in mind as some kind of 'last option'

perhaps there is a way thats a bit more elegant?

i bet its possible to config all the stuff to use home maildirs isnt there?

i already searched through the forum and googled around but i somehow couldnt find anything on this

edit:

btw mail *is* delivered to /home/mailman/.maildir and not to the vpop domain dir

the only thing that doesnt work right is imap

----------

## petterg

Have anyone figured out why smtp-auth works with the howto at 

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

and not with the howto in this thread?

I've done 2 installs using the linked howto, and smtp-auth works in both. I've also done 2 installs using the howto in this thread, and smtp-auth does not work in any of them. Then, fianlly I made a install mixing them where I followed the linked howto with everything I can imagine beeing relevant to smtp-auth, but still smtp-auth didn't work!

One thing I figured out while using the linked howto... This happened to me on all 2+1 installs using that howto: It didn't store any mails. According to the log, mails got in, passed the clamav and spam scanning, and disapared. No logs gave any clues what went wrong.

The solution turned out to be deleting the domain using vdeldomain (and all domain aliases) and recreate them using vadddomain.

----------

## blubbi

 *Skywacker wrote:*   

> Further update on this- 
> 
>  *blubbi wrote:*    *Skywacker wrote:*   Blubbi - regarding your howto: i just updated my qmail-scanner to 1.2 and used your section 6 to get it working. where you said: "do chown -R qscand:vpopmail /var/spool/qmailscan && chmod -R 664 /var/spool/qmailscan/* and try again"
> 
> It needs to be qmaild not qscand as the user. Once I did this all was well. 
> ...

 

This didn't work for me ... I cant figure out which user I have to use.

----------

## Skywacker

well, the script run by cron.daily called qmail-scanner changed my permissions and ownership of my /var/spool/qmailscan/qmail-scanner-queue-version.txt file. 

Is this true for you?

I found no matter what perms/owner I had on this file it didnt matter because they got reset daily. 

chmod +r on the file solved it for me. Is this what you are saying didn't work for you?

-Sky

----------

## blubbi

 *Skywacker wrote:*   

> well, the script run by cron.daily called qmail-scanner changed my permissions and ownership of my /var/spool/qmailscan/qmail-scanner-queue-version.txt file. 
> 
> Is this true for you?
> 
> I found no matter what perms/owner I had on this file it didnt matter because they got reset daily. 
> ...

 

my problem is: I am running world readable on /var/spool/qmail-scanner/

```

drwxrwxrwx    6 qmaild   vpopmail     4.0K Mar 17 10:40 ./

drwxr-xr-x   11 root     root         4.0K Mar 17 09:51 ../

-rwxrwxrwx    1 qmaild   vpopmail        0 Mar 17 10:38 .keep*

drwxrwxrwx    5 qmaild   vpopmail     4.0K Dec  6 18:06 archive/

-rwxrwxrwx    1 qmaild   vpopmail     103K Mar 31 21:26 mailstats.csv*

-rwxrwxrwx    1 qmaild   vpopmail     2.1M Mar 31 21:26 qmail-queue.log*

-rwxrwxrwx    1 qmaild   vpopmail     8.4K Mar 10 17:27 qmail-queue.log.mail*

-rwxrwxrwx    1 qmaild   vpopmail       59 Mar 17 10:40 qmail-scanner-queue-version.txt*

drwxrwxrwx    5 qmaild   vpopmail     4.0K Dec  6 18:06 quarantine/

-rwxrwxrwx    1 qmaild   vpopmail      12K Mar 17 10:38 quarantine-attachments.db*

-rwxrwxrwx    1 qmaild   vpopmail     4.2K Mar 17 10:38 quarantine-attachments.txt*

-rwxrwxrwx    1 qmaild   vpopmail      215 Mar 23 14:03 quarantine.log*

drwxrwxrwx    2 qmaild   vpopmail     4.0K Mar 31 21:26 tmp/

lrwxrwxrwx    1 qmaild   vpopmail       14 Mar 17 10:38 viruses.log -> quarantine.log*

drwxrwxrwx    5 qmaild   vpopmail     4.0K Dec  6 18:06 working/

```

this ist not what I want. I want to set the minimal permissions. But I cna not figure aut which user tries to write in the tmp and working dir.

----------

## blubbi

 *Skywacker wrote:*   

> Further update on this- 
> 
> At 3am a my daily cron job ran this script: /etc/cron.daily/qmail-scanner
> 
> It's contents were: 
> ...

 

Why did you add

```
#!/bin/bash

/var/qmail/bin/qmail-scanner-queue -z

```

to a cronjob ??? I don't see any reasons for that !?!?!

----------

## Skywacker

I didn't. It was put there by one of the emerges. Check your /etc/cron.daily/ directory, I bet you have one too.

-Sky

----------

## Skywacker

http://sourceforge.net/projects/qss/

I could not get this to have working graphics until I re-emerged mod_php with gd built in. 

See this thread: https://forums.gentoo.org/viewtopic.php?t=143464&highlight=gd

Pretty cool I think. Now I need something similar for SPAM graphing. 

-Skywacker

----------

## ARC2300

Okay. . .so I finally got at least squirrelmail working with the modified vpopmail.conf someone posted.

However, I can't login with remote clients such as thunderbird from another computer. . .

In the log file, it just says "LOGIN FAILED".  It happens when I use both pop3 and imap.

Any clues?

----------

## Skywacker

You could turning on debugging mode logging of imap and pop3 to see the full extent of what is happening in the login process. When you do, paste the actual log excerpts into this thread.

My quick suggestion without more info:

make sure you are trying to log in with your full email address as your username. 

username= skywacker@domain.com

pass= password

If not, post those actual logs.

-Sky

----------

## biex

When i run this "command"

```
/etc/init.d/courier-pop3d start
```

i get a error

```
 * Starting courier-pop3d...

bind: Address already in use

ll_daemon_start: Resource temporarily unavailable  
```

What to do??? HELP!

Can only send email right now not get... is it because of that or is it something else? 

Thanks!

----------

## nianderson

dang

well i used the doc from gentoo documentation and got a successful install.

was working fine for several days

added some accounts with qmailadmin today and now all email i send gets bounced back saying the user is over quota.

but no quotas are set.

need soem help please

----------

## IWBCMAN

skywacker,

perhaps you could explain something to me...

My mail is being sent to /var/vpopmail/domains/blah/.maildir

so far so good.

Yet nothing lands in my /home/user/.maildir

You addressed a similiar question already by skh.

Yet you suggest linking(ln-s) the .maildir under /var/blah/blah/bla to /home/user/

This sounds good. But mutt simply barfs-of course the permissions are wrong.

/var/blah/blah/blah/.maildir has 

vpopmail:vpopmail

whereas /home/user/.maildir has

user:users

simply linking isn't going to work-unless of course one can change the permissions of /var/blah/blah/blah to user:users.....

Is such ok to do ? is it safe ? would it even work?

(by the way I had run maildirmake in my home directory prior to running mutt-I tried sending some email, the mail was sent-I could read it in horde, but it only made it into the /home/user/.maidir-sent/tmp directory, I don't know if this is significant or not--*blindly* stumbling where angels dare to tread.....)

and while we are on this topic-I wonder how one configures any other email reader

mozilla or evolution or slypheed or balsa etc. to show the incomming mail-I am using courier-imap-ssl w/ qmail/vpopmail/horde

-I've tried to get it working but no luck so far....

----------

## blubbi

I thing you are missunderstanding a thing.

Everybody who install vpopmail wants to supply mailaccounts which are not systemaccounts.

If you just want to provide mail to users who have an systemaccount, install qmail without vpopmail.

Than you mail will end up in /home/user/.maildir or something similar ...

----------

## blubbi

 *nianderson wrote:*   

> dang
> 
> well i used the doc from gentoo documentation and got a successful install.
> 
> was working fine for several days
> ...

 

is smtpAUTH working ????

Where is the difference in the config file ??

Any ideas

----------

## blubbi

 *biex wrote:*   

> When i run this "command"
> 
> ```
> /etc/init.d/courier-pop3d start
> ```
> ...

 

do a 

```
netstat -ntulp
```

 or 

```
netstat -p -a --numeric-ports
```

 and look which prog is running on the port required by pop3d (25).

Terminate this prog and start pop3d.

----------

## Skywacker

 *nianderson wrote:*   

> dang
> 
> well i used the doc from gentoo documentation and got a successful install.
> 
> was working fine for several days
> ...

 

Quotas get set by default with this howto. Not sure where/why this is done, and yes it can be a pain to remember to remove people's quota's.

In any case, verify that there is a quota on the account with 

/var/vpopmail/bin/vuserinfo email@account.com 

and remove the quota with

/var/vpopmail/bin/vsetuserquota email@account.com NOQUOTA

----------

## Skywacker

 *blubbi wrote:*   

> I thing you are missunderstanding a thing.
> 
> Everybody who install vpopmail wants to supply mailaccounts which are not systemaccounts.
> 
> If you just want to provide mail to users who have an systemaccount, install qmail without vpopmail.
> ...

 

I agree with Blubbi. (only ditto-ing cuz my name was asked for an answer). 

Vpopmail is for virtual accounts, not system accounts . I never have used system accounts for mail. If anything I would just create a .qmail file in the user directory to forward the local mail to my virtual account. 

_skywacker

----------

## blubbi

 *Skywacker wrote:*   

>  *nianderson wrote:*   dang
> 
> well i used the doc from gentoo documentation and got a successful install.
> 
> was working fine for several days
> ...

 

QUOTAS can be set or unset with qmailadmin (latest version)

----------

## IWBCMAN

blubbi, skywalker, other GODS who grasp qmail/vpopmail....

yup you were right-I must have had my brain shutdown when I embarked on the tedious process of getting qmail and vpopmail installed....

OK. Now that I *grok* that vpopmail is only for virtual mail-what does this mean ?

a) can I also have a local(system) mail agent setup -parallel to the qmail-vpopmail thingie ? 

b) if so can I use qmail for this or must I install some other mail package for local (system) mail ?

c) beyond getting local(system) mail up and running - I *would* like to use qmail/vpopmail  for hosting my own email address/server- I have dynamic dns(dyndns) configured and am running ddclient which automatically ties iwbcman.homelinux.org to my apache2 server- can qmail/vpopmail be configured to allow me to recieve and send email from this address ?

Ultimately I would like to :

a) have local(system) mail up and running

b) like to use my dnyns domain for sending and recieving emails

c) I would like to be able to use a web browser from another location to browse my local (system) email and my virtual domain email(hopefully I can tie a vpopmail virtual domain to a dyndns email server)

Ok. now the confusion should be complete...

It must be obvious how much I am *suffering* from  confusion -if you, or someone else, could offer some hints, tips etc. it would be greatly appreciated...

thanks

----------

## Pardok

Has anyone figured out the authentication problem?  

I've read through this entire topic and couldn't find an answer.

I've followed the entire How-To several times.....and have everything working.

I can *send* mail through smtp but I cannot receive mail.

Using K-mail, I log into courier-pop3d only to get an authentication denial "User or Password is wrong."  I've used the user login and the user@domain.com login iterations.  Nothing.

Squirrelmail gives me the same error, as does courier-imapd......

I'm pulling my hairout here.  I've done the suggested change from Maildir to .maildir in the .confs......and have run the script many times.

What is causing the auth error?  

In my daemonrc I'm using vchkpwd as the only AUTHMODULELIST......etc.  But can't get any authentication.

Is there any suggestions on how people have solved this?  I have no clue where to being. 

Thanks in advance for any replies.   :Very Happy: 

----------

## blubbi

 *IWBCMAN wrote:*   

> blubbi, skywalker, other GODS who grasp qmail/vpopmail....
> 
> yup you were right-I must have had my brain shutdown when I embarked on the tedious process of getting qmail and vpopmail installed....
> 
> OK. Now that I *grok* that vpopmail is only for virtual mail-what does this mean ?
> ...

 

Qmail _is_ your local mailsystem. If you associate "local mailsystem" as a system, where system accounts are mailaccounts you just have to uninstall vpopmail.

 *Quote:*   

> 
> 
> b) if so can I use qmail for this or must I install some other mail package for local (system) mail ?
> 
> 

 

You can use qmail for this. Uninstall vpopmail and qmail will use the sytemaccounts as mailaccounts and deliver mails to ~/.maildir. If you would like to use vpopmail, just create a the desired maildomain (for example your dyndns name) with vadddomain an add to this domain as many as users you want with vadduser

 *Quote:*   

> 
> 
> c) beyond getting local(system) mail up and running - I *would* like to use qmail/vpopmail  for hosting my own email address/server- I have dynamic dns(dyndns) configured and am running ddclient which automatically ties iwbcman.homelinux.org to my apache2 server- can qmail/vpopmail be configured to allow me to recieve and send email from this address ?
> 
> 

 

local or not ... qmail/vpopmail is a mailserver, if you hav a mailserver up an running, this mailserver is your local mailserver, and if you are not at home, and your server is connected to the internet, its a mailserver which, depending on your configuration, accepts mail from everywhere.

 *Quote:*   

> 
> 
> Ultimately I would like to :
> 
> a) have local(system) mail up and running
> ...

 

Install qmail

 *Quote:*   

> 
> 
> b) like to use my dnyns domain for sending and recieving emails
> 
> 

 

Install qmail

 *Quote:*   

> 
> 
> c) I would like to be able to use a web browser from another location to browse my local (system) email and my virtual domain email(hopefully I can tie a vpopmail virtual domain to a dyndns email server)
> 
> 

 

install squirrelmail or sqwebmail, or any other webbased mailclient to get a webinterface running on your server

 *Quote:*   

> 
> 
> Ok. now the confusion should be complete...
> 
> It must be obvious how much I am *suffering* from  confusion -if you, or someone else, could offer some hints, tips etc. it would be greatly appreciated...
> ...

 

Hope I could help to unconfuse you

----------

## vcihon

First of all, a BIG thank you to everyone who has contributed to this topic (and the others for that matter!) - it was a huge help and greatly appreciated!!!!

I have followed this forum, Blubbi's docs and the Howto from the Gentoo Docs.   However I still have two issues:

1. My pop3 auth is working (I can login and check email from a pop3 client) and vpopmail is working fine with the database (domain and users are created). However, email is being delivered to a local user instead of the virtual one. Furthermore, when I try to send it to a virtual user that doesn't have a local account, it gets rejected.  What should I look for so that all mail gets sent to the /var/vpopmail/domain/<name>/<user>/.maildir and not the local user? Also, I assume this means that vpopmail isn't truly working since my other virtual user without the local account can't recieve email?  Does the user have to be added to the qmail users too?

2. Why does 

```
/var/vpopmail/bin/vuserinfo <username> 
```

 return 

```
no such user as <username>
```

.  I can see the user made in the sql database just fine.

3.  From the Gentoo Howto - when I type:

```
# printf "postmaster@wh0rd.org\0postpass\0blah\0" | vchkpw `which id` 3<&0
```

I do not get anything returned. What should I do?

I have a feeling all of these things are related. . . ya think?   :Embarassed: 

----------

## blubbi

 *vcihon wrote:*   

> First of all, a BIG thank you to everyone who has contributed to this topic (and the others for that matter!) - it was a huge help and greatly appreciated!!!!
> 
> I have followed this forum, Blubbi's docs and the Howto from the Gentoo Docs.   However I still have two issues:
> 
> 1. My pop3 auth is working (I can login and check email from a pop3 client) and vpopmail is working fine with the database (domain and users are created). However, email is being delivered to a local user instead of the virtual one. Furthermore, when I try to send it to a virtual user that doesn't have a local account, it gets rejected.  What should I look for so that all mail gets sent to the /var/vpopmail/domain/<name>/<user>/.maildir and not the local user? Also, I assume this means that vpopmail isn't truly working since my other virtual user without the local account can't recieve email?  Does the user have to be added to the qmail users too?
> ...

 

I guess you installed vpopmail befor qmail .... ahve a look in /var/qmail/users/ if the etries in the files there point to your virtual domains/users

 *Quote:*   

> 
> 
> 2. Why does 
> 
> ```
> ...

 

try 'vuserinfo user@fqdn'

 *Quote:*   

> 
> 
> 3.  From the Gentoo Howto - when I type:
> 
> ```
> ...

 

No Idea, sorry

 *Quote:*   

> 
> 
> I have a feeling all of these things are related. . . ya think?  

 

Good luck

----------

## vcihon

Thanks for the reply.

 *Quote:*   

> I guess you installed vpopmail befor qmail .... ahve a look in /var/qmail/users/ if the etries in the files there point to your virtual domains/users
> 
> 

 

This was a fresh install and I followed the instructions so I install qmail before vpopmail.  Here is the contents for /var/qmail/users:

```
tolkien users # ls -l

total 8

-rw-r--r--    1 root     root           93 Apr 12 04:21 assign

-rw-------    1 root     root            0 Apr 12 04:21 assign.lock

-rw-r--r--    1 root     root         2185 Apr 12 04:21 cdb

tolkien users # cat assign

+alextechstudio.com-:alextechstudio.com:89:89:/var/vpopmail/domains/alextechstudio.com:-::

.

tolkien users # cat cdb

D!alextechstudio.com-:alextechstudio.com:89:89:/var/vpopmail/domains/alextechstudio.com:-::
```

I assume this is correct?

BTW, the user@fqdn fixed the vuserinfo. Thanks.

----------

## Pardok

Blubbi, Sabrex, Anyone, 

please help!

I've followed Blubbi's How-To to the letter.  Everything seems to be running fine.  I am able to setup email accounts with Qmail admin and such.

However, I CANNOT LOG IN AS A USER.  The username and password ARE correct (even identitical to /etc/passwd).

To test out my configuration, I sent an e-mail to a newly created user as root@mydomain.com using mutt.

The mail is sitting in the users Vpopmail account, but I cannot retrieve it.  Squirrelmail, Kmail, even Mutt give me a "Unknown user or bad password." error whenever I try to login.

I don't know what's wrong!  

Here's my Authdamonrc:

```

##VERSION: $Id: authdaemonrc.in,v 1.8 2001/10/07 02:16:22 mrsam Exp $

#

# Copyright 2000-2001 Double Precision, Inc.  See COPYING for

# distribution information.

#

# authdaemonrc created from authdaemonrc.dist by sysconftool

#

# Do not alter lines that begin with ##, they are used when upgrading

# this configuration.

#

# This file configures authdaemond, the resident authentication daemon.

#

# Comments in this file are ignored.  Although this file is intended to

# be sourced as a shell script, authdaemond parses it manually, so

# the acceptable syntax is a bit limited.  Multiline variable contents,

# with the \ continuation character, are not allowed.  Everything must

# fit on one line.  Do not use any additional whitespace for indentation,

# or anything else.

##NAME: authmodulelist:0

#

# The authentication modules that are linked into authdaemond.  The

# default list is installed.  You may selectively disable modules simply

# by removing them from the following list.  The available modules you

# can use are: authcustom authcram authuserdb authvchkpw authmysql authpam

authmodulelist="authvchkpw"

##NAME: authmodulelistorig:1

#

# This setting is used by Courier's webadmin module, and should be left

# alone

authmodulelistorig="authcustom authcram authuserdb authvchkpw authmysql authpam"

##NAME: daemons:0

#

# The number of daemon processes that are started.  authdaemon is typically

# installed where authentication modules are relatively expensive: such

# as authldap, or authmysql, so it's better to have a number of them running.

# PLEASE NOTE:  Some platforms may experience a problem if there's more than

# one daemon.  Specifically, SystemV derived platforms that use TLI with

# socket emulation.  I'm suspicious of TLI's ability to handle multiple

# processes accepting connections on the same filesystem domain socket.

#

# You may need to increase daemons if as your system load increases.  Symptoms

# include sporadic authentication failures.  If you start getting

# authentication failures, increase daemons.  However, the default of 5

# SHOULD be sufficient.  Bumping up daemon count is only a short-term

# solution.  The permanent solution is to add more resources: RAM, faster

# disks, faster CPUs...

daemons=5

##NAME: version:0

#

# When you have multiple versions of authdaemond.* installed, authdaemond

# just picks the first one it finds.  Set "version" to override that.

# For example:  version=authdaemond.plain

version=""

##NAME: authdaemonvar:0

#

# authdaemonvar is here, but is not used directly by authdaemond.  It's

# used by various configuration and build scripts, so don't touch it!

authdaemonvar=/var/lib/courier-imap/authdaemon

authmodulelist="${authmodulelist} relay-ctrl-allow"

```

and here's my qmail-smtpd:

```
# Configuration file for qmail-smtpd

# $Header: /home/cvsroot/gentoo-x86/net-mail/qmail/files/conf-smtpd,v 1.1 2003/11/30 11:32:06 robbat2 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"

# 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 

# This provides the LOGIN, PLAIN and CRAM-MD5 types

# the 'cmd5checkpw' used in $QMAIL_SMTP_AUTHCHECKPASSWORD supports CRAM-MD5

# and reads it's data from /etc/poppasswd

# see the manpage for cmd5checkpw for details on the passwords

# uncomment the next four lines to enable SMTP-AUTH

QMAIL_SMTP_AUTHHOST=$(<${QMAIL_CONTROLDIR}/me)

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

#QMAIL_SMTP_CHECKPASSWORD="/bin/cmd5checkpw"

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

QMAIL_SMTP_POST="${QMAIL_SMTP_AUTHHOST} ${QMAIL_SMTP_CHECKPASSWORD} ${QMAIL_SMTP_POST}"
```

I don't know what I'm doing wrong!  

Also, I'm using No-Ip.com to run a virtual host called enon.no-ip.org.  

Could this possibly have any effect?  I did add the domain through ./vadddomain and typing in the domain name does send me to the correct address.

But my mail isn't working.  Any advice or help?

----------

## vcihon

Pardok -

How have you entered your username in your mail client?

Are you typing just 

<username> 

or are you typing

<username>@domainname.com

The second is the correct username because it is a vitual domain.

----------

## Pardok

Yeah, see, the problem here is that I'm a complete moron.    :Embarassed: 

Thanks......sorry for the stupid question.   :Very Happy: 

----------

## Pardok

Ok, me again.

I got everything working perfectly.  I could send AND receive using Blubbi's How-To (as a sidenote, thank you so much Blubbi)

However, when I restart the server, I face the authentication error again.  Squirrelmail gives me the Unknown user or password error, K-mail says password is incorrect, etc.

It was working before, but when I restart, it doesn't.

I have the feeling something isn't starting up at boot....but I can't figure out what.  I went through the How-To again, trying to restart services, but nothing worked.

Anyone else face this problem or figured out how to fix it?  

Thanks.

Here's the output from ps -ef:

```
root@mail qmail-smtpd # ps -ef

UID        PID  PPID  C STIME TTY          TIME CMD

root         1     0  0 23:15 ?        00:00:04 init [3]

root         2     1  0 23:15 ?        00:00:00 [ksoftirqd/0]

root         3     1  0 23:15 ?        00:00:00 [events/0]

root         4     3  0 23:15 ?        00:00:00 [kblockd/0]

root         5     3  0 23:15 ?        00:00:00 [pdflush]

root         6     3  0 23:15 ?        00:00:00 [pdflush]

root         8     3  0 23:15 ?        00:00:00 [aio/0]

root         7     1  0 23:15 ?        00:00:00 [kswapd0]

root         9     1  0 23:15 ?        00:00:00 [jfsIO]

root        10     1  0 23:15 ?        00:00:00 [jfsCommit]

root        11     1  0 23:15 ?        00:00:00 [jfsSync]

root        12     3  0 23:15 ?        00:00:00 [xfslogd/0]

root        13     3  0 23:15 ?        00:00:00 [xfsdatad/0]

root        14     1  0 23:15 ?        00:00:00 [xfsbufd]

root        15     1  0 23:15 ?        00:00:00 [kseriod]

root       148     1  0 23:15 ?        00:00:00 [khubd]

root       332     1  0 23:15 ?        00:00:00 [khpsbpkt]

root       385     1  0 23:15 ?        00:00:00 [knodemgrd_0]

root       495     3  0 23:15 ?        00:00:00 [reiserfs/0]

root       626     1  0 23:15 ?        00:00:00 /sbin/devfsd /dev

root      3931     1  0 23:16 ?        00:00:00 /usr/sbin/syslog-ng

root      4984     1  0 23:16 ?        00:00:00 /usr/sbin/apache2 -k start -D SS

clamav    5088     1  0 23:16 ?        00:00:00 /usr/bin/freshclam -d -c 2 -l /v

root      5163     1  0 23:16 ?        00:00:00 /usr/lib/courier-imap/authlib/au

root      5164  5163  0 23:16 ?        00:00:00 /usr/lib/courier-imap/authlib/au

root      5165  5163  0 23:16 ?        00:00:00 /usr/lib/courier-imap/authlib/au

root      5166  5163  0 23:16 ?        00:00:00 /usr/lib/courier-imap/authlib/au

root      5174  5163  0 23:16 ?        00:00:00 /usr/lib/courier-imap/authlib/au

root      5175  5163  0 23:16 ?        00:00:00 /usr/lib/courier-imap/authlib/au

root      5195     1  0 23:16 ?        00:00:00 /usr/lib/courier-imap/couriertcp

root      5197     1  0 23:16 ?        00:00:00 /usr/lib/courier-imap/courierlog

root      5252     1  0 23:16 ?        00:00:00 /usr/lib/courier-imap/couriertcp

root      5264     1  0 23:16 ?        00:00:00 /usr/lib/courier-imap/courierlog

root      5300     1  0 23:16 ?        00:00:00 /usr/sbin/cupsd

vpopmail  5301  4984  0 23:16 ?        00:00:00 /usr/sbin/apache2 -k start -D SS

vpopmail  5311  4984  0 23:16 ?        00:00:00 /usr/sbin/apache2 -k start -D SS

vpopmail  5312  4984  0 23:16 ?        00:00:00 /usr/sbin/apache2 -k start -D SS

vpopmail  5313  4984  0 23:16 ?        00:00:00 /usr/sbin/apache2 -k start -D SS

vpopmail  5314  4984  0 23:16 ?        00:00:00 /usr/sbin/apache2 -k start -D SS

vpopmail  5315  4984  0 23:16 ?        00:00:00 /usr/sbin/apache2 -k start -D SS

privoxy   5648     1  0 23:16 ?        00:00:00 /usr/sbin/privoxy /etc/privoxy/c

root      5649     1  0 23:16 ?        00:00:00 /usr/sbin/smbd

root      5651     1  0 23:16 ?        00:00:00 /usr/sbin/nmbd

root      6194     1  0 23:16 ?        00:00:00 /usr/sbin/cron

root      6240     1  0 23:16 ?        00:00:00 /usr/bin/perl /usr/libexec/webmi

xfs       6431     1  0 23:16 ?        00:00:00 /usr/X11R6/bin/xfs -daemon -conf

root      6468     1  0 23:16 tty1     00:00:00 /sbin/agetty 38400 tty1 linux

root      6469     1  0 23:16 tty2     00:00:00 /sbin/agetty 38400 tty2 linux

root      6470     1  0 23:16 tty3     00:00:00 /sbin/agetty 38400 tty3 linux

root      6471     1  0 23:16 tty4     00:00:00 /sbin/agetty 38400 tty4 linux

root      6472     1  0 23:16 tty5     00:00:00 /sbin/agetty 38400 tty5 linux

root      6473     1  0 23:16 tty6     00:00:00 /sbin/agetty 38400 tty6 linux

root      6490     1  0 23:16 ?        00:00:00 /usr/kde/3.2/bin/kdm

root      6493  6490  3 23:16 ?        00:00:23 /etc/X11/X -nolisten tcp vt7 -au

root      6494  6490  0 23:16 ?        00:00:00 -:0

doug      6567  6494  0 23:16 ?        00:00:00 /bin/sh --login /usr/kde/3.2/bin

doug      6597     1  0 23:16 ?        00:00:00 kdeinit: Running...

doug      6600     1  0 23:16 ?        00:00:00 kdeinit: dcopserver --nosid

doug      6602  6597  0 23:16 ?        00:00:00 kdeinit: klauncher

doug      6605     1  0 23:16 ?        00:00:00 kdeinit: kded

doug      6637  6597  0 23:16 ?        00:00:01 //usr/kde/3.2/bin/artsd -F 8 -S

doug      6639     1  0 23:16 ?        00:00:00 kdeinit: knotify

doug      6643  6567  0 23:16 ?        00:00:00 kwrapper ksmserver

doug      6645     1  0 23:16 ?        00:00:00 kdeinit: ksmserver

doug      6646  6597  0 23:16 ?        00:00:01 kdeinit: kwin -session 11c0a8006

doug      6648     1  0 23:16 ?        00:00:00 kdeinit: kdesktop

doug      6650  6597  0 23:16 ?        00:00:00 kdeinit: kio_file file /tmp/ksoc

doug      6651     1  0 23:16 ?        00:00:00 kdeinit: kicker

doug      6654     1  0 23:16 ?        00:00:00 kdeinit: klipper

doug      6657     1  0 23:16 ?        00:00:00 kdeinit: kmix -session 11c0a8006

doug      6679     1  0 23:16 ?        00:00:00 korgac --miniicon korganizer

doug      6681     1  0 23:17 ?        00:00:00 kopete -session 11c0a80064000108

doug      6682     1  0 23:17 ?        00:00:01 kontact -session 11c0a8006400010

doug      6699  6597  0 23:17 ?        00:00:00 /bin/sh /usr/lib/mozilla/run-moz

doug      6704  6699  8 23:17 ?        00:00:59 /usr/lib/mozilla/mozilla-bin

doug      6708  6704  0 23:17 ?        00:00:00 /usr/lib/mozilla/mozilla-bin

doug      6709  6708  0 23:17 ?        00:00:00 /usr/lib/mozilla/mozilla-bin

doug      6710  6708  0 23:17 ?        00:00:00 /usr/lib/mozilla/mozilla-bin

privoxy   6716  5648  0 23:17 ?        00:00:00 /usr/sbin/privoxy /etc/privoxy/c

vpopmail  6725  4984  0 23:17 ?        00:00:00 /usr/sbin/apache2 -k start -D SS

doug      6729  6597  0 23:17 ?        00:00:00 kdeinit: konsole

doug      6730  6729  0 23:17 pts/0    00:00:00 /bin/bash

root      6755  6730  0 23:17 pts/0    00:00:00 su

root      6758  6755  0 23:17 pts/0    00:00:00 bash

vpopmail  6841     1  0 23:18 ?        00:00:00 /usr/bin/spamd -d -r /var/run/sp

root      7092     1  0 23:20 pts/0    00:00:00 /usr/bin/svscan /service

root      7097  7092  0 23:20 pts/0    00:00:00 supervise qmail-smtpd

vpopmail  7098  7097  0 23:20 pts/0    00:00:00 /usr/bin/tcpserver -H -R -v -l 0

root      7108  7092  0 23:20 pts/0    00:00:00 supervise log

qmaill    7109  7108  0 23:20 pts/0    00:00:00 /usr/bin/multilog t s2500000 n10

root      7116  7092  0 23:20 pts/0    00:00:00 supervise qmail-send

qmails    7117  7116  0 23:20 pts/0    00:00:00 qmail-send

root      7119  7092  0 23:20 pts/0    00:00:00 supervise log

qmaill    7120  7119  0 23:20 pts/0    00:00:00 /usr/bin/multilog t s2500000 n10

root      7131  7117  0 23:20 pts/0    00:00:00 qmail-lspawn |dot-forward .forwa

qmailr    7132  7117  0 23:20 pts/0    00:00:00 qmail-rspawn

qmailq    7133  7117  0 23:20 pts/0    00:00:00 qmail-clean

vpopmail  7169  4984  0 23:22 ?        00:00:00 /usr/sbin/apache2 -k start -D SS

doug      7371  6597  0 23:24 ?        00:00:00 kdeinit: kio_imap4 imap /tmp/kso

root      7476     1  0 23:24 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe

mysql     7513  7476  0 23:24 ?        00:00:00 /usr/sbin/mysqld --basedir=/usr

mysql     7514  7513  0 23:24 ?        00:00:00 /usr/sbin/mysqld --basedir=/usr

mysql     7515  7514  0 23:24 ?        00:00:00 /usr/sbin/mysqld --basedir=/usr

mysql     7516  7514  0 23:24 ?        00:00:00 /usr/sbin/mysqld --basedir=/usr

doug      7555     1  0 23:26 ?        00:00:00 /usr/bin/esd -terminate -nobeeps

```

----------

## blubbi

 *Pardok wrote:*   

> Ok, me again.
> 
> I got everything working perfectly.  I could send AND receive using Blubbi's How-To (as a sidenote, thank you so much Blubbi)
> 
> However, when I restart the server, I face the authentication error again.  Squirrelmail gives me the Unknown user or password error, K-mail says password is incorrect, etc.
> ...

 

Modify the following entries in your courier config (imapd and pop3d) files:

```
##NAME: DEBUG_LOGIN:0

#

# Dump additional login diagnostics to syslog

#

# DEBUG_LOGIN=0   - turn off login debugging

# DEBUG_LOGIN=1   - turn on login debugging

# DEBUG_LOGIN=2   - turn on login debugging + log passwords too

DEBUG_LOGIN=2

```

restart courier-pop3d|imapd and restart svscan

and have a look in the following logfiles:

```

/var/log/mail

/var/log/qmail/qmail-smtp/current

```

mmmh, I have no Idea, why this souldn't work after a reboot .... for me it works even after a reboot ...

But take a look at these logfiels and report.

----------

## vcihon

Everything is working - two more questions:

1.  Can someone explain why you would use/want SMTP Auth Post Pop3?

I'm somewhat new to this (we run an Exchange server at work without Pop3 or Imap)

2.  This is not directly on topic (qmail setup) but is related:

I have a test domain and a production domain.  I set up the test domain with a copy of my website and qmail/vpopmail per this forum.  I now want to have email and web traffic redirect from the production domain to the test domain so I don't have to redo everything.  Should this be done locally with vpopmail and the use of aliases (and with Apache) or can it/should it be done on the DNS level?

Hints on how to do either scenario would be appreciated. . .

----------

## Pardok

Thanks for the reply Blubbi.

I'm getting the error:

```
Fatal: unable to bind: address not available
```

Very strange.  Here's my host file:

```
127.0.0.1       localhost

192.168.0.100   mail.enon.no-ip.org     mail

# IPV6 versions of localhost and co

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts

```

Also, diving deeper into logs, I found this in my qmail-send current file:

```

@40000000408030dc29ae576c starting delivery 3: msg 1001185 to local enon.no-ip.org-doug@enon.no-ip.org

@40000000408030dc29ae5b54 status: local 2/10 remote 1/20

@40000000408030dc29ae5f3c delivery 3: deferral: Uh-oh:_home_directory_is_writable._(#4.7.0)/

@40000000408030dc3414d8fc status: local 1/10 remote 1/20

@40000000408030dc3414e0cc delivery 1: deferral: /bin/sh:_line_1:_dot-forward:_command_not_found/

@40000000408030dc3414e89c status: local 0/10 remote 1/20

@40000000408030e034acbfb4 delivery 2: deferral: Sorry,_I_wasn't_able_to_establish_an_SMTP_connection._(#4.4.1)/

@40000000408030e034acd33c status: local 0/10 remote 0/20

```

And netstat shows this:

```

Active Internet connections (w/o servers)

Proto Recv-Q Send-Q Local Address           Foreign Address         State

tcp        0      0 localhost:8118          localhost:32856         TIME_WAIT

tcp        0      0 mail.enon.no-ip.o:32792 205.188.8.137:5190     ESTABLISHED

Active UNIX domain sockets (w/o servers)

Proto RefCnt Flags       Type       State         I-Node Path

**CUT****

unix  3      [ ]         STREAM     CONNECTED     8773

unix  3      [ ]         STREAM     CONNECTED     8768   /tmp/mcop-doug/mail_enon_no-ip_org-1be5-408030fa

unix  3      [ ]         STREAM     CONNECTED     8767

unix  3      [ ]         STREAM     CONNECTED     8654   /tmp/.X11-unix/X0

unix  3      [ ]         STREAM     CONNECTED     8653

unix  3      [ ]         STREAM     CONNECTED     8652   /tmp/.ICE-unix/dcop7027-1082142961

***CUT****

```

I don't understand.  It connected to the address before, but when I restart it doesn't.  Any advice?Last edited by Pardok on Fri Apr 16, 2004 7:42 pm; edited 1 time in total

----------

## Naspe

Hi all. I followed this how-to. everything seems to work but clamav. I can't recive any emails from foreign addresses. I found this message in the qmail-queue.log in qmailscanner dir:

```

16/04/2004 21:01:03:24284: +++ starting debugging for process 24284 by uid=201 at 16/04/2004 21:01:03

16/04/2004 21:01:03:24284: setting UID to EUID so subprocesses can access files generated by this script

16/04/2004 21:01:03:24284: program name is qmail-scanner-queue.pl, version 1.16

16/04/2004 21:01:03:24284: incoming SMTP connection from via smtp from 193.70.192.127

16/04/2004 21:01:03:24284: w_c: mkdir /var/spool/qmailscan/caronte108214206342624284

16/04/2004 21:01:03:24284: w_c: start dumping incoming msg into /var/spool/qmailscan/working/tmp/caronte108214206342624284 [1082142063.23757]

16/04/2004 21:01:03:24284: w_c: rename new msg from /var/spool/qmailscan/working/tmp/caronte108214206342624284 to /var/spool/qmailscan/working/new/caronte108214206342624284 [1082142063.23926]

16/04/2004 21:01:03:24284: d_m: starting /usr/bin/reformime  -x/var/spool/qmailscan/caronte108214206342624284/ </var/spool/qmailscan/working/new/caronte108214206342624284 [1082142063.2395]

16/04/2004 21:01:03:24284: d_m: finished /usr/bin/reformime  -x/var/spool/qmailscan/caronte108214206342624284/ [1082142063.24512]

16/04/2004 21:01:03:24284: d_m: Checking all attachments to see if they're MS-TNEF

16/04/2004 21:01:03:24284: d_m: is /var/spool/qmailscan/caronte108214206342624284/1082142063.24286-0.caronte is a TNEF file?: 256 [1082142063.24773]

16/04/2004 21:01:03:24284: d_m: Manually unpack any zip files as some virus scanners don't do zip under Unix!

16/04/2004 21:01:03:24284: d_m: unpacking message took 0.008648 seconds

16/04/2004 21:01:03:24284: unsetting QMAILQUEUE env var

16/04/2004 21:01:03:24284: g_e_h: return-path is "naspe@libero.it", recips is "naspe@naspenet.org"

16/04/2004 21:01:03:24284: from="naspe\@libero\.it" <naspe@libero.it>,subj=Re:Prova 4, x-qmail-scanner-message-id=<HWA18H$C30CFDDC4AA42811227F7A16F63FDC2D@libero.it> via smtp from 193.70.192.127

16/04/2004 21:01:03:24284: ini_sc: start scanning

16/04/2004 21:01:03:24284: p_s: starting scan of directory "/var/spool/qmailscan/caronte108214206342624284"...

16/04/2004 21:01:03:24284: p_s:  '81:ILOVEYOU' = 'Virus-subject' = 'Love Letter Virus/Trojan'

16/04/2004 21:01:03:24284: p_s:  type is a header!

16/04/2004 21:01:03:24284: p_s:  checking for objects containing subject: ILOVEYOU

16/04/2004 21:01:03:24284: p_s:  '82:message/partial' = 'Virus-content-type' = 'Message/partial MIME attachments blocked by policy'

16/04/2004 21:01:03:24284: p_s:  type is a header!

16/04/2004 21:01:03:24284: p_s:  checking for objects containing content-type: message/partial

16/04/2004 21:01:03:24284: p_s:  '85:.{100,}' = 'Virus-date' = 'MIME Header Buffer Overflow'

16/04/2004 21:01:03:24284: p_s:  type is a header!

16/04/2004 21:01:03:24284: p_s:  checking for objects containing date: .{100,}

16/04/2004 21:01:03:24284: p_s:  '86:.{100,}' = 'Virus-mime-version' = 'MIME Header Buffer Overflow '

16/04/2004 21:01:03:24284: p_s:  type is a header!

16/04/2004 21:01:03:24284: p_s:  checking for objects containing mime-version: .{100,}

16/04/2004 21:01:03:24284: p_s:  '87:.{100,}' = 'Virus-resent-date' = 'MIME Header Buffer Overflow'

16/04/2004 21:01:03:24284: p_s:  type is a header!

16/04/2004 21:01:03:24284: p_s:  checking for objects containing resent-date: .{100,}

16/04/2004 21:01:03:24284: p_s:  '90:ZVDOHYIK@yahoo.com|udtzqccc@yahoo.com|DTCELACB@yahoo.com|I1MCH2TH@yahoo.com|WPADJQ12@yahoo.com|smr@eurosport.com|bgnd2@canada.com|muwripa@fairesuivre.com|eccles@ballsy.net|S_Mentis@mail-x-change.com|YJPFJTGZ@excite.com|JGQZCD@excite.com|XHZJ3@excite.com|OZUNYLRL@excite.com|tsnlqd@excite.com|cxkawog@krovatka.net|ssdn@myrealbox.com' = 'Virus-to' = 'BadTrans Trojan exploit!'

16/04/2004 21:01:03:24284: p_s:  type is a header!

16/04/2004 21:01:03:24284: p_s:  checking for objects containing to: ZVDOHYIK@yahoo.com|udtzqccc@yahoo.com|DTCELACB@yahoo.com|I1MCH2TH@yahoo.com|WPADJQ12@yahoo.com|smr@eurosport.com|bgnd2@canada.com|muwripa@fairesuivre.com|eccles@ballsy.net|S_Mentis@mail-x-change.com|YJPFJTGZ@excite.com|JGQZCD@excite.com|XHZJ3@excite.com|OZUNYLRL@excite.com|tsnlqd@excite.com|cxkawog@krovatka.net|ssdn@myrealbox.com

16/04/2004 21:01:03:24284: p_s:  'eicar.com' = '69' = 'EICAR Test Virus'

16/04/2004 21:01:03:24284: p_s: type is a size!

16/04/2004 21:01:03:24284: p_s:  'happy99.exe' = '10000' = 'Happy99 Trojan'

16/04/2004 21:01:03:24284: p_s: type is a size!

16/04/2004 21:01:03:24284: p_s:  'zipped_files.exe' = '120495' = 'W32/ExploreZip.worm.pak virus'

16/04/2004 21:01:03:24284: p_s: type is a size!

16/04/2004 21:01:03:24284: p_s: skipping auto-generated file 1082142063.24286-0.caronte

16/04/2004 21:01:03:24284: p_s:  finished scan of dir "/var/spool/qmailscan/caronte108214206342624284" in 0.003264 secs

16/04/2004 21:01:03:24284: ini_sc: recursively scan the directory /var/spool/qmailscan/caronte108214206342624284/

16/04/2004 21:01:03:24284: scanloop: starting scan of directory "/var/spool/qmailscan/caronte108214206342624284"...

16/04/2004 21:01:03:24284: clamscan: starting scan of directory "/var/spool/qmailscan/caronte108214206342624284"...

16/04/2004 21:01:03:24284: run /usr/bin/clamscan -r  --tempdir=/var/spool/qmailscan/caronte108214206342624284 --disable-summary --unzip --unrar --unace --unarj --zoo --lha --jar --tar --tgz  /var/spool/qmailscan/caronte108214206342624284 2>&1

16/04/2004 21:01:03:24284: --output of clamscan was:

LibClamAV Error: readdb(): Malformed pattern line 9767 (file /var/spool/qmailscan/caronte108214206342624284/463976e312f94996/viruses.db).

LibClamAV Error: Can't gzdopen() descriptor 5

LibClamAV Error: cli_cvdload(): Can't unpack CVD file.

ERROR: CVD extraction failure.

--

16/04/2004 21:01:03:24284: tempfail: X-Qmail-Scanner-1.16: clam_scanner: corrupt or unknown ClamAV scanner error or memory/resource/perms problem - exit status 50

16/04/2004 21:04:15:24294: +++ starting debugging for process 24294 by uid=201 at 16/04/2004 21:04:15

16/04/2004 21:04:15:24294: setting UID to EUID so subprocesses can access files generated by this script

16/04/2004 21:04:15:24294: program name is qmail-scanner-queue.pl, version 1.16

16/04/2004 21:04:15:24294: incoming SMTP connection from via smtp from 216.127.66.30

16/04/2004 21:04:15:24294: w_c: mkdir /var/spool/qmailscan/caronte108214225542624294

16/04/2004 21:04:15:24294: w_c: start dumping incoming msg into /var/spool/qmailscan/working/tmp/caronte108214225542624294 [1082142255.18835]

16/04/2004 21:04:15:24294: w_c: rename new msg from /var/spool/qmailscan/working/tmp/caronte108214225542624294 to /var/spool/qmailscan/working/new/caronte108214225542624294 [1082142255.48891]

16/04/2004 21:04:15:24294: d_m: starting /usr/bin/reformime  -x/var/spool/qmailscan/caronte108214225542624294/ </var/spool/qmailscan/working/new/caronte108214225542624294 [1082142255.48928]

16/04/2004 21:04:15:24294: d_m: finished /usr/bin/reformime  -x/var/spool/qmailscan/caronte108214225542624294/ [1082142255.49481]

16/04/2004 21:04:15:24294: d_m: Checking all attachments to see if they're MS-TNEF

16/04/2004 21:04:15:24294: d_m: is /var/spool/qmailscan/caronte108214225542624294/1082142255.24297-0.caronte is a TNEF file?: 256 [1082142255.49733]

16/04/2004 21:04:15:24294: d_m: Manually unpack any zip files as some virus scanners don't do zip under Unix!

16/04/2004 21:04:15:24294: d_m: unpacking message took 0.008429 seconds

16/04/2004 21:04:15:24294: unsetting QMAILQUEUE env var

16/04/2004 21:04:15:24294: g_e_h: return-path is "naspe@nblab.net", recips is "naspe@naspenet.org"

16/04/2004 21:04:15:24294: from="Naspe" <naspe@nblab.net>,subj=fgre, x-qmail-scanner-message-id=<13074.213.155.195.224.1082141538.squirrel@www.nblab.net> via smtp from 216.127.66.30

16/04/2004 21:04:15:24294: ini_sc: start scanning

16/04/2004 21:04:15:24294: p_s: starting scan of directory "/var/spool/qmailscan/caronte108214225542624294"...

16/04/2004 21:04:15:24294: p_s:  '81:ILOVEYOU' = 'Virus-subject' = 'Love Letter Virus/Trojan'

16/04/2004 21:04:15:24294: p_s:  type is a header!

16/04/2004 21:04:15:24294: p_s:  checking for objects containing subject: ILOVEYOU

16/04/2004 21:04:15:24294: p_s:  '82:message/partial' = 'Virus-content-type' = 'Message/partial MIME attachments blocked by policy'

16/04/2004 21:04:15:24294: p_s:  type is a header!

16/04/2004 21:04:15:24294: p_s:  checking for objects containing content-type: message/partial

16/04/2004 21:04:15:24294: p_s:  '85:.{100,}' = 'Virus-date' = 'MIME Header Buffer Overflow'

16/04/2004 21:04:15:24294: p_s:  type is a header!

16/04/2004 21:04:15:24294: p_s:  checking for objects containing date: .{100,}

16/04/2004 21:04:15:24294: p_s:  '86:.{100,}' = 'Virus-mime-version' = 'MIME Header Buffer Overflow '

16/04/2004 21:04:15:24294: p_s:  type is a header!

16/04/2004 21:04:15:24294: p_s:  checking for objects containing mime-version: .{100,}

16/04/2004 21:04:15:24294: p_s:  '87:.{100,}' = 'Virus-resent-date' = 'MIME Header Buffer Overflow'

16/04/2004 21:04:15:24294: p_s:  type is a header!

16/04/2004 21:04:15:24294: p_s:  checking for objects containing resent-date: .{100,}

16/04/2004 21:04:15:24294: p_s:  '90:ZVDOHYIK@yahoo.com|udtzqccc@yahoo.com|DTCELACB@yahoo.com|I1MCH2TH@yahoo.com|WPADJQ12@yahoo.com|smr@eurosport.com|bgnd2@canada.com|muwripa@fairesuivre.com|eccles@ballsy.net|S_Mentis@mail-x-change.com|YJPFJTGZ@excite.com|JGQZCD@excite.com|XHZJ3@excite.com|OZUNYLRL@excite.com|tsnlqd@excite.com|cxkawog@krovatka.net|ssdn@myrealbox.com' = 'Virus-to' = 'BadTrans Trojan exploit!'

16/04/2004 21:04:15:24294: p_s:  type is a header!

16/04/2004 21:04:15:24294: p_s:  checking for objects containing to: ZVDOHYIK@yahoo.com|udtzqccc@yahoo.com|DTCELACB@yahoo.com|I1MCH2TH@yahoo.com|WPADJQ12@yahoo.com|smr@eurosport.com|bgnd2@canada.com|muwripa@fairesuivre.com|eccles@ballsy.net|S_Mentis@mail-x-change.com|YJPFJTGZ@excite.com|JGQZCD@excite.com|XHZJ3@excite.com|OZUNYLRL@excite.com|tsnlqd@excite.com|cxkawog@krovatka.net|ssdn@myrealbox.com

16/04/2004 21:04:15:24294: p_s:  'eicar.com' = '69' = 'EICAR Test Virus'

16/04/2004 21:04:15:24294: p_s: type is a size!

16/04/2004 21:04:15:24294: p_s:  'happy99.exe' = '10000' = 'Happy99 Trojan'

16/04/2004 21:04:15:24294: p_s: type is a size!

16/04/2004 21:04:15:24294: p_s:  'zipped_files.exe' = '120495' = 'W32/ExploreZip.worm.pak virus'

16/04/2004 21:04:15:24294: p_s: type is a size!

16/04/2004 21:04:15:24294: p_s: skipping auto-generated file 1082142255.24297-0.caronte

16/04/2004 21:04:15:24294: p_s:  finished scan of dir "/var/spool/qmailscan/caronte108214225542624294" in 0.003187 secs

16/04/2004 21:04:15:24294: ini_sc: recursively scan the directory /var/spool/qmailscan/caronte108214225542624294/

16/04/2004 21:04:15:24294: scanloop: starting scan of directory "/var/spool/qmailscan/caronte108214225542624294"...

16/04/2004 21:04:15:24294: clamscan: starting scan of directory "/var/spool/qmailscan/caronte108214225542624294"...

16/04/2004 21:04:15:24294: run /usr/bin/clamscan -r  --tempdir=/var/spool/qmailscan/caronte108214225542624294 --disable-summary --unzip --unrar --unace --unarj --zoo --lha --jar --tar --tgz  /var/spool/qmailscan/caronte108214225542624294 2>&1

16/04/2004 21:04:15:24294: --output of clamscan was:

LibClamAV Error: readdb(): Malformed pattern line 9767 (file /var/spool/qmailscan/caronte108214225542624294/72fbb8360e9a86f9/viruses.db).

LibClamAV Error: Can't gzdopen() descriptor 5

LibClamAV Error: cli_cvdload(): Can't unpack CVD file.

ERROR: CVD extraction failure.

--

16/04/2004 21:04:15:24294: tempfail: X-Qmail-Scanner-1.16: clam_scanner: corrupt or unknown ClamAV scanner error or memory/resource/perms problem - exit status 50

```

What is the problem?

----------

## blubbi

 *Pardok wrote:*   

> Thanks for the reply Blubbi.
> 
> I'm getting the error:
> 
> ```
> ...

 

First of all try to solve your 

```
Fatal: unable to bind: address not available
```

 error ... I have no clue what you have done. After you have fixed that error we will have a look at the oterh probs.

----------

## blubbi

 *Naspe wrote:*   

> Hi all. I followed this how-to. everything seems to work but clamav. I can't recive any emails from foreign addresses. I found this message in the qmail-queue.log in qmailscanner dir:
> 
> ```
> 
> 16/04/2004 21:01:03:24284: +++ starting debugging for process 24284 by uid=201 at 16/04/2004 21:01:03
> ...

 

Is clamav working. Are you able to scan any directory. Try scanning your home dir and look if clamav is working. If so, try to rise your "SOFTLIMIT_OPTS" re-emerge clamav, re-emerge qmail-scanner. 

If that doesn't help, uncomment clamav in your qmail-scanner file, or unmerge clamav and re-emerge qmail-scanner.

----------

## blubbi

 *vcihon wrote:*   

> Everything is working - two more questions:
> 
> 1.  Can someone explain why you would use/want SMTP Auth Post Pop3?
> 
> I'm somewhat new to this (we run an Exchange server at work without Pop3 or Imap)
> ...

 

Ähhhmm .... if everyone at work uses M$ Outlook, no problem (except securety problems  :Smile:  SMTP AUTH is a protocoll to authenticate SMTP connections. If clients are not able to perform this type of auth, the client can use SMTP after POP. That means, the client has to open a pop3 connection to the server befor he is allowed to relay throug the server he made the connection to.

 *Quote:*   

> 
> 
> 2.  This is not directly on topic (qmail setup) but is related:
> 
> I have a test domain and a production domain.  I set up the test domain with a copy of my website and qmail/vpopmail per this forum.  I now want to have email and web traffic redirect from the production domain to the test domain so I don't have to redo everything.  Should this be done locally with vpopmail and the use of aliases (and with Apache) or can it/should it be done on the DNS level?
> ...

 

DNS

----------

## dik

Anyone able to help?

I followed the instructions word for word (well at least i think I did..)

When trying to add a new domain, I get the following

 *Quote:*   

> 
> 
> could not connect to mysql update server Access denied for user: 'vpopmail@localhost' (Using password: YES) with database
> 
> could not connect to mysql update server Access denied for user: 'vpopmail@localhost' (Using password: YES)
> ...

 

Any ideas ? I think possibly it's trying to connect to the mySQL database, but using the wrong password? I dont -really- know what else to try..

Any help would be appreciated.

Thanks,

----------

## vcihon

Blubbi -

I am having the same issue as Pardok. I rebooted my server and now Pop3 auth is no longer working - says the password is wrong. 

I enabled logging as you suggested but do not see any errors.  Also, there is Nothing in my /var/mail directory - I'm not sure what should be there. . 

Any ideas how to troubleshoot this?  I have a feeling if I remove the user and then add him again, it will work however I would rather troubleshoot it first. . .

----------

## Pardok

Vcihon,

I found out that the reboot problem has something to do with relaying.  

I installed via Blubbi's How-To without doing the relay-ctrl steps, and my server was running well, even after reboot.

However, I face the problem of not being able to send from outside my own network.  That is, I'd sign onto squirrelmail from a machine running Windows XP, try to send an e-mail, only to have it got losts in the ether of my machine.

It was never delivered.  I checked the logs and couldn't find any errors.  Everything was running and connected.  

I don't know where to begin troubleshooting.  I'm thinking it has something to do with tcprules.......but I'm not quite sure where to begin.

Blubbi, any advice?  The "no-connect" error after reboot has been isoloated to relay-ctrl....perhaps something to do with realy-ctrl isn't starting at boot?

----------

## Pardok

 *dik wrote:*   

> Anyone able to help?
> 
> I followed the instructions word for word (well at least i think I did..)
> 
> When trying to add a new domain, I get the following
> ...

 

Dik, make sure you have edited /etc/vpopmail.conf to match the password you supplied for vpopmail on Mysql.

Simply nano -w /etc/vpopmail.conf and replace SECRET or TOPSECRET with the password you supplied while granting privileges to vpopmail in MYSQL.

----------

## vcihon

I would agree Pardok.  Because I was trying to get SMTP working for my Pop3 users, I also setup relay-ctrl right shortly before I rebooted.   So I'll await a response to your post   :Cool: 

----------

## Pardok

Vcihon,

Are you perchance running behind a router?  

Doing some research, I found that you have to account for your router's internal and external IP address in rcpthosts and tcprules.d.......

I'm going to try out Blubbi's HOW-TO again with this info.  It might be the problem......

I'll let you know how it works.  If you'd like, check out this thread:

https://forums.gentoo.org/viewtopic.php?t=25429&highlight=tcprules

----------

## vcihon

I'm not behind a router. . .sorry.

One thing I wonder looking over Blubbi's HOWTO:

I had to create RELAY_CTRL_RELAYCLIENT and add the line in the doc.  I am curious about the  

```
RELAYCLIENT='@fixup',
```

I have not configured the spam control yet and changed the line to read 

```
:allow,RELAYCLIENT='@fixup',RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-queue"

```

I wonder if it has to read:

```
:allow,RELAYCLIENT='@realdomainname',RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-queue"

```

----------

## Pardok

Perhaps.

I'll try it.  I'm almost finished installing and I'll move onto the debugging.  

I think you may be right.  Would it be hostname, FQDN, or just DN?  I'm wondering what @fixup stands for......

----------

## vcihon

Pardok - found it.

Slott-Hansen had noted earlier in the thread:

 *Quote:*   

> I just took a closer look my "/etc/courier-imap/pop3d" file and saw that "AUTHMODULES" wasnt changed to use the new auth. program. It's not stated in the walkthrough so maybe others have made the same mistake as I
> 
> #AUTHMODULES="authdaemon"
> 
> # Use vpopmail auth.
> ...

 

I changed mine and restarted courier-pop3d and I was good to go.  I'm going to reboot to verify and will only post if it doesn't work.

----------

## Pardok

I remeber seeing that post and trying it awhile ago.  However, I may have made a mistake.  HOpe it works!  

Also, did you have to change your RELAY_CTRL_RELAYCLIENT?  Or did you leave it as it is in the walkthrough?

----------

## vcihon

Good news and bad news.

My previous post solved the pop3 auth problem upon reboot.

However SMTP_AUTH is still not working.  When I try to send email from my client, it tells me that  *Quote:*   

> the domainis not in my list of allowed rcpthosts (#5.7.1)

 

I checked my /var/qmail/control/rcpthosts and the domains appear correct.

Any ideas anyone?

----------

## vcihon

 *Quote:*   

> Also, did you have to change your RELAY_CTRL_RELAYCLIENT? Or did you leave it as it is in the walkthrough?

 

I had to create the file RELAY_CTRL_RELAYCLIENT and then add the line from the Howto.

----------

## Pardok

Vcihon,

I *finally* got my server working (after so many weeks).  And I think the problem you're facing with with your /etc/tcprules.d/tcp.qmail-smtp.  I had the same problem and fixed it like this:

here my file:

```
# to update the database after changing this file, run:

# tcprules /etc/tcprules.d/tcp.qmail-smtp.cdb /etc/tcprules.d/.tcp.qmail-smtp.tmp < /etc/tcprules.d/tcp.qmail-smtp

#------------------------------------------------------

# DESCRIPTION OF THE RULES TO REMIND ME OF HOW THIS FILE WORKS

#

# If you set 'allow', this means that our mail server will allow

# the specified IP range to make a TCP connection to our server

#

# If you set 'deny', this means that our mail server will not allow

# the specified IP range to make a TCP connection to our server

#

# If you set RELAYCLIENT="", this means that the listed IP range is 

# allowed to relay mail through our server

#

# If you dont set RELAYCLIENT="", this means that the listed IP range

# will not be able to relay mail through our server

#

# If you set RBLSMTPD="", this means that the listed IP ranges will

# not be checked against any of the RBL databases

#

# If you set RBLSMTPD="some text here", this means that an RBL lookup

# wont be performed, but the mail will be rejected with the specified

# text as a 4xx temp error message

#

# If you set RBLSMTPD="-some text here", this means that an RBL lookup

# wont be performed, but the mail will be rejected with the specified

# text as a 5xx perm error message

#

# If you do not set RBLSMTPD="" or ="some text", then an RBL lookup

# will be performed. If the lookup is successful, then RBLSMTPD will

# return your custom error message (as specified in the -r parameter

# in smtpd supervise script)

#

#-----------------------------------------------------

# HERE ARE THE RULES! :

#-----------------------------------------------------

# BYPASS OPEN RELAY CHECKING FOR THESE IPS :

#

# These IPs are ones that we have setup so that they arent RBL checked.

# We have done this because these particular servers are RBL listed,

# and for whatever reason they can't/won't fix their open relay problem,

# and we still want to be able to receive mail from them.

# 

# reminder text goes here for this entry so we know the story...

#111.111.111.111:allow,RBLSMTPD=""

# reminder text goes here for this entry so we know the story...

#222.222.222.222:allow,RBLSMTPD=""

#

#-----------------------------------------------------------------

# DONT ALLOW THESE IPS TO SEND MAIL TO US :

#

# mailXX.offermail.net connecting regularly and sending invalid

# format messages causing exit with status 256 (bare linefeed normally)

# entry added 15/12/2001

# after looking at the mail coming from these servers it was found to be spam

#216.242.75.100-116:allow,RBLSMTPD="-Connections from this IP have been banned."

#

# heaps of spam from replyto of *@freeamateurhotties.com dec2001

#64.228.127.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"

#154.20.94.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"

#209.151.132.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"

#216.18.85.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"

#

#-----------------------------------------------------------------

# ALLOW THESE IPS TO RELAY MAIL THROUGH OUR SERVER

#

# Local class-c's from our LAN are allowed to relay,

# and we wont bother doing any RBL checking.

#123.123.123.:allow,RELAYCLIENT="",RBLSMTPD=""

#123.111.111.:allow,RELAYCLIENT="",RBLSMTPD=""

#

# Connections from localhost are allowed to relay 

# (because the WebMail server runs on localhost),

# and obviously there is no point trying to perform an RBL check.

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

#

#-----------------------------------------------------------------

# ALLOW EVERYONE ELSE TO SEND US MAIL

#

# Everyone else can make connections to our server,

# but not allowed to relay

# RBL lookups are performed

#:allow

# If you are using qmail-scanner, this line here is the correct one to use

# instead (comment out the above ':allow' line FIRST) and applies that script

# to any mail coming in that is not from a host allowed to relay. You can

# change the value of the variable to any other value you desire to use custom

# scripts for example.

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

192.168.0.xxx(MY INTERNAL IP ADDRESS):allow,RELAYCLIENT="",RBLSMTPD="",\

QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"

:allow,RELAYCLIENT="",RBLSMTPD="",\

QMAILQUEUE="/var/qmail/bin/qmail-queue"

192.168.0.xxx(MY ROUTER'S IP ADDRESS):allow,RELAYCLIENT="",RBLSMTPD="",\

QMAILQUEUE="/var/qmail/bin/qmail-queue"

24.9.xxx.xxx(MY EXTERNAL IP):allow,RELAYCLIENT="",RBLSMTPD="",\

QMAILQUEUE="/var/qmail/bin/qmail-queue"
```

I'm thinking that e-mail sent from outside your network is being relayed through a different IP address, thus dying when it hits your relay controls.  Perhaps your ISP is behind a router?  Perhaps you don't account for your external IP?  

I'm thinking if you check these out, you'll get SMTP working.  

This is all I can think of.  Maybe someone has a better answer?

----------

## blubbi

 *vcihon wrote:*   

> I'm not behind a router. . .sorry.
> 
> One thing I wonder looking over Blubbi's HOWTO:
> 
> I had to create RELAY_CTRL_RELAYCLIENT and add the line in the doc.  I am curious about the  
> ...

 

Fixup is another piece of the qmail puzzle. 

It "fix up" the broken email (wrong EOL

conventions in their implementation of SMTP ... ) in some buggy mail scripts or old/broken mailclients like Eudora or Outlook.  It's not necessary to use that part of it.

Isn't it working for you with '@fixup' ? I forgot to mention:

replace "@fixup" with "@fqdn" or what ever adress you want.

----------

## blubbi

By the way, I have still no clue why SMTP-AUTH is not working ... any suggestions here, or anyone who has SMTP-AUTH working ?

----------

## vcihon

Pardok -

That fixed it.  It is either removing the @fixup or the order of the stmp rules.

Blubbi -

Can you clarify what you mean that @fixup should be @fqdn ?

Should it be @alextechstudio.com (my domain name)???

Finally for both (all), I now need to verify that I'm not an open relay which I believe I might be if the SMTP-AUTH is not truly working.  My SMTP is not asking for authentication but I'm not sure it will. .  .

I'll report back.

Thanks to all.

----------

## blubbi

 *vcihon wrote:*   

> Pardok -
> 
> That fixed it.  It is either removing the @fixup or the order of the stmp rules.
> 
> Blubbi -
> ...

 

fixup should be any name you would like to see there. Mostly it would be the hostname.

for example "@alextechstudio.com"

If you have installed smtp after pop you are no open rely, you can test this:

Try to send a mail to someone without having checked your mail for the time you have specified in your relaycontrol config. If everything works, you should not be able to send mails. Now check your mailaccount and than try to send the mail again. Now it should work for the specified timeperiode

----------

## vcihon

It appears, based on Blubbi's test and some test I did on the Internet, I am an open relay so something is not working. . ..if I find out what's going on, I'll post it here.

----------

## vcihon

Well it's definately not working.  Had the relay up and in a couple of hours, I found I have over 5000 emails relaying from my server.  Also, ORBD classified it as an open relay <sigh>.

Here is my tcp.qmail-smtp

```
# to update the database after changing this file, run:

# tcprules /etc/tcprules.d/tcp.qmail-smtp.cdb /etc/tcprules.d/.tcp.qmail-smtp.tmp < /etc/tcprules.d/tcp.qmail-smtp

#------------------------------------------------------

# DESCRIPTION OF THE RULES TO REMIND ME OF HOW THIS FILE WORKS

#

# If you set 'allow', this means that our mail server will allow

# the specified IP range to make a TCP connection to our server

#

# If you set 'deny', this means that our mail server will not allow

# the specified IP range to make a TCP connection to our server

#

# If you set RELAYCLIENT="", this means that the listed IP range is 

# allowed to relay mail through our server

#

# If you dont set RELAYCLIENT="", this means that the listed IP range

# will not be able to relay mail through our server

#

# If you set RBLSMTPD="", this means that the listed IP ranges will

# not be checked against any of the RBL databases

#

# If you set RBLSMTPD="some text here", this means that an RBL lookup

# wont be performed, but the mail will be rejected with the specified

# text as a 4xx temp error message

#

# If you set RBLSMTPD="-some text here", this means that an RBL lookup

# wont be performed, but the mail will be rejected with the specified

# text as a 5xx perm error message

#

# If you do not set RBLSMTPD="" or ="some text", then an RBL lookup

# will be performed. If the lookup is successful, then RBLSMTPD will

# return your custom error message (as specified in the -r parameter

# in smtpd supervise script)

#

#-----------------------------------------------------

# HERE ARE THE RULES! :

#-----------------------------------------------------

# BYPASS OPEN RELAY CHECKING FOR THESE IPS :

#

# These IPs are ones that we have setup so that they arent RBL checked.

# We have done this because these particular servers are RBL listed,

# and for whatever reason they can't/won't fix their open relay problem,

# and we still want to be able to receive mail from them.

# 

# reminder text goes here for this entry so we know the story...

#111.111.111.111:allow,RBLSMTPD=""

# reminder text goes here for this entry so we know the story...

#222.222.222.222:allow,RBLSMTPD=""

#

#-----------------------------------------------------------------

# DONT ALLOW THESE IPS TO SEND MAIL TO US :

#

# mailXX.offermail.net connecting regularly and sending invalid

# format messages causing exit with status 256 (bare linefeed normally)

# entry added 15/12/2001

# after looking at the mail coming from these servers it was found to be spam

#216.242.75.100-116:allow,RBLSMTPD="-Connections from this IP have been banned."

#

# heaps of spam from replyto of *@freeamateurhotties.com dec2001

#64.228.127.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"

#154.20.94.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"

#209.151.132.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"

#216.18.85.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"

#

#-----------------------------------------------------------------

# ALLOW THESE IPS TO RELAY MAIL THROUGH OUR SERVER

#

# Local class-c's from our LAN are allowed to relay,

# and we wont bother doing any RBL checking.

#123.123.123.:allow,RELAYCLIENT="",RBLSMTPD=""

#123.111.111.:allow,RELAYCLIENT="",RBLSMTPD=""

#:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-queue"

#

# Connections from localhost are allowed to relay 

# (because the WebMail server runs on localhost),

# and obviously there is no point trying to perform an RBL check.

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

#

#-----------------------------------------------------------------

# ALLOW EVERYONE ELSE TO SEND US MAIL

#

# Everyone else can make connections to our server,

# but not allowed to relay

# RBL lookups are performed

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

# If you are using qmail-scanner, this line here is the correct one to use

# instead (comment out the above ':allow' line FIRST) and applies that script

# to any mail coming in that is not from a host allowed to relay. You can

# change the value of the variable to any other value you desire to use custom

# scripts for example.

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

:allow,RELAYCLIENT="@alextechstudio.com",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-queue"

24.123.161.30:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-queue"

```

If anyone sees anything, or any other ideas how to troubleshoot this, let me know.

----------

## Pardok

Hmmm........

I'm in no way a Qmail guru and know even less about relaying....

Can anyone explain the difference between qmail-queue and qmail-scanner-queue.pl?

Perhaps you have to pipe external relays through qmail-scanner-queue.pl.

I don't know.

My config is correctly relaying, but I only have 2 users on my domain....and am not using it widely.

----------

## vcihon

Pardok -

Have you already set your email up for Spam Assasin scanning? That is what I thought qmail-scanner-queue.pl was for and I was waiting to set that up until after I knew it worked.

Also, are you sure you are also not an open relay?  You can go tohttp://www.ordb.org/submit/ in order to test it.

So either you are an open relay too and don't know it or I need to point it to qmail-scanner-queue.pl.  I'd rather wait for your reply. .   :Twisted Evil: 

----------

## vcihon

Blubbi or anyone - 

I wonder if the problem has to do with /var/qmail/control/me file.  Currently, I have that pointing to my full machine name - instead of to the mx record which is shortened to the domain name.

cat me

machinename.domainname.com

however my clients use:

domainname.com as their pop3 and smtp server.

Could that be the problem?

I got this because of:

 *Quote:*   

> QMAIL_SMTP_AUTHHOST=$(<${QMAIL_CONTROLDIR}/me)
> 
> 

 

----------

## Pardok

Hmmmmm,

According to the link you provided, mine also has an Open Relay.  

I'm running IMAP and not POP.  I don't know where to begin fixing this......

Going to do an internet search because I couldn't find anything dealing with this on the forums.

EDIT:

Ok, it's definitely tcprules.d settings.  

I found this http://mail-abuse.org/tsi/ar-fix.html that seems to offer a fix.  

Here is my current tcp.qmail-smtp:

```
# to update the database after changing this file, run:

# tcprules /etc/tcprules.d/tcp.qmail-smtp.cdb /etc/tcprules.d/.tcp.qmail-smtp.tmp < /etc/tcprules.d/tcp.qmail-smtp

#------------------------------------------------------

# DESCRIPTION OF THE RULES TO REMIND ME OF HOW THIS FILE WORKS

#

# If you set 'allow', this means that our mail server will allow

# the specified IP range to make a TCP connection to our server

#

# If you set 'deny', this means that our mail server will not allow

# the specified IP range to make a TCP connection to our server

#

# If you set RELAYCLIENT="", this means that the listed IP range is 

# allowed to relay mail through our server

#

# If you dont set RELAYCLIENT="", this means that the listed IP range

# will not be able to relay mail through our server

#

# If you set RBLSMTPD="", this means that the listed IP ranges will

# not be checked against any of the RBL databases

#

# If you set RBLSMTPD="some text here", this means that an RBL lookup

# wont be performed, but the mail will be rejected with the specified

# text as a 4xx temp error message

#

# If you set RBLSMTPD="-some text here", this means that an RBL lookup

# wont be performed, but the mail will be rejected with the specified

# text as a 5xx perm error message

#

# If you do not set RBLSMTPD="" or ="some text", then an RBL lookup

# will be performed. If the lookup is successful, then RBLSMTPD will

# return your custom error message (as specified in the -r parameter

# in smtpd supervise script)

#

#-----------------------------------------------------

# HERE ARE THE RULES! :

#-----------------------------------------------------

# BYPASS OPEN RELAY CHECKING FOR THESE IPS :

#

# These IPs are ones that we have setup so that they arent RBL checked.

# We have done this because these particular servers are RBL listed,

# and for whatever reason they can't/won't fix their open relay problem,

# and we still want to be able to receive mail from them.

# 

# reminder text goes here for this entry so we know the story...

#111.111.111.111:allow,RBLSMTPD=""

# reminder text goes here for this entry so we know the story...

#222.222.222.222:allow,RBLSMTPD=""

#

#-----------------------------------------------------------------

# DONT ALLOW THESE IPS TO SEND MAIL TO US :

#

# mailXX.offermail.net connecting regularly and sending invalid

# format messages causing exit with status 256 (bare linefeed normally)

# entry added 15/12/2001

# after looking at the mail coming from these servers it was found to be spam

#216.242.75.100-116:allow,RBLSMTPD="-Connections from this IP have been banned."

#

# heaps of spam from replyto of *@freeamateurhotties.com dec2001

#64.228.127.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"

#154.20.94.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"

#209.151.132.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"

#216.18.85.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"

#

#-----------------------------------------------------------------

# ALLOW THESE IPS TO RELAY MAIL THROUGH OUR SERVER

#

# Local class-c's from our LAN are allowed to relay,

# and we wont bother doing any RBL checking.

#123.123.123.:allow,RELAYCLIENT="",RBLSMTPD=""

#123.111.111.:allow,RELAYCLIENT="",RBLSMTPD=""

#

# Connections from localhost are allowed to relay 

# (because the WebMail server runs on localhost),

# and obviously there is no point trying to perform an RBL check.

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

#

#-----------------------------------------------------------------

# ALLOW EVERYONE ELSE TO SEND US MAIL

#

# Everyone else can make connections to our server,

# but not allowed to relay

# RBL lookups are performed

#:allow

# If you are using qmail-scanner, this line here is the correct one to use

# instead (comment out the above ':allow' line FIRST) and applies that script

# to any mail coming in that is not from a host allowed to relay. You can

# change the value of the variable to any other value you desire to use custom

# scripts for example.

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

192.168.0.100:allow,RELAYCLIENT="@enon.no-ip.org",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"

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

192.168.0.1:allow,RELAYCLIENT="@enon.no-ip.org",RBLSMTPD="",QMAILQUEUE="/var/qmail-queue"

24.9.206.76:allow,RELAYCLIENT="@enon.no-ip.org",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-queue"
```

I also updated my /etc/tcp.smtp and ran tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp

My tcp.smtp looks exactly like my /etc/tcprules.d/tcprules.qmail-smtp

Nonetheless, Spamassassin still detects it as spam.  I'm not sure if my settings are messed up or if Spamassassin has just been trained.

I'm getting this error in my /var/log/mail.info log occasionally (however, I think I fixed it):

```
Apr 20 20:59:34 mail maildrop[8378]: Unable to deliver to mailbox.

Apr 20 21:00:56 mail maildrop[8598]: Unable to deliver to mailbox.

Apr 20 21:02:15 mail maildrop[9062]: Unable to deliver to mailbox.

Apr 20 21:02:27 mail maildrop[9144]: Unable to deliver to mailbox.

Apr 20 21:05:57 mail maildrop[10466]: Unable to deliver to mailbox.
```

And here is the header info from spamassassin:

```
X-Spam-Status: Yes, hits=3.5 required=3.0 tests=PRIORITY_NO_NAME,

        RCVD_IN_DYNABLOCK,RCVD_IN_SORBS autolearn=no version=2.63

 X-Spam-Pyzor: Reported 0 times.

 MIME-Version: 1.0

 Content-Type: multipart/mixed;

  boundary="----------=_4085E568.73478E5E"

 X-UID: 

 Status: R

 X-Status: N

 X-KMail-EncryptionState: 

 X-KMail-SignatureState: 

 X-KMail-MDN-Sent: 

 

Spam detection software, running on the system "mail.enon.no-ip.org", has

identified this incoming email as possible spam.  The original message

has been attached to this so you can view it (if it isn't spam) or block

similar future email.  If you have any questions, see

root@localhost for details.

Content preview:  check [...] 

Content analysis details:   (3.5 points, 3.0 required)

 pts rule name              description

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

 2.5 RCVD_IN_DYNABLOCK      RBL: Sent directly from dynamic IP address

                            [24.9.206.76 listed in dnsbl.sorbs.net]

 0.1 RCVD_IN_SORBS          RBL: SORBS: sender is listed in SORBS

                            [24.9.206.76 listed in dnsbl.sorbs.net]

 0.8 PRIORITY_NO_NAME       Message has priority setting, but no X-Mailer
```

----------

## blubbi

 *vcihon wrote:*   

> Well it's definately not working.  Had the relay up and in a couple of hours, I found I have over 5000 emails relaying from my server.  Also, ORBD classified it as an open relay <sigh>.
> 
> If anyone sees anything, or any other ideas how to troubleshoot this, let me know.

 

use this in your /etc/tcprules.d/tcp.qmail-smtp

```

127.0.0.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"

127.0.0.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"

:allow,RELAYCLIENT="YOURIP or mybe Hostname without@",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-queue"

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

Wit this settings everybody is ollowed to connect, but not to relay. YOURIP or mybe Hostname without@" is allowed to connect and to relay. 127.0.0. is allowed to connect and to relay.

This should fix your open relay problem .... but with this settings the only host allowed to relay is the one specified in RELAYCLIENT. If this is not what you want, you have to use smtp after pop or SMTP-AUTH. Regarding to  *Skywacker wrote:*   

> Blubbi- 
> 
> You can confirm that the pop-before-smtp works via your howto. I used your howto for that portion and it's working for me. 
> 
> Thanks a lot! 
> ...

  smtp after pop works if you followed my howto.

mmmmh, now I am a bit confued about

```
the :allow,RELAYCLIENT='@fixup',RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl" 
```

in /etc/relay-ctrl/RELAY_CTRL_RELAYCLIENT

I think it sould be '@fixup' not the domainname.

----------

## blubbi

 *Pardok wrote:*   

> Hmmmmm,
> 
> And here is the header info from spamassassin:
> 
> ```
> ...

 

You see, why spamassasin detects you Mail as spam. From which machine did you send that mail. Tell me from where to where this mail was going. Try to turn off qmail-scanner-queue in tcprules for your hostname from the host you send the mail from.

----------

## vcihon

Blubbi -

It might help if you or someone could post a simple explanation how SMTP-AUTH is supposed to work (the filter process).  For example, I'm not clear how /etc/tcprules.d/qmail-smtp talks to /etc/relay-ctrl-RELAY_CLIENT_CTRL

That might help us troubleshoot it.

I searched for a man page but didn't find any.

Also, any comments to my thoughts about the /var/qmail/control/me file which I mentioned in a post above?

----------

## blubbi

 *vcihon wrote:*   

> Blubbi -
> 
> It might help if you or someone could post a simple explanation how SMTP-AUTH is supposed to work (the filter process).  For example, I'm not clear how /etc/tcprules.d/qmail-smtp talks to /etc/relay-ctrl-RELAY_CLIENT_CTRL
> 
> That might help us troubleshoot it.
> ...

 

You are talking about 3 ways to deny relaying.

1.) SMTP-AUTH

2.) SMTP-AFTER-POP

3.) TCPRULES

If you have on up an running, you'll porbably be satisfied.

SMTP-AUTH and SMTP-AFTER-POP is usefull, if you want thrusted clients to relay from any IP (DialUP). TCPRULES is best to use if you have a office, and in the office the Clients have static IP's so you can allow every client with (for example 10.0.0.*) to relay. Everyone else is not allowd to relay, even if SMTP-AUT, or SMTP-AFTER-POP do allow the connection.

May be on monday I'll post a little info on how SMTP-AUTH and SMTP-AFTER-POP works. (or just ask google)

----------

## putte

This is a great guide but to big! 

could it be like restarted or something with a fresh setup ? 

BTW sabrex thanks for writing it....

----------

## blubbi

SMTP-AUTH

Okay, here's a bit info on how it works.

http://www.fehcom.de/qmail/smtpauth.html

Relay-ctrl (SMTP-After-POP)

It is quite self explaining.

Any user  must first check his incoming mail with POP3 or IMAP, if this is permitted, the user is for a period of time allowed to relay outgoing mail throug the server he made the pop3/imap connection to. This is accomplished by remembering the POP3 clients' IP. Every SMTP request for relaying outgoing mail is checked against the list containg the POP3 clients IP address. Is the IP address in that list the SMTP connection is granted, if the IP is not in the list, the SMTP client is not allowed to relay.  The list of IP's is periodically cleaned of old adresses, so relaying is not longer permitted as necessary.

TCPRules (ucspi-tcp)

For infos on how TCPRules (ucspi-tcp) work have a closer look here http://cr.yp.to/ucspi-tcp.html

----------

## Naspe

Now it all working (i think) 1 more question...

I have installed everything as the guide says but don't know what to do know to configure the antispam (SpamAssasins, pryzor, razor, dcc...)

What i have to do now?

----------

## blubbi

Take a closer look on my howto. For the link, see my signature.

btw. Is SMTP-AUTH working?

Which howto did you use?

----------

## Naspe

Tnx a lot for your help. I'll try this evening to follow your guide.

 *Quote:*   

> Is SMTP-AUTH working?

 

did u mean this thing? 

> nano -w /var/qmail/control/conf-smtpd 

QMAIL_SMTP_POST="mail.mydomain.com /var/vpopmail/bin/vchkpw /bin/true" 

> svc -t /var/qmail/supervise/qmail-smtpd 

> chmod u+s /var/vpopmail/bin/vchkpw

I think it is all working... I'm able to send messages to everyone... 

 *Quote:*   

> Which howto did you use?

 

I used this howto (the sabrex one  :Very Happy:  )

----------

## blubbi

 *Naspe wrote:*   

> Tnx a lot for your help. I'll try this evening to follow your guide.
> 
>  *Quote:*   Is SMTP-AUTH working? 
> 
> did u mean this thing? 
> ...

 

Are you sure you are not an open relay ??

----------

## Skywacker

Anyone else noticing F-prot missing viruses if they are zipped? I've checked and it is set by default to scan inside archives.

Also, anyone know how to make Spamassassin show how it gives a certain score per email? I've seen examples on the web where people can see an email got .2 points for one test, 1.4 for another, etc.

Thanks,

Skywacker

----------

## Skywacker

Update-

1)qmail-scanner-queue.pl has an option to force_unzip. I changed this to 1 and will inform if this solved qmail-scanner/f-prot missing viruses when they were zipped.

2)In /usr/share/spamassassin/local.cf, these two lines are not working - 

report_header 1

use_terse_report 1

I even tried report_header 0 to put the spam report details into the body, but it did not work. 

3)Hopefully someone can tell help me with this #2, but for a quick fix I just did a -

spamc -r < mailmessage 

and it gave me the details of which tests were triggered.

-Skywacker

----------

## Naspe

Sincerly i'm not sure if i am or not an open rely... May be i lost something...  :Very Happy:  I followed this guide (the first post of this topic...) is it ok?

Btw now i have a big problem.

2 days ago my server shutted down for power failure...  :Sad: 

When i started it again i found a big big problem: can no more log into my server to see the emails... No 1 can login neither with squirrelmail or outlook. I tryed to log in with qmailadmin and i can do it... Can't understand wy i can't login with squirrelmail/email-client...

Any suggestions? All services semms to be up and running...

svscan is up...

courier-imapd is up...

courier-pop3d is up...

mysqld is up...

Did i forget anything?

Tnx a lot for your support guyz  :Very Happy:   :Very Happy:   :Very Happy: 

----------

## Skywacker

First off I recommend studying (not just reading) http://www.lifewithqmail.org/lwq.html

Check things first locally on the server, then from outside.

Network card up and running?

Can you ping to your local network?

Can you ping outside your network?

Did you look in /var/log/messages for boot problems?

Send a test message to your hotmail account (or any outside email account you can check that is independent of this mail server.) On the command line type: #mail joe@hotmail.com

Cntrl-D sends the message. Any errors? 

Telnet localhost 110 (to check Pop3). 

USER test@accountonyourserver.com

PASS yourpass

Any errors? 

What does "svstat /service/* " show? It should return something like this-

/service/qmail-send: up (pid 5707) 3597801 seconds

/service/qmail-smtpd: up (pid 5701) 3597801 seconds

Remember also that Outlook and other email clients may be using Pop3 or IMAP where as Squirrelmail always uses IMAP. 

Turn on Debugging information in /etc/courier-imap/pop3d or imapd: DEBUG_LOGIN=2

Then restart courier: /etc/init.d/courier-imapd restart

and .../courier-pop3d restart

Look in /var/log/messages. If this file's gotten too big for you, you need to setup logrotate. Search the forums...

Hope this can get you started. I didn't actually explain how to fix anything cuz we need more information. 

-Skywacker

----------

## Naspe

Tnx a lot for your help. I made all checks u suggested:

The server is fully accesible from outside.

I can ping everything  :Smile: 

Thera are no boot problems (it seems).

I can send email messages to everyone using my server.

If i send a message from an hotmail account to my server there are no errors.

With telnet i get -ERR Login Failed.

svstat is ok, everything up and running.

Tryed Outlook with both IMAP and POP3... Always auth err...

Turned on DEBUG 2... I can see the pass clearly... (may be it is the problem? In mysql the pass is encrypted...)

I think there is something wrong with the auth process  :Very Happy: . May be i forgot to start anything? Or may be a file is fucked up?

Tnx again for your help!!!  :Very Happy: 

----------

## Skywacker

Are you using the full email address for the username?

username= user@fullemailaddress.com

password= yourpass

----------

## Naspe

Found the problem  :Very Happy: 

I started authdaemond. Now everything works fine. That f@#%&*g daemon wasn't on default runlevel and i didn't see that it isn't working...

Now i have to check not to be an open relay server and how to crypt passwords...

----------

## Naspe

As i said i followed this guide to set up mi server.

Is the smtp-auth enabled? How can i test if i am an open rely or not?

----------

## Skywacker

google on how to test if you are an open relay. tons of free services that will check your site for you in a matter of seconds.

as far as encrypting passwords: yes they are encrypted in the mysql database. but with pop3/imap they are sent from the client in clear text. You need to use ssl for imap/pop3 to encrypt the password/message when sending. I don't have this setup so I can't comment. 

There is a 3rd howto mentioned in the middle part of this thread. It's not sabrex and it's not blubbi's. It will get both smtp-auth and ssl working for you.

-Sky

----------

## Pardok

Blubbi,

Wanted to say that I tried your How-To again and now everything works perfectly!

Thank you for the wonderful document and info.    :Very Happy: 

----------

## MadOtis

I've a problem that I haven't seen answered here...  I've followed the instructions in the original post.  All seems well except one problem...

I can't seem to read any mail with anything other than Mutt!  Mutt shows all new e-mail just fine.  But, if I use Evolution or Sylpheed, I get no new e-mail messages displayed in my inbox (for POP3), or in my folders (using IMAP).

What do I need to post that would help diagnose the problem?

Thanks in advance!

----------

## blubbi

 *MadOtis wrote:*   

> I've a problem that I haven't seen answered here...  I've followed the instructions in the original post.  All seems well except one problem...
> 
> I can't seem to read any mail with anything other than Mutt!  Mutt shows all new e-mail just fine.  But, if I use Evolution or Sylpheed, I get no new e-mail messages displayed in my inbox (for POP3), or in my folders (using IMAP).
> 
> What do I need to post that would help diagnose the problem?
> ...

 

Mmmh, seems as if you don't have installed vpopmail? Are you using qmail without vpopmail? 

I don't know how Evolution or Sylpheed works. Are they checking ~/.maildir or do they connect to the pop3 server ?

----------

## MadOtis

Yes, I've double checked... vpopmail is installed and running.  Courier-imap is using vchkpw for both IMAP and POP3 as well, and they are authenticating the virtual users just fine.

I CAN configure Evolution to use local maildir, and in that mode, it shows the new mail.  But, I'm setting this up primarily for remote retrieval of personal and some friend's email, so, I really need the IMAP or POP3 interfaces to work.

----------

## blubbi

try to connect via telnet to pop3 or imap ... take a look in the logs and tell us what you see. Turn debugging on for imap ond pop3d.

----------

## MadOtis

I'm REALLY new to setting this stuff up... how do I turn on debugging for Courier?  I know how for Postfix, but not Courier.

Again, thanks in advance.

----------

## blubbi

 *MadOtis wrote:*   

> I'm REALLY new to setting this stuff up... how do I turn on debugging for Courier?  I know how for Postfix, but not Courier.
> 
> Again, thanks in advance.

 

in /etc/courier-imap/imapd and /etc/courier-imap/pop3d change the lines to this

```
##NAME: DEBUG_LOGIN:0

#

# Dump additional login diagnostics to syslog

#

# DEBUG_LOGIN=0   - turn off login debugging

# DEBUG_LOGIN=1   - turn on login debugging

# DEBUG_LOGIN=2   - turn on login debugging + log passwords too

DEBUG_LOGIN=2
```

Thats it.

Now

```
tail -f /var/log/mail.log
```

Now you can see what's going on

----------

## sabrex

I have posted a new HOWTO.  It is basically the same, but eliminates the Maildir / .maildir problems associated with older vpopmail versions.  The new HOWTO also uses the latest versions of all available components of this setup (masked or not), and thus it may potentially be less stable.

In practice, however, I have found it far more capable and robust than this older configuration.

The new HOWTO is located at https://forums.gentoo.org/viewtopic.php?t=171499

----------

## rjreb

I may have missed this after my initial installation I got this

 *Quote:*   

> Failure while attempting to remove_line() the locals file
> 
> Error. Failed to add domain to assign file
> 
> Error: Could not update file

 

The solution is to:

touch /var/qmail/control/locals

----------

## rjreb

 *slott_hansen wrote:*   

> I've been reading all postings on this forum regarding Squirrelmail - I think and not one of them helped me solve my problem 
> 
> I have setup everything according to the 10 steps in the begining of this forum and when ever I connect to my mail server using Squirrelmail I get the following error message (FEJL = Error - it's danish language):
> 
> ```
> ...

 

Try changing /etc/conf.d/imapd from

MAILDIR=Maildir

to

MAILDIR=.maildir

----------

## arachn1d

i get this error

```
/etc/init.d/svscan stsvscan: warning: unable to stat qmail-smtpd: file does not exist

```

----------

## petterg

 *arachn1d wrote:*   

> i get this error
> 
> ```
> /etc/init.d/svscan stsvscan: warning: unable to stat qmail-smtpd: file does not exist
> 
> ...

 

Well, does it exist?

It's talking about the symlink you have in /service. Does the dir it points to exist?

----------

## YannTechGeek

```

/vadddomain osmose.yanntech.net

Please enter password for postmaster: 

enter password again: 

Failure while attempting to remove_line() the locals file

Error. Failed to add domain to assign file

Error: Could not update file

```

a table was create in database (/etc/vpopmail.conf work successful) but this don't work .... no directory in ~/vpopmail/domains/

----------

## YannTechGeek

I have 2tables :

 * dir_control

 * limits

----------

## petterg

 *YannTechGeek wrote:*   

> 
> 
> ```
> 
> /vadddomain osmose.yanntech.net
> ...

 

If you don't have anything useful in your db it could be a good idea to recreate it.

mysql> drop database vpopmail

the create it again the way the guide tells you to.

You may also find the 'universal' /etc/vpopmail.conf file useful. (Different versions of the mailsystem requires different vpopmail.conf file. This universal thing works with all of them)

```

# Read-only DB

localhost|0|vpopmail|password|vpopmail

# Write DB

localhost|0|vpopmail|password|vpopmail

 

MYSQL_UPDATE_SERVER     localhost

MYSQL_UPDATE_USER       vpopmail

MYSQL_UPDATE_PASSWD     password

 

MYSQL_READ_SERVER       localhost

MYSQL_READ_USER         vpopmail

MYSQL_READ_PASSWD       password

```

Edit: Also delete all files/dirs under /var/vpopmail/domains

----------

## trionnis

 *ARC2300 wrote:*   

> okay. . .I set everything up, yet something's quirky with the vadddomain.
> 
> ```
> Failure while attempting to remove_line() the locals file
> 
> ...

 

```
touch /var/qmail/control/locals
```

----------

## YannTechGeek

Good Job !

very thanks

----------

## Kitrik

Followed directions, got it working, but every now and then I get this error and nothing will send nor deliver:

```
 /etc/init.d/svscan restart

 * Stopping service scan...                                                                                                                            [ ok ]

 * Stopping services...                                                                                                                                [ ok ]

 * Stopping service logging...                                                                                                                         [ ok ]

 * Starting service scan...                                                                                                                            [ ok ]

druchii qmail-send # supervise: fatal: unable to acquire qmail-send/supervise/lock: temporary failure

supervise: fatal: unable to acquire qmail-send/supervise/lock: temporary failure

```

This error just keeps repeating itself over and over again. If I delete the lock file and then touch it, the error goes away but comes back after a few seconds...

Any help would be appreciated!

Kitrik

----------

## Gatak

Has anyone tried to upgrade vpopmail from 5.2.2 to 5.4? I am asking because the vchkpw command is supposed to support cram-md5 for passwords. Is there any configuration issues etc with it?

----------

## petterg

 *Kitrik wrote:*   

> Followed directions, got it working, but every now and then I get this error and nothing will send nor deliver:
> 
> ```
>  /etc/init.d/svscan restart
> 
> ...

 

The solution to your problem is posted somewhere in this thread. I had the same problem, but after reading this thread I found a way to fix it. I don't remember what it was.

----------

## slaapkop

Hi,

Currently I run Postfix as MTA.

I quite happy with postfix at the moment, i read a lot about other MTA's as well. I even did a research on mta's during college. But ontopic, i want to know if an 'emerge -C postfix' is enough to delete postfix. I run postfix with IMAP-ssl, spamassassin etc... I followed the howto on this forum. 

Thanks...!!!

----------

## BoBB

I'm having a major problem with this setup, Ive setup everything just fine, I can login via pop3 or imap over ssl, I can send emails via SMTP, but when I try to send a mail to a virtual domain vdelivermail just hangs on the messages in queue and uses 100% CPU. Almost like it doesnt know where to deliver it, where does vdelivermail send mail for virtual domains? Like /home/username/.users/username/ or what? Also where does vdelivermail hide its logs at?

----------

## BoBB

Alright I managed to get vdelivermail to stop hanging and using 100% CPU, the entries in virtualdoamins was wrong, however it doesnt look like the mail is actually getting delivered, its not showing up in /var/vpopmail/domains/domain.com/user/.maildir/ .... Man I am so lost =/ Anyone have any idea?

----------

## petterg

I also had problem with mail not beeing delivered - I could see it pass trough qmailscanner, but them no more sign of it. This occured after the system had been working for several weeks.

Figured it would be faster to reinstall everything than debug.

----------

## BoBB

This is on  fresh install of qmail so I doubt that reinsalling/configuring will do anything ... it appears that they are sending a  bounceback message that says "that mailox does not exist at this domain" ....

----------

## petterg

 *BoBB wrote:*   

> This is on  fresh install of qmail so I doubt that reinsalling/configuring will do anything ... it appears that they are sending a  bounceback message that says "that mailox does not exist at this domain" ....

 

Check that all files in /var/qmail/control that are supposed to include your domainname acctually does so.

Or you may use vdeldomain vadddomain to recreate the virtual domain.

It may also be some kind of permission problem. Try to run the que-fix posted early in this thread.

----------

## linux_4031

 *dodger10k wrote:*   

> 
> 
> root      1550  0.0  0.0  1316  228 ?        S    02:44   0:00 readproctitle service errors: ...: temporary failure?supervise: fatal: unable to acquire log/supervise/lock: temporary failure?supervise: fatal: unable to acquire log/supervise/lock: temporary failure?supervise: fatal: unable to acquire qmail-send/supervise/lock: temporary failure?supervise: fatal: unable to acquire log/supervise/lock: temporary failure?supervise: fatal: unable to acquire log/supervise/lock: temporary failure?
> 
> What´s going wrong here? Any hints would be appreciated 

 

I had this problem also and found that svscan was starting with an rc script AND it was starting in inittab.  I removed it from the rc script with

 *Quote:*   

> 
> 
> rc-update del svscan default
> 
> 

 

And my problems went away.  Good Luck.

--

Linux User #4031

http://counter.li.org/

----------

## ramidh

I used this guide to install squirrelmail

When I use vpopmail to add a domain or user i get the following error:

 *Quote:*   

> 
> 
> vmysql: error creating table 'dir_control': MySQL server has gone away
> 
> vmysql: sql error[b]: MySQL server has gone away
> ...

 

I'm not good with MySQL and everything I've tried doesn't work.

Please help  :Smile: 

----------

## petterg

try logging in to the mysql server using the vpopmail user and password. Do you get access to the vpopmail database?

----------

## Rooney

I know this is such a simple quesation but i just cant find the answer

what the format when using squirrelmail or even a mail client e.g

user+domain

domain+user

user@domain and so on i cant find the right combination to log in

----------

## petterg

Rooney: when using vpopmail you need to use "user@domain.tld" . This because there is an posibility to have several domains on the same server.

If you skipped installing vpopmail you can use eighter just "user" or "user@domain.tld"

Edit - added:

If you used "mail.domain.tld" when you added the domain (vadddomain) you need to use "user@mail.domain.tld".

----------

## Rooney

 *petterg wrote:*   

> Rooney: when using vpopmail you need to use "user@domain.tld" . This because there is an posibility to have several domains on the same server.
> 
> If you skipped installing vpopmail you can use eighter just "user" or "user@domain.tld"
> 
> Edit - added:
> ...

 

ive tried this but for some reason it just rejects ? mmm now im lost

here is the info if i try and telnet to it.

core root # telnet 127.0.0.1 110

Trying 127.0.0.1...

Connected to 127.0.0.1.

Escape character is '^]'.

+OK Hello there.

user postmaster@*******.co.uk

+OK Password required.

pass ************

Connection closed by foreign host.

core root #

----------

## Doktor

I use non Mysql installation of vpopmail.

Just type:

vuserinfo am@blabla.ru

and recieve:

no such user am@blalba.ru

Some help?

----------

## petterg

 *Doktor wrote:*   

> I use non Mysql installation of vpopmail.
> 
> Just type:
> 
> vuserinfo am@blabla.ru
> ...

 

Does /var/vpopmail/domains/blalba.ru/am/.maildir exist?

What happens when you add users to the vpopmail system? Any errors?

----------

## derheld42

With spamassassin-3.1.0, I believe this conf.d/spamd is incorrect:

SPAMD_OPTS="-d -u vpopmail -v -x -C /etc/mail/spamassassin/local.cf" 

I believe this is more correct:

SPAMD_OPTS="-u vpopmail -x -v"

because /etc/mail/spamassassin and /usr/share/spamassassin are already coded in the spamassassin scripts.

----------

## ababali

I have created an e-mail account from qmailadmin where I can login as postmaster.

I can send and receive e-mails worldwide.

When I send the emails to others recipients.

Instead of full name the "Error: unable to setuid" is placed like below.

From:   "Error: unable to setuid" <ababali@mydomain.com> 

How to solve this issue. I just want that "Error: unable to setuid" to be replaced with my full name.

Other users created before are OK.

Thanks in advance.

----------

## ababali

Just solved. I forget to fill Personal Info.

----------

