LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxQuestions.org Member Success Stories (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/)
-   -   Postfix/ Redhat 9 bug fix (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/postfix-redhat-9-bug-fix-73872/)

Pcghost 07-18-2003 11:49 AM

Postfix/ Redhat 9 bug fix
 
As some might discover when setting up Postfix and Spamassassin on a Red Hat 9 machine, there is a strange bug that causes email (legitimate) to show up with no subject or body, just a from field and "Undisclosed Recipients" in the to: field. This is caused by a bug in Red Hat that cannot correctly process UTF-64 encoded messages.

To fix this edit the /etc/sysconfig/i18n file and change
LANG="en_US.UTF-8"

to read

LANG="en_US"

And all will be well.

See my sig below for great instructions on setting up Postfix and Spamassassin.

MasterC 07-18-2003 12:53 PM

I don't know where better to respond since you don't accept email...

The link in your sig for Postfix/SpamAssasin appears to not be working... Maybe it's just me though.

Cool

Pcghost 07-18-2003 04:57 PM

Thanks MC, I will correct that. It's probably a good idea to post the file here as well. This is from a post on the spamassassin-talk mailing list.

<begin quote>
Hello, SpamAssassin mailing list :)

Some new documentation I've created. I'll be placing this online, but
figured I'd post it here as well. Maybe of some use to people :)

Please note: File locations are based on my own install. Yours may be
different, and should be checked and appropriate changes made.

1. Install postfix and get it working for your domain. See
http://www.postfix.org for details.

2. Install SpamAssassin. The easiest way to do this is with the command
"perl -MCPAN -e 'install Mail::SpamAssassin'"

3. As root, create a file at /usr/bin/postfixfilter with the following
content: #!/bin/bash
/usr/bin/spamc | /usr/sbin/sendmail -i "$@"
exit $?

4. Run "chmod 755 /usr/bin/postfixfilter"

5. Create a user called 'spamfilter'. Make it a complete user, with home
directory and shell.

6. Run "chown spamfilter /usr/bin/postfixfilter"

7. In /etc/postfix/master.cf in the "Services" section, alter the 'smtp'
line as follows (the " -o con..." SHOULD be on the next line:

#
-----------------------------------------------------------------------
-- smtp inet n - n - - smtpd
-o content_filter=spamfilter:
#
-----------------------------------------------------------------------
--

8. In /etc/postfix/master.cf in the "Interfaces to non-Postfix software"
section add:

#
-----------------------------------------------------------------------
-- spamfilter unix - n n - - pipe
flags=Rq user=spamfilter argv=/usr/bin/postfixfilter -f ${sender} --
${recipient}#
-----------------------------------------------------------------------
--

9. Restart postfix and make sure you can still get email. Send a fake
spam through the system (from an outside address) to verify that spam is
marked as spam. For information on configuring SpamAssassin, go to
http://www.spamassassin.org.

10. Install 'procmail' if it is not already installed. To discover this
try 'which procmail'.

11. For each user who needs a 'spam' mailbox, follow steps 12 - 13. You
can safely stop right here if you do not want any users to have their
spam filtered into another mailbox.

12. Create a file in their home directory, owned by them, called
'.procmailrc'. Enter the following into it, making sure that the
locations listed are what you wish to use for mailbox location (here we
are using /home/$username/mail/ as the location for mail folders:#
-----------------------------------------------------------------------
-- MAILDIR=$HOME/mail
DEFAULT=$HOME/mail/Inbox
LOGFILE=$HOME/mail/proc.log

# Catch SPAM
:0
* ^X-Spam-Flag: YES
* ^X-Spam-Level: \*\*\*\*\*\*
spam
#
-----------------------------------------------------------------------
--

Explanation of the above -

MAILDIR is the location of mailbox folders

DEFAULT is the default mailbox.

"* ^X-Spam-Flag: YES" makes sure the email is marked as spam before
doing anything with it.

"* ^X-Spam-Level: \*\*\*\*\*\*" make sure the spam received a 'spam
score' of at least 6 before doing anything with it. This ensures that
'borderline' cases that are more likely to be 'false positives' (meaning
they have been falsely marked as spam) do not go into the spam mailbox.

'spam' is the name of the mailbox they are going into.

13. Create a file in their home directory, owned by them, called
'.forward'. Enter the following into it, changing 'username' to their
username. Include the quotes and the pound ("#") symbol!

"|IFS=' ' && exec /usr/bin/procmail || exit 75 #username"

14. As with any change made to user's mailboxes, test!

15. Keep SpamAssassin update with the same procedure you used to install
it in #2.


Greg
</end quote>


All times are GMT -5. The time now is 06:14 AM.