LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 10-11-2010, 06:39 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Question Postfix - Reject Emails w/ No Subject?


I was wondering how mail administrators handle emails w/o any subject material? I don't know if this is an RFC guideline that requires email to have a subject but I find it extremely annoying when email doesn't have a subject. I don't know if that's just personal preference or if it's an actual guideline for mail to have 'subject' data. Do you guys reject mail if no 'subject' is present in the message?
 
Old 10-12-2010, 04:23 AM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
I personally do not reject mail based upon the subject, or lack there of. I agree that it is annoying. Whether or not it is a violation of any RFC, I don't know and even if it is, most mail programs would probably ignore the rule by default anyway. I also know that I myself have been guilty of sending emails without a subject on occasion, by accident rather than deliberately.

You mention Postfix in your subject title and there may be a header check rule that will reject messages based on the lack of a subject. You will need to look at the postfix documentation to verify; the list of available content checks is quite long.
 
1 members found this post helpful.
Old 08-24-2018, 11:34 AM   #3
Wayne Sallee
Member
 
Registered: Jun 2011
Location: Florida
Distribution: The one that I built. (lfs)
Posts: 269

Rep: Reputation: 17
This is an old thread, but the answer of how to reject and e-mail with no subject in Postfix is not properly answered anywhere on the internet.

Now that I have finally figured out how to do it, here is the answer:



Code:
/etc/postfix/main.cf
Code:
header_checks = regexp:/etc/postfix/header-checks



Code:
cat > /etc/postfix/header-checks << "EOF"
# /^Subject:.*I[[:space:]]spam[[:space:]]you/ REJECT I don't want your spam.
/^subject:[[:space:]]*$/ REJECT No Subjecto! You seem to be Subjectless.
/^subject:[[:space:]]*Re:$/ REJECT No Subjecto! You seem to be Subjectless.

EOF
postmap /etc/postfix/header-checks
I like using filename format "header-checks" instead of the other popular format "header_checks". You choose the format you like.

Code:
# /^Subject:.*I[[:space:]]spam[[:space:]]you/ REJECT I don't want your spam.
This is just a freebee. :-) If you need to block a phrase that has a space in it, use the above space command instead of leaving a space, as a space will cause errors.

Code:
/^subject:[[:space:]]*$/ REJECT No Subjecto! You seem to be Subjectless.
This will reject mail that has the "Subject: " in the headers, ie blank subject.


Code:
/^subject:[[:space:]]*Re:$/ REJECT No Subjecto! You seem to be Subjectless.
This will reject another common spam e-mail where in the headers you have "Subject: Re:"


Wayne Sallee
Wayne@WayneSallee.com
http://www.WayneSallee.com

Last edited by Wayne Sallee; 08-24-2018 at 11:39 AM.
 
  


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: reject emails for list of recipient domains zaheer99 Linux - Server 3 11-11-2016 10:23 AM
Postfix "Content Filter" setup to reject emails with too many recipients in TO: field bahadirtonguc Linux - Server 10 05-27-2010 02:07 AM
How to see the subject of emails queued voltron81 Linux - Server 2 01-25-2010 03:13 AM
old emails in kmail unreadable ¨No Subject¨ bobinglis Linux - General 2 05-07-2005 07:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:12 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration