LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Postfix Server Plain Text Email ONLY? (https://www.linuxquestions.org/questions/linux-server-73/postfix-server-plain-text-email-only-623921/)

carlosinfl 02-26-2008 07:21 AM

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.

Deleriux 02-26-2008 08:19 AM

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.

carlosinfl 02-26-2008 08:58 AM

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?

Deleriux 02-26-2008 10:24 AM

You need to add the REJECT statement so postfix knows what to do with it.

carlosinfl 02-26-2008 02:00 PM

Quote:

Originally Posted by Deleriux (Post 3070392)
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?

Deleriux 02-26-2008 02:52 PM

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.

carlosinfl 02-26-2008 04:18 PM

Quote:

Originally Posted by Deleriux (Post 3070651)
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?


All times are GMT -5. The time now is 01:41 PM.