# [dspam - postfix] don't work (Unable to connect to server)

## opotonil

Hi,

My dspam.conf:

```

Home /var/spool/dspam 

 StorageDriver /usr/lib/dspam/libpgsql_drv.so 

 TrustedDeliveryAgent "/usr/bin/procmail" 

 DeliveryHost        localhost 

 DeliveryPort        24 

 DeliveryIdent       localhost 

 DeliveryProto       SMTP 

 OnFail error 

 Trust root 

 Trust dspam 

 Trust apache 

 Trust mail 

 Trust mailnull 

 Trust smmsp 

 Trust daemon 

 TrainingMode teft 

 TestConditionalTraining on 

 Feature whitelist 

 Algorithm graham burton 

 Tokenizer chain 

 PValue bcr 

 WebStats on 

 Preference "signatureLocation=message"  # 'message' or 'headers' 

 Preference "showFactors=on" 

 Preference "spamAction=tag" 

 Preference "spamSubject=SPAM" 

 AllowOverride trainingMode 

 AllowOverride spamAction spamSubject 

 AllowOverride statisticalSedation 

 AllowOverride enableBNR 

 AllowOverride enableWhitelist 

 AllowOverride signatureLocation 

 AllowOverride showFactors 

 AllowOverride optIn optOut 

 AllowOverride whitelistThreshold 

 PgSQLServer localhost 

 PgSQLPort       5432 

 PgSQLUser       dspam 

 PgSQLPass       xxx 

 PgSQLDb         dspam 

 PgSQLConnectionCache    3 

 HashRecMax              98317 

 HashAutoExtend          on 

 HashMaxExtents          0 

 HashExtentSize          49157 

 HashPctIncrease 10 

 HashMaxSeek             10 

 HashConnectionCache     10 

 Notifications   off 

 PurgeSignature  off # Specified in purge.sql 

 PurgeNeutral   90 

 PurgeUnused    off # Specified in purge.sql 

 PurgeHapaxes   off # Specified in purge.sql 

 PurgeHits1S    off # Specified in purge.sql 

 PurgeHits1I    off # Specified in purge.sql 

 LocalMX 127.0.0.1 

 SystemLog on 

 UserLog   on 

 Opt out 

 ServerQueueSize        32 

 ServerPID              /var/run/dspam/dspam.pid 

 ServerMode auto 

 ServerParameters        "--deliver=innocent, spam -d %u" 

 ServerIdent             "localhost.xxx.es" 

 ServerDomainSocketPath  "/var/run/dspam/dspam.sock" 

 ClientHost      "/var/run/dspam/dspam.sock" 

 ProcessorURLContext on 

 ProcessorBias on 

```

The error:

```

Nov  8 13:53:02 server postfix/smtpd[9287]: connect from wx-out-0506.google.com[66.249.82.224] 

 Nov  8 13:53:03 server postfix/smtpd[9287]: 5A2CE30C99: client=wx-out-0506.google.com[66.249.82.224] 

 Nov  8 13:53:04 server postfix/cleanup[9291]: 5A2CE30C99: message-id=<200711081351.46413.xxx@gmail.com> 

 Nov  8 13:53:04 server postfix/qmgr[8575]: 5A2CE30C99: from=<xxx@gmail.com>, size=2042, nrcpt=1 (queue active) 

 Nov  8 13:53:04 server postfix/lmtp[9292]: 5A2CE30C99: to=<xxx@xxx.es>, relay=mail.xxx.es[/var/run/dspam/dspam.sock], delay=1, delays=0.93/0.05/0/0.06, dsn=4.3.0, status=deferred (host mail.xxx.es[/var/run/dspam/dspam.sock] said: 421 4.3.0 <xxx@xxx.es> Unable to connect to server (in reply to end of DATA command)) 

 Nov  8 13:53:34 server postfix/smtpd[9287]: disconnect from wx-out-0506.google.com[66.249.82.224]

```

and comment out:

```

#ServerParameters        "--deliver=innocent, spam -d %u" 

 #ServerIdent             "localhost.xxx.es" 

```

The error don't appear, but the email don't arrive:

```

Nov  8 13:56:29 server postfix/smtpd[9383]: connect from an-out-0708.google.com[209.85.132.246] 

 Nov  8 13:56:29 server postfix/smtpd[9383]: DFBD430C9B: client=an-out-0708.google.com[209.85.132.246] 

 Nov  8 13:56:30 server postfix/cleanup[9386]: DFBD430C9B: message-id=<200711081355.12943.xxx@gmail.com> 

 Nov  8 13:56:30 server postfix/qmgr[8575]: DFBD430C9B: from=<xxx@gmail.com>, size=2336, nrcpt=1 (queue active) 

 Nov  8 13:56:30 server postfix/lmtp[9387]: DFBD430C9B: to=<xxx@xxx.es>, relay=mail.xxx.es[/var/run/dspam/dspam.sock], delay=0.68, delays=0.53/0.05/0/0.09, dsn=2.6.0, status=sent (250 2.6.0 <xxx@xxx.es> Message accepted for delivery) 

 Nov  8 13:56:30 server postfix/qmgr[8575]: DFBD430C9B: removed 

 Nov  8 13:57:00 server postfix/smtpd[9383]: disconnect from an-out-0708.google.com[209.85.132.246]

```

master.cf

```

smtp      inet  n       -       n       -       -       smtpd 

   -o content_filter=lmtp:unix:/var/run/dspam/dspam.sock 

 localhost:24 inet n     -       n       -       -       smtpd 

   -o mynetworks=127.0.0.1/8 

   -o smtpd_recipient_restrictions=permit_mynetworks, reject 

   -o smtpd_authorized_xforward_host=127.0.0.1/8 

```

Bye and thanks.

----------

## steveb

Remove the space after the comma:

```
ServerParameters        "--deliver=innocent, spam -d %u"
```

// SteveB

----------

## opotonil

thanks by your reply.

I have removed the space after the comma and I have restarted dspam, but the error persist (this time duplicated):

```

Nov  9 13:04:07 server postfix/smtpd[7097]: connect from mu-out-0910.google.com[209.85.134.190]

Nov  9 13:04:07 server postfix/smtpd[7097]: 9AE1F30C5A: client=mu-out-0910.google.com[209.85.134.190]

Nov  9 13:04:07 server postfix/cleanup[7102]: 9AE1F30C5A: message-id=<200711091302.45883.xxx@gmail.com>

Nov  9 13:04:07 server postfix/qmgr[6671]: 9AE1F30C5A: from=<xxx@gmail.com>, size=2365, nrcpt=1 (queue active)

Nov  9 13:04:08 server postfix/lmtp[7103]: 9AE1F30C5A: to=<xxx@xxx.es>, relay=mail.xxx.es[/var/run/dspam/dspam.sock], delay=0.92, delays=0.39/0.1/0/0.43, dsn=4.3.0, status=deferred (host mail.xxx.es[/var/run/dspam/dspam.sock] said: 421 4.3.0 <xxx@xxx.es> Unable to connect to server (in reply to end of DATA command))

Nov  9 13:04:08 server postfix/qmgr[6671]: 9AE1F30C5A: from=<xxx@gmail.com>, size=2365, nrcpt=1 (queue active)

Nov  9 13:04:08 server postfix/lmtp[7103]: 9AE1F30C5A: to=<xxx@xxx.es>, relay=mail.xxx.es[/var/run/dspam/dspam.sock], delay=1.2, delays=1.1/0/0/0.07, dsn=4.3.0, status=deferred (host mail.xxx.es[/var/run/dspam/dspam.sock] said: 421 4.3.0 <xxx@xxx.es> Unable to connect to server (in reply to end of DATA command))

Nov  9 13:04:37 server postfix/smtpd[7097]: disconnect from mu-out-0910.google.com[209.85.134.190]

```

Bye and thanks again.

----------

## steveb

Are you using procmail for delivery? Have you tried to switch to the sendmail binary instead?

Try this in your dspam.conf:

```
TrustedDeliveryAgent   "/usr/sbin/sendmail"

UntrustedDeliveryAgent   "/usr/sbin/sendmail"

ServerParameters      "--deliver=innocent,spam"
```

Could you try to change your Postfix master.cf to this:

```
smtp      inet  n       -       n       -       -       smtpd

   -o content_filter=lmtp:unix:/var/run/dspam/dspam.sock

127.0.0.1:24 inet n      -       n       -      -       smtpd

   -o content_filter=

   -o local_header_rewrite_clients=

   -o local_recipient_maps=

   -o mynetworks=127.0.0.0/8

   -o mynetworks_style=host

   -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks,no_milters

   -o relay_recipient_maps=

   -o smtp_send_xforward_command=yes

   -o smtpd_authorized_xforward_hosts=127.0.0.0/8

   -o smtpd_client_connection_count_limit=0

   -o smtpd_client_connection_rate_limit=0

   -o smtpd_client_restrictions=permit_mynetworks,reject

   -o smtpd_data_restrictions=reject_unauth_pipelining

   -o smtpd_delay_reject=no

   -o smtpd_end_of_data_restrictions=

   -o smtpd_error_sleep_time=0

   -o smtpd_hard_error_limit=1000

   -o smtpd_helo_restrictions=

   -o smtpd_recipient_restrictions=permit_mynetworks,reject

   -o smtpd_restriction_classes=

   -o smtpd_sender_restrictions=

   -o smtpd_soft_error_limit=1001

   -o strict_rfc821_envelopes=yes
```

Did that solved your problem?

// SteveB

----------

## opotonil

It didn't solved my problem, persist the same error.

I think I will try another integration method becase I can not think what else try and I can't find information about the error at google.

Thanks.

----------

## overkll

Try running dspam in debug mode, then check the dspam.debug log for errors.

----------

