Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Feb 24, 2011 3:18 pm 
Offline
Senior Newbie

Joined: Mon Feb 21, 2011 9:09 am
Posts: 5
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

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

Code:
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



Code:
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___


Top
   
 Post subject:
PostPosted: Thu Feb 24, 2011 3:39 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Looks like amavis isn't running try
Code:
/etc/init.d/amavis restart

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Thu Feb 24, 2011 4:36 pm 
Offline
Senior Newbie

Joined: Mon Feb 21, 2011 9:09 am
Posts: 5
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.

Code:
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


Top
   
 Post subject:
PostPosted: Thu Feb 24, 2011 5:04 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Run this
Code:
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.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Thu Feb 24, 2011 5:39 pm 
Offline
Senior Newbie

Joined: Mon Feb 21, 2011 9:09 am
Posts: 5
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.

Code:
-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___
[/quote]


Top
   
 Post subject:
PostPosted: Fri Feb 25, 2011 7:29 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
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

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Fri Feb 25, 2011 9:43 am 
Offline
Senior Newbie

Joined: Mon Feb 21, 2011 9:09 am
Posts: 5
Its pointing towards /usr/sbin/sendmail.

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

Code:
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)


I've just removed ClamAV and Amavis as per this guide. Resrated and no luck.
http://www.faqforge.com/linux/controlpa ... pconfig-3/


Top
   
 Post subject:
PostPosted: Fri Feb 25, 2011 10:00 am 
Offline
Senior Newbie

Joined: Mon Feb 21, 2011 9:09 am
Posts: 5
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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group