Postfix header_checks general understanding but further questions - postfix-mta

I am not sure if I completely understannd what header_checks can do for me. I am using postfix with virtual_alias_tables for realizing a simple mailing-list. Now I want every member of the list reply to that list specific address and not to the other members address.
I give you an example:
member -> writes mail to list
all other members recieve this mail
any member who replies to this mail has the lists address predefined
... and so on
So far so good. I've setup a simple header_check thats working for the first reply.
/^To: name_of_list#domain.de/ PREPEND name_of_list#domain.de
But as the second reply occurs this header_check is not working at all, and the reply goes to the members adress.
Question: what is the difference between smtp_header_checks and header_checks? How to determine if a header is manipulated during reception or during delivery? And how can I ensure that every mail that was initally written into this mailing-list will be replied to itself?
Thanks for your help.

Related

Esp32 micropython webserver TCP socket to check http get request

Good afternoon everyone,
For a school project I will make a RC car using a c8051 microcontroller and to send the uart data to it I'm using a ESP32 so that I can display a webpage so that the user choose the direction of the car. I've spent a lot of time on micropython doc's page and tutorial for TCP sockets and I see in every one of them that to check if the webpage was requested they use something like:
If(request==6):
And I can't figure out why 6, what that represents??
I appreciate any help given.
The answer found in the comment section of the link given
"In the while loop, after receiving a request, we need to check if the request contains the ‘/?led=on’ or ‘/?led=on’ expressions. For that, we can apply the find() method on the request variable. the find() method returns the lowest index of the substring we are looking for.
Because the substrings we are looking for are always on index 6, we can add an if statement to detect the content of the request. If the led_on variable is equal to 6, we know we’ve received a request on the /?led=on URL and we turn the LED on.
If the led_off variable is equal to 6, we’ve received a request on the /?led=off URL and we turn the LED off."

How To Set up Call Hold and Pick Up In Asterisk

I am quit new in asterisk.
My problem is: I have to implement call hold and pick up in asterisk.
Let's say we have an incoming call called incomingCallA.
As an operator I want to hold incomingCallA for a while to deal with other works, then come back soon, If i am not come back, others operator will pick up my held call.
I have done some researches that told me:
Call hold is sip client function, dont need to changes at asterisk server.
I can use call parking to dial to others operator if i am not come back.
Please help me to about the solution to deal with above problem.
Many thanks.
Simplest for begginer is create 100 conference rooms using Meetme after that just send to first availible room and record room number.
You can forward call using Transfer AMI function.

How to handle passing different types of serialized messages on a network

I'm currently sitting with the problem of passing messages that might contain different data over a network. I have created a prototype of my game, and now I'm busy implementing networking for my game.
I want to send different types of messages, as I think it would be silly to constantly send all the information every network-tick and I would rather send different messages that contain different data. What would be the best way to distinguish what message is received on the receiving side?
Currently I have a system where I prepend a string which distinguishes a certain type of message. My message is then sent through my own message parser class where it determines the type, and deserializes it to the correct type.
What I would like to know is if there is a better way of doing this? It seems like it should be a fairly common problem and so there must be a more trivial solution, unless I'm already doing it the trivial way.
Thanks!
I have read again carefully your question, and now I do not understand what is your problem, you say Currently I have a system where I prepend a string which distinguishes a certain type of message. My message is then sent through my own message parser class where it determines the type, and deserializes it to the correct type.
Looks OK, you may reduce the size of your message with my answer below horizontal line but the principle stays identical.
This the right way for asynchronous communication, but if you do synchrone you know that when you send A message you will receive B answer, so you do not have to prepend with a string which distinguishes the message, but you have to take care not sending another message before having the answer from the previous ...
So if you know how is formatted the answer you do not need any identification bytes, for example you know that the first four bytes is an integer, then a float on eight bytes, etc ...
Use boost::serialization, typically you save your structures, even with pointers, within a dumb bytes buffer, send that buffer over your network, and the other side de-serialize.
This example shows how Boost.Serialization can be used with asio to encode and decode structures for transmission over a socket.
Even if it is using boost::asio you could extract only the serialization part easily.

Block emails with large number of recipients of same domain

I have a mailserver with exim4 and spamassassin installed.
We have a problem of (internal) spam to a large number of mailinglists, coming from a few users (which we cannot just educate or block for multiple reasons)
Is there a way to block emails to which an unreasonable amount go to the same domain (e.g. 10) to force these users to BCC?
Yes, you can do this in SpamAssassin. I'm not as much an exim expert, but iirc exim can do this as well (though it may have a hard recipient limitation that is agnostic to To/Cc vs Bcc).
This should do it:
header DTECH_TEN_TOCC_IN_SAME_DOM ToCc =~ /(\#[^,>;]{3,99}[a-z]\b)(?:[^\#.-][^\#]{0,99}\1){10}(?![.-])/
describe DTECH_TEN_TOCC_IN_SAME_DOM Ten consecutive recipients have the same domain
As I've written it, this only catches ten consecutive recipients with the same domain, which must all be in the same header (ToCc means either To xor Cc; it does not merge the headers). If you change the third character class from [^\#]{0,99} to .{0,999} to match any character over a longer period of time, the rule will be good for more than just consecutively listed addresses, but note that this would make the regex far more expensive to compute.
You also have to make sure that SpamAssassin is looking at your internal and outbound mail, which is nonstandard. Finally, you'll have to score the rule. Please test copiously before you do that. Especially since this is not a spam rule (it will hit more non-spam than spam; consider a similar rule with testing stats: __TO_MANY).
You will not, however, be able to tell users why the message was rejected. An SMTP reject (e.g. from Exim) can have a custom "why this was rejected" prompt, which is highly useful for policing attachment sizes or even informing users that they're sending too much mail (perhaps they are infected). You can configure Exim to run SA at SMTP time (e.g. sa-exim), but then every spam rejection would have the same message to the end user. The other option would be to accept the message and then bounce it back, including the SpamAssassin rule hits. Be very very careful with that approach as it often leads to backscatter.

AT command for disable Radio Signal Strength Indication and alike?

Im working on a program to send and recieve SMS using a GSM modem and my computer.
I have gotten sending and receiving to work - well sort of.
Once in a while my program is sent into a total chrash due to modem is mixing up information about Radio Signal Strength Indication and alike, while also serving my program with the hex code for the message.
My code can handle the hex code just fine. but I have seen the following line popup while im decoding a byte stream:
^RSSI: 2
So far I've seen it send out values between 1 and 10.
Is there an AT Command that can disable them? I have no need for them.
Or alternative: Is there a general syntax for them, so I can filter them out before decoding?
Im leaning towards a filter solution. But that would be more easy to implement if I knew whenever modem is sending out on the form: "^SOMETHING: xxx", then It would be nice to know if it is always followed up be a delimiter say for instance "\r".
You should try turning off periodic messages as using AT^CURC=0.
Information regarding the AT^CURC command:
AT^CURC? Current setting of periodic status messages
AT^CURC=? See what you possible values are
AT^CURC=0 turn off periodic status messages
The best way to tackle this scenario would be to replace that part of the response with an empty string because otherwise, it will be difficult to check even if the command sent to disable it is working or not.
This regex will match all those. You can replace them ideally by an empty string.
(\\n|\\r|\\r\\n)\\^.*(\\n|\\r|\\r\\n)

Resources