Postfix/Sendmail Connection Refused

Hi Guys,

I'm having some trouble on a new server in relation to postfix and sendmail and using PHP's mail() command.

I've setup the server in relation to this guide:

http://library.linode.com/web-applicati … an-5-lenny">http://library.linode.com/web-applications/control-panels/ispconfig/debian-5-lenny

When trying to execute the program, the emails are not being sent to (external accounts) and the logs say the Connection Refused. I have been tirelessly searching for a while now but to no avail. I have included my main.cf file below and also a snippet of the logs.

I appreciate any help that you can give!

James

smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unauth_destination
smtpd_tls_security_level = may
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
maildrop_destination_concurrency_limit = 1
maildrop_destination_recipient_limit = 1
virtual_transport = maildrop
header_checks = regexp:/etc/postfix/header_checks
mime_header_checks = regexp:/etc/postfix/mime_header_checks
nested_header_checks = regexp:/etc/postfix/nested_header_checks
body_checks = regexp:/etc/postfix/body_checks
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings
message_size_limit = 0
54A7AAA18 341 Thu Feb 24 16:39:48 www-data@custard.janorman.co.uk
(delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
___my_email___

59E29AA1D 341 Thu Feb 24 17:18:46 www-data@custard.janorman.co.uk
(connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
___my_email___

CE5E0AA23 332 Thu Feb 24 18:19:53 www-data@custard.janorman.co.uk
(delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
___my_email___

7 Replies

Looks like amavis isn't running try /etc/init.d/amavis restart

Hi, thanks for the reply.

I've just tried restarting a amavis, but it didn't exists. So, i did a apt-get install amavis but there seems to be a conflict in installing with SpamAssasin.

Starting amavisd: Problem in antispam SA code: Can't locate Mail/SpamAssassin.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl) at (eval 91) line 63.
BEGIN failed--compilation aborted at (eval 91) line 63.
(failed).
custard:/etc

Not sure how this can be fixed.

James

Run this apt-get install amavisd-new spamassassin zoo unzip bzip2 arj nomarch lzop cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl again from the doc, it looks like you missed it.

Ok, great that seems to have eradicated the errors but still not receiving the emails. Should the php.ini sendmail_path point towards sendmail or towards postfix? Also heres the updated logs.

-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
891C7AA26 90 Thu Feb 24 19:06:14 root
___EMAIL___

BE467AA2E 90 Thu Feb 24 21:31:22 root
___EMAIL___

E89CBAA30 234 Thu Feb 24 21:33:41 www-data
___EMAIL___

7EFFAA9CF 142 Thu Feb 24 21:20:36 www-data
___EMAIL___

It should point to /usr/sbin/sendmail which is the postfix sendmail compatibility binary.

Set it to that, restart whatever runs php, see if it works if it doesn't show the contents of tail /var/log/mail.log

Its pointing towards /usr/sbin/sendmail.

Here's the log file, it appears that its Clam antivirus messing it around.

custard:/etc/postfix# tail /var/log/mail.log

Feb 25 13:41:33 custard amavis[30196]: (30196-06) (!!)TROUBLE in check_mail: virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED: ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 88) line 309.

Feb 25 13:41:33 custard amavis[30196]: (30196-06) (!)PRESERVING EVIDENCE in /var/lib/amavis/tmp/amavis-20110225T134126-30196
Feb 25 13:41:33 custard amavis[30397]: (30397-03) (!!)ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 88) line 309.

Feb 25 13:41:33 custard amavis[30397]: (30397-03) (!!)WARN: all primary virus scanners failed, considering backups

Feb 25 13:41:33 custard amavis[30397]: (30397-03) (!!)TROUBLE in check_mail: virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED: ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 88) line 309.

Feb 25 13:41:33 custard amavis[30397]: (30397-03) (!)PRESERVING EVIDENCE in /var/lib/amavis/tmp/amavis-20110225T134126-30397
Feb 25 13:41:33 custard postfix/smtp[724]: 1F469AA13: to=<james.norman91@gmail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=95432, delays=95425/0.01/0/7.1, dsn=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 Error in processing, id=30196-06, virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED: ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 88) line 309\. (in reply to end of DATA command))

Feb 25 13:41:33 custard postfix/smtp[723]: 1471FAA16: to=<james.norman91@gmail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=94975, delays=94968/0.01/0/7.1, dsn=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 Error in processing, id=30397-03, virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED: ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 88) line 309\. (in reply to end of DATA command))

Feb 25 13:41:34 custard amavis[30196]: (30196-07) (!)ClamAV-clamd: Can't connect to UNIX socket /var/run/clamav/clamd.ctl: 2, retrying (2)

Feb 25 13:41:34 custard amavis[30397]: (30397-04) (!)ClamAV-clamd: Can't connect to UNIX socket /var/run/clamav/clamd.ctl: 2, retrying (2)</james.norman91@gmail.com></james.norman91@gmail.com> 

I've just removed ClamAV and Amavis as per this guide. Resrated and no luck.

http://www.faqforge.com/linux/controlpa … pconfig-3/">http://www.faqforge.com/linux/controlpanels/ispconfig3/how-to-disable-spamfilter-and-antivirus-functions-in-ispconfig-3/

Cheers obs, It's all working now. After disabling CLAMAV and AMAVIS, i then had to create the postfix virtual directories as they didnt exists. and now i have around 300 emails in my inbox.

Cheers, really appreciate the help.

James

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct