Re: Spamassassin emails have wrong perms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Justin Willmert wrote:
I am hoping somebody can help me solve a problem I am having with procmail and spamassassin (specifically spamd). When spamassassin has marked a message as spam, it gets sorted to a Junk folder, but the problem is that it is owned by root:mail when it should be owned by the user. When this happens, dovecot will not serve the email to the user. I sort other emails into folders with simple matching rules and those work fine. Spamassassin is the only rule that is piped out to a program.

Here is the relevant portion my procmailrc file:

   DROPPRIV=yes                    # Make this run as a normal user. If
   you need
                                   # root privileges for something, do
   it before
                                   # this line.
   # Send mail through spamassassin
   :0fw
   | spamc -u $LOGNAME

   # Now that we've tagged the spam, put in the appropriate folder
   :0
   * ^X-Spam-Status: Yes
   .Junk/

I've tried taking the -u $LOGNAME portion out too and that doesn't work. Following is a maillog sample.

   Jan 29 17:47:11 netserv sendmail[19847]: k0TNlAig019847: Milter add:
   header: X-Virus-Scanned: ClamAV 0.88/1257/Sun Jan 29 09:15:47 2006
   on mydomain.com
   Jan 29 17:47:11 netserv sendmail[19847]: k0TNlAig019847: Milter add:
   header: X-Virus-Status: Clean
   Jan 29 17:47:11 netserv spamd[19654]: connection from mydomain.com
   [127.0.0.1] at port 57905
   Jan 29 17:47:11 netserv spamd[19654]: handle_user: unable to find
   user 'justin'!
   Jan 29 17:47:11 netserv spamd[19654]: Still running as root: user
not specified with -u, not found, or set to root. Fall back to nobody.
   Jan 29 17:47:11 netserv spamd[19654]: processing message
   <BAY107-F2792E57045186E9EED3A038A160@xxxxxxx> for justin:99.
   Jan 29 17:47:11 netserv spamd[19654]: cannot write to
   /etc/mail/bayes/bayes_journal, Bayes db update ignored: Permission
   denied
   Jan 29 17:47:13 netserv spamd[19654]: clean message (1.7/5.0) for
   justin:99 in 1.5 seconds, 1076 bytes.
   Jan 29 17:47:13 netserv spamd[19654]: result: .  1 -
   BAYES_50,DNS_FROM_RFC_POST,MSGID_FROM_MTA_HEADER
scantime=1.5,size=1076,mid=<BAY107-F2792E57045186E9EED3A038A160@xxxxxxx>,bayes=0.499999999735837,autolearn=no
   Jan 29 17:47:13 netserv sendmail[19849]: k0TNlAig019847:
   to=<justin@xxxxxxxxxxxx>, delay=00:00:02, xdelay=00:00:02,
   mailer=local, pri=30995, dsn=2.0.0, stat=Sent

As you can see, I've also got a problem with not being able to access the bayes_journal. I've put it in it's own directory and made them owned by nobody:staff and still nothing. Anyway, here is my local.cf file:

   # These values can be overridden by editing
   ~/.spamassassin/user_prefs.cf
   # (see spamassassin(1) for details)

   # How many hits before a message is considered spam. The lower the
   number, the
   # more sensitive it is.
   required_hits 5

   # Encapsulate spam in an attachment (0=No, 1=Yes in message/rfc822,
   #       2=Yes in text/plain)
   report_safe 0

   # Text to prepend to subject of spam
   rewrite_header Subject [SPAM]

   # Enable the Bayes System
   use_bayes 1

   # Enable Bayes auto-learning
   bayes_auto_learn 1

   # Mail using languages used in these country codes will not be
   marked as being
   # possibly spam in a foreign language.
   ok_languages en

I'd be happy to send along any other information you need. Thanks for help in advance.

Justin Willmert

I found my problem with mail being owned by root:mail...it turns out I had one small typo. I had put DROPPRIV=yes rather than DROPPRIVS=yes (note the added 'S'). Now all I have left to find is why spamd wants to connect to an LDAP server (file permissions have a temporary fix...browse the fedora-selinux-list for what I did there). When everything gets worked out, I'll post a message with my full solution to both lists.

Justin


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux