MTK schrieb:
Vielen Dank! Ich wusste gar nicht, dass ich auch ein eigenes Mailflag setzten kann. [...]
Wie geht das denn? Habe hierzu auch nichts gefunden
In der Procmail Mini FAQ habe ich folgendes gefunden:
Code Q: I know how to forward a message using an ! action, but that doesn't let me modify the message I forward. Is there a way to do that?
A: Typically, you want to add or change a header. This sounds like formail. The only thing that remains then is to actually send it off. You can of course filter first and then send (see next question), but you might as well do both in one fell swoop (unless you also want the modified message in your normal mail stream; again, see the next question for more).
:0c
* ^TO_sales@pizzazz\.tm\>
* ! ^X-Loop: sales@mundane\.domain\.net
| formail -k -X "From:" -X "Subject:" \
-I "To: sales@mundane.domain.net" -X "To:" \
-I "X-Loop: sales@mundane.domain.net" -X "X-Loop:" \
| $SENDMAIL $SENDMAILFLAGS -t
This is almost like a real-world example. It will (a) trim down the headers considerably, sparing only the From: and Subject: of the original. Then (b) we add some headers of our own (remember to extract them with -X too!), and (c) the results are handed to Sendmail. The -t option means the To: (and Cc: etc) lines in the actual message contain the recipient's address.
(Suche auf der Seite nach 'modify the message')
Siehe auch man (1) formail
Was fügt man in den Header ein? Genauso ein Eintrag wie From, To, Cc, nur werden nicht alle Header von den Mailprogrammen ausgewertet. Und um IETF-konform zu bleiben, fangen alle selbst-definierten Flags mit 'X-' an, bekanntestes Beispiel wie erwähnt 'X-Spam', aber meine Mails haben alle 'X-GMX-Antispam:' oder ein 'X-Kmail-MDN-Sent' und das ist garantiert nicht als Standard eingetragen. Ein 'X-MarkusOnly' sollte es tun 😉
Dirk