I have followed the howto intructions ( http://www.howtoforge.com/linux_spam_filter_mail_gateway )to the letter on two identical boxes, MailScanner is up and working great in a production environment (we are scanning for multiple companies and $CHARGING$ for this service). However - after installation and configuration local mail delivery is gone. Also the ability to send e-mail from the command line is gone. What happened? While the MailScanner is working great, I no longer can get any logfiles or alerts from the box (only internal messages sent from MailScanner or Postfix get delivered). Any help?? [root@mailgateway1 private]# mail root Subject: test Cc: Null message body; hope that's ok [root@mailgateway1 private]# mail No mail for root maillog dump: Feb 23 08:19:15 mailgateway1 sendmail[17886]: k1NGJFcZ017886: from=root, size=24, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost The mail gets dumped into the /var/spool/clientmqueue/qfk1NGJFcZ017886 and /var/spool/clientmqueue/dfk1NGJFcZ017886 files [root@mailgateway1 private]# cat /var/spool/clientmqueue/qfk1NGJFcZ017886 V6 T1140711555 K0 N0 P30024 Fbs $_root@localhost ${daemon_flags}c u Sroot [email protected] C:root rRFC822; [email protected] RPFD:root H?P?Return-Path: <g> H??Received: (from root@localhost) by mailgateway1.xyz.com (8.12.11/8.12.11/Submit) id k1NGJFcZ017886 for root; Thu, 23 Feb 2006 08:19:15 -0800 H?D?Date: Thu, 23 Feb 2006 08:19:15 -0800 H?F?From: root <root> H?x?Full-Name: root H?M?Message-Id: <[email protected]> H??To: root H??Subject: test . Any suggestions?
Do you have more lines from the mail log? BTW, do you use Sendmail or Postfix? From what you posted it looks like Sendmail.
That is where I am having the problem. I am using Postfix - I assume there is something wrong (or something not detailed) in the MailScanner howto. This is a first for me both with Postfix and MailScanner - had always used Sendmail/Amavis in the past. Seems like local mail is getting passed to sendmail and NOT to postfix, although I thought I read somewhere that Postfix does not handle local mail relay?? Can't remember. How much and what do you want from the maillog? Here is tail from the current log. Feb 27 07:54:46 mailgateway1 MailScanner[18449]: Using SpamAssassin results cache Feb 27 07:54:46 mailgateway1 MailScanner[18449]: Connected to SpamAssassin cache database Feb 27 07:54:46 mailgateway1 MailScanner[18449]: Enabling SpamAssassin auto-whitelist functionality... Feb 27 07:54:47 mailgateway1 MailScanner[18449]: Using locktype = flock Feb 27 07:55:17 mailgateway1 postfix/smtpd[18326]: connect from adsl-68-126-108-20.dsl.sndg02.pacbell.net[68.126.108.20] Feb 27 07:55:17 mailgateway1 postfix/smtpd[18326]: lost connection after CONNECT from adsl-68-126-108-20.dsl.sndg02.pacbell.net[68.126.108.20] Feb 27 07:55:17 mailgateway1 postfix/smtpd[18326]: disconnect from adsl-68-126-108-20.dsl.sndg02.pacbell.net[68.126.108.20] Feb 27 07:55:23 mailgateway1 postfix/smtpd[18326]: connect from unknown[61.168.180.49] Feb 27 07:55:25 mailgateway1 postfix/smtpd[18326]: 1798939809A: client=unknown[61.168.180.49] Feb 27 07:55:25 mailgateway1 postfix/smtpd[18326]: 1798939809A: reject: RCPT from unknown[61.168.180.49]: 554 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=SMTP helo=<476E58F0> Feb 27 07:55:27 mailgateway1 postfix/smtpd[18326]: disconnect from unknown[61.168.180.49] Feb 27 07:56:02 mailgateway1 postfix/smtpd[18326]: warning: smtpd_peer_init: 85.60.57.213: hostname 85-60-57-213.mad5.adsl.uni2.es verification failed: Name or service not known Feb 27 07:56:02 mailgateway1 postfix/smtpd[18326]: connect from unknown[85.60.57.213] Feb 27 07:56:02 mailgateway1 postfix/smtpd[18326]: 94BAB39809A: client=unknown[85.60.57.213] Feb 27 07:56:04 mailgateway1 postfix/cleanup[18104]: 94BAB39809A: hold: header Received: from baiadelcigno.it (unknown [85.60.57.213])??by mailgateway1.ktechla.com (Postfix) with SMTP id 94BAB39809A??for <connelly@_________.com>; Mon, 27 Feb 2006 07:56:02 -0800 (PST) from unknown[85.60.57.213]; from=<[email protected]> to=<[email protected]> proto=SMTP helo=<baiadelcigno.it> Feb 27 07:56:04 mailgateway1 postfix/cleanup[18104]: 94BAB39809A: message-id=<000001c63bb6$4743cc30$7ca3a8c0@quo22> Feb 27 07:56:04 mailgateway1 postfix/smtpd[18326]: disconnect from unknown[85.60.57.213] Feb 27 07:56:05 mailgateway1 MailScanner[18449]: New Batch: Scanning 1 messages, 3498 bytes Feb 27 07:56:06 mailgateway1 MailScanner[18449]: Spam Checks: Found 1 spam messages Feb 27 07:56:06 mailgateway1 MailScanner[18449]: Virus and Content Scanning: Starting Feb 27 07:56:07 mailgateway1 MailScanner[18449]: Requeue: 94BAB39809A.0796C to 09FEB398594 Feb 27 07:56:07 mailgateway1 postfix/nqmgr[2545]: 09FEB398594: from=<[email protected]>, size=4186, nrcpt=1 (queue active) Feb 27 07:56:07 mailgateway1 MailScanner[18449]: Uninfected: Delivered 1 messages Feb 27 07:56:07 mailgateway1 MailScanner[18449]: Batch processed in 2.08 seconds Feb 27 07:56:07 mailgateway1 postfix/smtp[18188]: 09FEB398594: to=<spam@_________.net>, orig_to=<unknown>, relay=192.168.111.3[192.168.111.3], delay=5, status=sent (250 2.6.0 <000001c63bb6$4743cc30$7ca3a8c0@quo22> Queued mail for delivery)
Looks like Postfix is running now. I can't find errors in the log excerpt you posted. Are emails delivered now?
Thanks for the obvious - I have no issues with postfix running or delivering mail - THE ONLY problem I have is that all mail sent from the command line, when "mail" is invoked causes mail to be directed via sendmail... All mail that is sent via MailScanner (the mail that I am filtering for other domains, or internal MailScanner mails, like alerts to admins) gets sent and delivered - with the exception of local accounts, i.e send an alert to user root when a virus is found - something like that never gets delivered - it just goes to /var/spool/clientmqueue/ "When files accumulate in /var/spool/clientmqueue, you probably don't run the sendmail localhost MTA, and thus the mails don't get sent." So how do I make Postfix handle the delivery of local mail as well as relaying mail for other domains?
postfix main.cf # SOFT BOUNCE #soft_bounce = no # LOCAL PATHNAME INFORMATION queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix # QUEUE AND PROCESS OWNERSHIP mail_owner = postfix #default_privs = nobody # INTERNET HOST AND DOMAIN NAMES myhostname = mailgateway1.________.com mydomain = ________.com # SENDING MAIL myorigin = $mydomain # RECEIVING MAIL inet_interfaces = all #proxy_interfaces = mydestination = $myhostname, localhost.$mydomain $mydomain localhost.localdomain # REJECTING MAIL FOR UNKNOWN LOCAL USERS #local_recipient_maps = unixasswd.byname $alias_maps #local_recipient_maps = proxy:unixasswd.byname $alias_maps #local_recipient_maps = unknown_local_recipient_reject_code = 450 # TRUST AND RELAY CONTROL mynetworks_style = host #mynetworks = relay_domains = PROTECTED TO SPARE THE INNOCENT transport_maps = hash:/etc/postfix/transport # INTERNET OR INTRANET #relayhost = $mydomain #relayhost = gateway.my.domain #relayhost = uucphost #relayhost = [an.ip.add.ress] # REJECTING UNKNOWN RELAY USERS #relay_recipient_maps = hash:/etc/postfix/relay_recipients # INPUT RATE CONTROL #in_flow_delay = 1s # ADDRESS REWRITING alias_maps = hash:/etc/postfix/aliases #alias_database = dbm:/etc/aliases #alias_database = dbm:/etc/mail/aliases #alias_database = hash:/etc/aliases #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases # ADDRESS EXTENSIONS (e.g., user+foo) #recipient_delimiter = + # DELIVERY TO MAILBOX home_mailbox = Mailbox #mail_spool_directory = /var/mail mail_spool_directory = /var/spool/mail #mailbox_command = /some/where/procmail #mailbox_command = /some/where/procmail -a "$EXTENSION" #mailbox_transport = lmtp:unix:/file/name #mailbox_transport = cyrus #fallback_transport = lmtp:unix:/file/name #fallback_transport = cyrus #fallback_transport = #luser_relay = [email protected] #luser_relay = [email protected] #luser_relay = admin+$local # JUNK MAIL CONTROLS #header_checks = regexp:/etc/postfix/header_checks # FAST ETRN SERVICE #fast_flush_domains = $relay_domains #fast_flush_domains = # SHOW SOFTWARE VERSION OR NOT #smtpd_banner = $myhostname ESMTP $mail_name #smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) # PARALLEL DELIVERY TO THE SAME DESTINATION #local_destination_concurrency_limit = 2 #default_destination_concurrency_limit = 20 # DEBUGGING CONTROL debug_peer_level = 2 #debug_peer_list = 127.0.0.1 #debug_peer_list = some.domain debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin xxgdb $daemon_directory/$process_name $process_id & sleep 5 # INSTALL-TIME CONFIGURATION INFORMATION sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop manpage_directory = /usr/share/man sample_directory = /usr/share/doc/postfix-2.0.18/samples readme_directory = /usr/share/doc/postfix-2.0.18/README_FILES alias_database = hash:/etc/postfix/aliases append_at_myorigin = no header_checks = regexp:/etc/postfix/header_checks
You should appand localhost to the mydestination line (and add some commas): Code: mydestination = $myhostname, localhost.$mydomain[B][COLOR="Red"],[/COLOR][/B] $mydomain[B][COLOR="Red"],[/COLOR][/B] localhost.localdomain[B][COLOR="Red"], localhost[/COLOR][/B] and restart Postfix.