LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-04-2021, 12:31 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Rep: Reputation: 177Reputation: 177
mailx - Is there a better way to ignore headers?


I'm (still) using mailx 12.5. I am using the .mailrc directive ignore, eg:
Code:
ignore X-MS-Has-Attach
ignore X-MS-TNEF-Correlator
ignore msip_labels
But, every mail service seems have have its one set of not-very-interesting headers. Currently, I have 104 'ignores' in my config. Is there a way to either wildcard these, e.g:
Code:
ignore X-Microsoft-*
ignore X-microsoft-
or include only certain headers when reading a message using mailx, like a 'headerretain' directive? I've tried both wildcard styles shown with no luck.
 
Old 01-04-2021, 01:40 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
I don't use mailx anymore but once had to download the source and hack it to fix a security issue. The code is pretty simple. You could probably just skip printing any headers except the ones you're interested in with a few lines of code.
 
Old 01-04-2021, 01:57 PM   #3
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Wouldn't it be easier to use retain instead and only list the headers not to be discarded?
 
1 members found this post helpful.
Old 01-07-2021, 04:47 PM   #4
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by shruggy View Post
Wouldn't it be easier to use retain instead and only list the headers not to be discarded?
Duh! Yes, that is easier and did work. Now I have 11 'retain' directives instead of 134 'ignores'. I don't know how I missed that in the first place.
 
  


Reply

Tags
headers, ignore, mailx



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "Snorkeling on an empty pipe": error in S-mailx (mailx 4.19.11) RandomTroll Linux - Software 0 11-30-2018 10:45 PM
mailx cmd - how to ignore the machine name getting appended to the receiver mailaddr AJJ Linux - Newbie 2 03-14-2011 01:14 AM
TO ANYONE USING MAILX (mailx 12.1). stf92 Linux - Software 22 07-08-2010 09:44 PM
Is there a way for aide to ignore images? abefroman Linux - Software 4 05-30-2008 08:53 PM
[logcheck] ignore.d and logcheck.ignore cyberpunx Linux - Software 0 09-18-2005 05:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:16 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