LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 01-31-2019, 03:40 AM   #1
zz921286
LQ Newbie
 
Registered: Jan 2019
Posts: 2

Rep: Reputation: Disabled
Mail server with advanced filter


Dear all,
I need to implement a mail server that allows me to establish advanced rules for filtering and forwards them.
I do not know which mail server could be the best, I told you that I need to do with the emails to guide me in the election.
1) I need to catch all the emails during a time interval, filter their content (they are alarms from different sensors) and make a single summary email.
2) Accumulate the alarms of the different sensors in a csv or a log file.
I have searched the internet and certain mail servers do not allow to establish rules about the content of the message, others do, but through scripts in phyton or bash.
I thank you very much for your help.
 
Old 01-31-2019, 07:55 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,659

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by zz921286 View Post
Dear all,
I need to implement a mail server that allows me to establish advanced rules for filtering and forwards them.
I do not know which mail server could be the best, I told you that I need to do with the emails to guide me in the election.
1) I need to catch all the emails during a time interval, filter their content (they are alarms from different sensors) and make a single summary email.
2) Accumulate the alarms of the different sensors in a csv or a log file.
I have searched the internet and certain mail servers do not allow to establish rules about the content of the message, others do, but through scripts in phyton or bash.
I thank you very much for your help.
Not sure what you're asking here, honestly. If you've found a mail server that does what you want, why is it a problem if it uses scripts?? There is *NEVER* going to be a 100%, perfect-fit system that meets custom needs, with ZERO modifications. Since any of the choices for Linux are free, your best course of action would be to load them both, and see which fits your needs best, and is easiest for you to get going.

Use of scripts gives you a LOT of flexibility later, since things can be added/removed/changed on the fly.
 
1 members found this post helpful.
Old 01-31-2019, 08:25 AM   #3
joe_2000
Senior Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Quote:
Originally Posted by zz921286 View Post
Dear all,
I need to implement a mail server that allows me to establish advanced rules for filtering and forwards them.
I do not know which mail server could be the best, I told you that I need to do with the emails to guide me in the election.
1) I need to catch all the emails during a time interval, filter their content (they are alarms from different sensors) and make a single summary email.
2) Accumulate the alarms of the different sensors in a csv or a log file.
I have searched the internet and certain mail servers do not allow to establish rules about the content of the message, others do, but through scripts in phyton or bash.
I thank you very much for your help.
First off: I would argue that you don't need to run a mail server for this. You might as well scrape the emails of any random mail account using a python script.
Second: I would encourage you to reconsider the concept of using email for this in the first place. Is this really the only way that you can collect the sensor information? If there was any way to read sensor values via http, telnet or ssh for example that would certainly make your life an order of magnitude easier!
If you insist on running your own mail server: The postfix-dovecot combo is a battle tested and extremely customizable mail server setup. You can use sieve to filter / sort your mail and you can configure postfix to pipe incoming mail through custom scripts.
It has a learning curve though and you should not run it on a publicly accessible machine until you really know what you are doing.
 
2 members found this post helpful.
Old 01-31-2019, 10:24 AM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,732

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
It's not a mail server, but this sounds like a job for procmail. It can search headers or bodies of email and act accordingly. The meat is already written, OP would just need to develop appropriate recipes.
 
1 members found this post helpful.
Old 02-06-2019, 01:42 AM   #5
zz921286
LQ Newbie
 
Registered: Jan 2019
Posts: 2

Original Poster
Rep: Reputation: Disabled
First of all, many thanks to TB0ne, joe 2000 and scasey for their quick responses. It seems incredible to me that you have answered in a matter of hours. Thank you.
Clarification: the sensors are mounted on a board with Wi-Fi chip and are able to connect to the internet from almost any point and without much user intervention. They give a tremendous flexibility and the simplest option is the sending of mails. If you tried to collect the data from each sensor through other procedures, you would have to open certain ports in the wifi points where they connect and most of the time it would not be possible.
TB0ne: Yes, everything that is done to filter the information will not work 100% and should be adjusted. The problem is that I do not have a lot of knowledge to make scripts and that's why I thought about collecting the emails through a reader / server of post office and doing the filtering by personalizing its operation.
joe 2000: in the answer to TB0ne you can read why the use of emails to collect information. I'll look for information about postfix-dovecot and I'll study it like crazy.
scasey: idem joe 2000, I will find information about procmail and study!
Thank you very much, you are great.
 
Old 02-06-2019, 02:07 AM   #6
joe_2000
Senior Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Quote:
Originally Posted by zz921286 View Post
Clarification: the sensors are mounted on a board with Wi-Fi chip and are able to connect to the internet from almost any point and without much user intervention. They give a tremendous flexibility and the simplest option is the sending of mails. If you tried to collect the data from each sensor through other procedures, you would have to open certain ports in the wifi points where they connect and most of the time it would not be possible.
Ok, I understand the initial thought, but I still disagree with email being the easiest way.
If you can send email, you can certainly make an http request with curl?
If you can put a webserver somewhere and spin up a tiny web frontend that accepted these curl requests you could pipe the sensor values directly into a database.
Flask is a neat python framework that allows you to build such an api with very little code.

It may sound more difficult at first, but I promise you: Going the email route will be more difficult than it sounds...
 
  


Reply



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
Creating Mail Filter in Thunderbird mail client msivasakthi Linux - Software 1 07-14-2008 02:05 AM
Dansguardian - Won't filter new addresses added to filter list TechnoBod Linux - Software 1 01-08-2008 01:40 AM
Spam filter to external mail filter deadlock Linux - Software 1 06-16-2004 02:28 AM
Better buying "advanced linux prog" or "unix advanced prog" Dominik Programming 3 12-31-2003 01:11 PM
Anybody know how to configure spamassassin to filter mail from hotwayd server? cmisip Linux - Networking 2 11-10-2003 06:46 PM

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

All times are GMT -5. The time now is 04:38 PM.

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