Loading ...
Sorry, an error occurred while loading the content.

Re: Problem invoking spamassassin with postfix

Expand Messages
  • James M
    Brian- The problem is solved I believe. Thanks to you I realized my bonehead oversight. My test alias file was not set properly. I was relaying to another
    Message 1 of 6 , Feb 28, 2008
    • 0 Attachment
      Brian-
      The problem is solved I believe. Thanks to you I realized my bonehead
      oversight. My test alias file was not set properly. I was relaying to
      another machine rather than to a locally defined user thus, as you
      said, bypassing the spam check.

      Sometimes it takes another perspective to realize ones mistakes and I
      thank you for the help.
      -James

      On Thu, Feb 28, 2008 at 12:34 PM, Brian Evans <grknight@...> wrote:
      > James M wrote:
      > > My existing postfix server (2.x) is working perfectly utilizing the
      > > mailbox_command for spam checking. Why the new server won't work is a
      > > mystery I need to solve. Could 2.3.5 have introduced something to
      > > break it?
      > > I did notice I was missing alias_maps on the new server. Added it to no avail.
      > >
      > > My situation is as follows. Each user has their own user_prefs file
      > > for whitelisting in their home dirs on the postfix server. I wrote a
      > > web program allowing them to maintain it. I then have a procmailrc
      > > file in each homedir forwarding it to our internal lotus notes server.
      > > As I said this is working perfectly.
      > >
      > > Would a content filter be appropriate for the above scenario? It
      > > doesn't seem so to me.
      > >
      > > Any suggestions other than reinventing the wheel?
      > > Thanks for the help!!
      > >
      > The log you posted shows a gateway (mandy2) MX that's relaying to
      > another machine (domino).
      > Postfix does not use the mailbox_command unless the mailbox is on mandy2
      > (in your example).
      >
      > Now if you had a .forward in each user's directory on postfix, then you
      > may get the expected behavior.
      > An alias file in postfix that points to a different machine will bypass
      > any local(8) deliveries.
      > Some admins may frown on this as there could be a higher overhead.
      >
      > A content_filter with a custom script may be the way to go.
      > However getting the correct rc file to pull in may be a bit tricky.
      > This is because you should never run it as root and I don't believe you
      > can switch running users easily.
      > (Maybe if you moved the rc files somewhere else that the script could
      > read from?)
      >
      > I cannot comment on previous behaviors, but the ChangeLog shows no such
      > major adjustments that i can see.
      >
      > Brian
      >
      >
      >
      > > On Thu, Feb 28, 2008 at 11:18 AM, Brian Evans <grknight@...> wrote:
      > >
      > >> Brian Evans wrote:
      > >> > James M wrote:
      > >> >> Hello-
      > >> >> I'm building a new server with postfix 2.3.5 and sa 3.1.9.
      > >> >> I've modeled the setup against a working postfix/sa server but cannot
      > >> >> figure out why postfix will not invoke spamassassin.
      > >> >> I know sa is working since I can successfully scan a mail message from
      > >> >> the command line.
      > >> >> Postfix seems to be working properly in other respects in that it
      > >> >> delivers the message as expected but without the spam scan.
      > >> >> Here's the log of a message that didn't get scanned as hoped....
      > >> >> Feb 28 09:31:42 mandy2 postfix/smtpd[4263]: connect from
      > >> >> mandy4.example.com[1.2.3.4]
      > >> >> Feb 28 09:32:08 mandy2 postfix/smtpd[4263]: 3BD476A050F:
      > >> >> client=mandy4.example.c
      > >> >> om[1.2.3.4]
      > >> >> Feb 28 09:32:45 mandy2 postfix/cleanup[4266]: 3BD476A050F:
      > >> >> message-id=<200802281
      > >> >> 43208.3BD476A050F@...>
      > >> >> Feb 28 09:32:45 mandy2 postfix/qmgr[3579]: 3BD476A050F:
      > >> >> from=<jim@...>, size
      > >> >> =413, nrcpt=1 (queue active)
      > >> >> Feb 28 09:32:45 mandy2 postfix/cleanup[4266]: 73C096A0516:
      > >> >> message-id=<200802281
      > >> >> 43208.3BD476A050F@...>
      > >> >> Feb 28 09:32:45 mandy2 postfix/qmgr[3579]: 73C096A0516:
      > >> >> from=<jim@...>, size
      > >> >> =545, nrcpt=1 (queue active)
      > >> >> Feb 28 09:32:45 mandy2 postfix/local[4267]: 3BD476A050F:
      > >> >> to=<syjim@...>,
      > >> >> orig_to=<syjim>, relay=local, delay=44, delays=44/0.05/0/0.01,
      > >> >> dsn=2.0.0, statu
      > >> >> s=sent (forwarded as 73C096A0516)
      > >> >>
      > >> > Notice this is being forwarded to another machine. You currently have
      > >> > spamc running via mailbox_command.
      > >> > mailbox_command is only executed on delivery a mailbox via local(8).
      > >> >
      > >> > mailbox_command (default: empty)
      > >> >
      > >> > Optional external command that the local(8) delivery agent should
      > >> > use for mailbox delivery.
      > >> >
      > >> > Brian
      > >> The correct way to handle this is either a content_filter or a milter.
      > >>
      > >> One way can be found at http://onetforum.com/fourm/viewtopic.php?p=63
      > >> There are several SA milters out there too. Take your pick.
      > >>
      > >> If you want virus scanning as well, which is probably a good idea, check
      > >> amavisd-new.
      > >>
      > >>
      > >>
      > >> Brian
      > >> >> Feb 28 09:32:45 mandy2 postfix/qmgr[3579]: 3BD476A050F: removed
      > >> >> Feb 28 09:32:45 mandy2 postfix/smtp[4268]: 73C096A0516:
      > >> >> to=<jim@...
      > >> >> .com>, orig_to=<syjim>, relay=domino.example.com[1.2.3.7]:25, delay
      > >> >> =0.04, delays=0.01/0.02/0.01/0, dsn=2.0.0, status=sent (250 Message
      > >> >> accepted for
      > >> >> delivery)
      > >> >> Feb 28 09:32:45 mandy2 postfix/qmgr[3579]: 73C096A0516: removed
      > >> >>
      > >> >> Here's more info..
      > >> >> [root@mandy2 mail]# postconf -n
      > >> >> command_directory = /usr/sbin
      > >> >> config_directory = /etc/postfix
      > >> >> daemon_directory = /usr/lib/postfix
      > >> >> html_directory = /usr/share/doc/postfix-2.3.5/html
      > >> >> inet_interfaces = all
      > >> >> mail_owner = postfix
      > >> >> mailbox_command = /usr/bin/procmail -a "$EXTENSION"
      > >> >> mailq_path = /usr/bin/mailq
      > >> >> manpage_directory = /usr/share/man
      > >> >> mydestination = $myhostname, localhost.$mydomain, localhost $mydomain
      > >> >> mydomain = example.com
      > >> >> myhostname = mandy2.example.com
      > >> >> mynetworks = 127.0.0.1/32 1.2.3.0/24 4.5.6.0/24
      > >> >> mynetworks_style = host
      > >> >> myorigin = $mydomain
      > >> >> newaliases_path = /usr/bin/newaliases
      > >> >> queue_directory = /var/spool/postfix
      > >> >> readme_directory = /usr/share/doc/postfix-2.3.5/README_FILES
      > >> >> sendmail_path = /usr/sbin/sendmail.postfix
      > >> >> setgid_group = postdrop
      > >> >> smtpd_banner = $mydomain mail server
      > >> >> unknown_local_recipient_reject_code = 450
      > >> >> [root@mandy2 mail]#
      > >> >>
      > >> >> [root@mandy2 mail]# more /etc/procmailrc
      > >> >> DROPPRIVS=yes
      > >> >> :0fw
      > >> >> * < 512000
      > >> >> | /usr/bin/spamc
      > >> >> [root@mandy2 mail]#
      > >> >>
      > >> >> [root@mandy2 mail]# ls -la /usr/bin/spamc
      > >> >> -rwxr-xr-x 1 root root 26344 Jun 13 2007 /usr/bin/spamc*
      > >> >>
      > >> >> [root@mandy2 log]# ps -ef|grep spam
      > >> >> root 4237 1 0 09:26 ? 00:00:01 /usr/bin/spamd -d -c
      > >> >> -m5 -H -s /var/log/spamd.log
      > >> >> root 4238 4237 0 09:26 ? 00:00:00 spamd child
      > >> >> root 4239 4237 0 09:26 ? 00:00:00 spamd child
      > >> >> root 4413 4169 0 10:18 pts/1 00:00:00 grep spam
      > >> >> [root@mandy2 log]#
      > >> >>
      > >> >> [root@mandy2 mail]# grep syjim /etc/postfix/aliases
      > >> >> syjim: jim@...
      > >> >>
      > >> >> I REALLY appreciate any insight as I've been struggling for 2 days
      > >> >> trying to find the reason.
      > >> >>
      > >> >> If you need more info please let me know. I'm still a little
      > >> >> inexperienced with postfix. I'm primarily a mainframe guy who also
      > >> >> handles the linux servers.
      > >> >>
      > >> >> -James
      > >> >>
      > >>
      > >>
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.