LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 02-26-2008, 07:21 AM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Debian
Posts: 2,896

Rep: Reputation: 73
Postfix Server Plain Text Email ONLY?


I currently have a huge SPAM problem running POSTFIX on my Linux server simply because I had to disable spamd (Spamassassin) for the time being. I am getting all kinds of lovely images (HTML) embedded into the messages from SPAMMERS and was wondering how in Postfix I restrict all incoming and outgoing emails to plain text only. I see no need to HTML encoded email.

Is there a simple solution in Postfix and where does this parameter live to enable both incoming and outgoing email via Postfix?

Thanks for your support and I did check the postfix FAQ and could not find anything. The Postfix mailing group is useless for me. My questions never have been answered there.
 
Old 02-26-2008, 08:19 AM   #2
Deleriux
Member
 
Registered: Nov 2003
Posts: 89

Rep: Reputation: 16
You can use mime_header_checks.

mime_header_checks regexp:/etc/postfix/mime_headers

Code:
/^[C,c]ontent-[T,t]ype: text\/html/         REJECT HTML messages are not allowed on this server.
Completely untested but according to the manual it should work.
 
Old 02-26-2008, 08:58 AM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Debian
Posts: 2,896

Original Poster
Rep: Reputation: 73
So I ran the following command on my email server:

Code:
vim /etc/postfix/mime_header_checks.regexp
When I looked at the file all I saw was the following:

Code:
/filename=\"?(.*)\.(bat|chm|cmd|com|do|exe|hta|jse|rm|scr|pif|vbe|vbs|vxd|xl)\"?$/
   REJECT For security reasons we reject attachments of this type
/^\s*Content-(Disposition|Type).*name\s*=\s*"?(.+\.(lnk|asd|hlp|ocx|reg|bat|c[ho]m|cmd|exe|dll|vxd|pif|scr|hta|jse?|sh[mbs]|vb[esx]|ws[fh]|wav|mov|wmf|xl))"?\s*$/
   REJECT Attachment type not allowed. File "$2" has the unacceptable extension "$3"
I just added what you suggested on the next available line & saved the file / restarted postfix:

Code:
/^[C,c]ontent-[T,t]ype: text\/html/
Does this look correct to you?
 
Old 02-26-2008, 10:24 AM   #4
Deleriux
Member
 
Registered: Nov 2003
Posts: 89

Rep: Reputation: 16
You need to add the REJECT statement so postfix knows what to do with it.
 
Old 02-26-2008, 02:00 PM   #5
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Debian
Posts: 2,896

Original Poster
Rep: Reputation: 73
Quote:
Originally Posted by Deleriux View Post
You need to add the REJECT statement so postfix knows what to do with it.
Sorry - I don't follow:

How would that look like in the last entry I added to my mime file? I did the following and still was able to send...

Code:
/^[C,c]ontent-[T,t]ype: text\/html/
   REJECT We don't allow HTML email - Please resend in plain text
Is the above wrong?

Last edited by carlosinfl; 02-26-2008 at 02:08 PM.
 
Old 02-26-2008, 02:52 PM   #6
Deleriux
Member
 
Registered: Nov 2003
Posts: 89

Rep: Reputation: 16
Code:
/^[C,c]ontent-[T,t]ype: text\/html/   REJECT We don't allow HTML email - Please resend in plain text
The regext and reject statement should be all on the same one line.
 
Old 02-26-2008, 04:18 PM   #7
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Debian
Posts: 2,896

Original Poster
Rep: Reputation: 73
Quote:
Originally Posted by Deleriux View Post
Code:
/^[C,c]ontent-[T,t]ype: text\/html/   REJECT We don't allow HTML email - Please resend in plain text
The regext and reject statement should be all on the same one line.
Thanks - it works but I had to disable it. Far too many people complaining about delivery failures. I guess there is no way to have POSTFIX strip the HTML content and still deliver the message in plain text, huh?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
POSTFIX Email Server carlosinfl Debian 4 07-12-2007 02:10 PM
POSTFIX Email Server carlosinfl Linux - Server 2 07-10-2007 02:04 PM
How do I configure postfix master to forward all email to an email server ? hello321_1999 Linux - Software 1 11-18-2004 04:43 AM
Is Postfix an Email Server? Gib Sandwich Linux - Software 6 08-24-2004 02:23 AM
Ximian Evolution Email - Plain Text? linuxgamer Linux - Newbie 5 12-02-2003 12:23 PM


All times are GMT -5. The time now is 07:43 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration