When my email server get an email, if Procmail processes the email before Spambayes does, then the email is delivered to a sub-folder on my IMAP server. However, if it does go directly through Spambayes, then it is lost and I get the following error message in the logs.
/usr/bin/python,/usr/local/cutedge/spambayes/sb_filter.py,-f,-p,/usr/local/cutedge/spambayes/hammiedb.pck" Exception UnboundLocalError: "local variable 'fp' referenced before assignment" in <bound method HammieFilter.close of <__main__.HammieFilter object at 0x1016e90d0>> ignored I have searched online but did not find anything that is helpful. I think the emails are being lost because of the error. Here is the login for Procmail: procmail: [546] Wed Aug 3 19:15:05 2011 procmail: Assigning "MAILDIR=/Users/tempo/Mail/Dovecot" procmail: Assigning "SPAMBAYESDIR=/usr/local/cutedge/spambayes" procmail: Assigning "DELIVER=/usr/local/cutedge/dovecot/libexec/dovecot/deliver -c /usr/local/cutedge/dovecot/etc/dovecot.conf" procmail: Assigning "INCLUDERC=/usr/local/cutedge/spambayes/etc/rc.custom1" procmail: Assigning "INCLUDERC=/Users/tempo/Procmail/testing.rc" procmail: Match on "^Subject:.*test1" procmail: Assigning "LASTFOLDER=.system/new/1312413305.546_1.BlueTuna.local" procmail: Notified comsat: "tempo@0:/Users/tempo/Mail/Dovecot/.system/new/1312413305.546_1.BlueTuna.local" >From x...@mac.com Wed Aug 3 19:15:05 2011 Subject: test1 Folder: .system/new/1312413305.546_1.BlueTuna.local 1203 procmail: [547] Wed Aug 3 19:15:05 2011 procmail: Assigning "MAILDIR=/Users/tempo/Mail/Dovecot" procmail: Assigning "SPAMBAYESDIR=/usr/local/cutedge/spambayes" procmail: Assigning "DELIVER=/usr/local/cutedge/dovecot/libexec/dovecot/deliver -c /usr/local/cutedge/dovecot/etc/dovecot.conf" procmail: Assigning "INCLUDERC=/usr/local/cutedge/spambayes/etc/rc.custom1" procmail: Assigning "INCLUDERC=/Users/tempo/Procmail/testing.rc" procmail: No match on "^Subject:.*test1" procmail: No match on "^Subject:.*test2" procmail: Executing "/usr/bin/python,/usr/local/cutedge/spambayes/sb_filter.py,-f,-p,/usr/local/cutedge/spambayes/hammiedb.pck" Exception UnboundLocalError: "local variable 'fp' referenced before assignment" in <bound method HammieFilter.close of <__main__.HammieFilter object at 0x1016e90d0>> ignored procmail: [547] Wed Aug 3 19:15:06 2011 procmail: No match on "^X-SpamBayes-Classification: spam" procmail: Assigning "INCLUDERC=/usr/local/cutedge/spambayes/etc/rc.custom2" procmail: Assigning "LASTFOLDER=|" procmail: Notified comsat: "tempo@:/Users/tempo/Mail/Dovecot/|" >From x...@mac.com Wed Aug 3 19:15:05 2011 Subject: abc Folder: | 1286 and my Configu files: PROCMAIL CONF =========== UMASK7 SHELL=/bin/sh LOGFILE=/Users/tempo/procmail.log VERBOSE=on MAILDIR=/Users/tempo/Mail/Dovecot SPAMBAYESDIR=/usr/local/cutedge/spambayes DELIVER='/usr/local/cutedge/dovecot/libexec/dovecot/deliver -c /usr/ local/cutedge/dovecot/etc/dovecot.conf' INCLUDERC=/usr/local/cutedge/spambayes/etc/rc.custom1 :0 fw | /usr/bin/python /usr/local/cutedge/spambayes/sb_filter.py -f -p / usr/ local/cutedge/spambayes/hammiedb.pck :0 * ^X-SpamBayes-Classification: spam { INCLUDERC=/usr/local/cutedge/etc/rc.sendtodevnull :0 | -m Spam #.Spam/ } INCLUDERC=/usr/local/cutedge/spambayes/etc/rc.custom2 :0 w | POSTFIX CONF These are the active Postfix Configuration Parameters The current Postfix version is 2.8.3 alias_database =hash:/usr/local/cutedge/postfix/etc/aliases alias_maps =hash:/usr/local/cutedge/postfix/etc/aliases biff =no command_directory =/usr/sbin config_directory =/usr/local/cutedge/postfix/etc daemon_directory =/usr/libexec/postfix data_directory =/Library/Server/Mail/Data/mta debug_peer_level =2 home_mailbox =Mail/Dovecot/ html_directory =/usr/share/doc/postfix/html inet_interfaces 2.168.123.2, 127.0.0.1, [::1] inet_protocols =all mail_owner =_postfix mailbox_command =/usr/bin/procmail -a "$EXTENSION" mailbox_size_limit =0 mailq_path =/usr/bin/mailq manpage_directory =/usr/share/man message_size_limit =0 mydomain = AAAA.com mydomain_fallback =localhost myhostname = AAAA.com mynetworks_style =host newaliases_path =/usr/bin/newaliases queue_directory =/Library/Server/Mail/Data/spool readme_directory =/usr/share/doc/postfix relayhost = smpt.comcast.net sample_directory =/usr/share/doc/postfix/examples sendmail_path =/usr/sbin/sendmail setgid_group =_postdrop smtp_bind_address =0.0.0.0 smtp_bind_address6 =:: smtpd_sender_restrictions =check_sender_access hash:/usr/local/ cutedge/ postfix/etc/access smtpd_tls_cert_file =/System/Library/OpenSSL/certs/testServer.crt smtpd_tls_key_file =/System/Library/OpenSSL/private/testServer.key smtpd_use_tls =yes tls_random_source Þv:/dev/urandom unknown_local_recipient_reject_code U0 _______________________________________________ SpamBayes@python.org http://mail.python.org/mailman/listinfo/spambayes Info/Unsubscribe: http://mail.python.org/mailman/listinfo/spambayes Check the FAQ before asking: http://spambayes.sf.net/faq.html