1

I have an email address (a mailing list actually) with a basic procmail setup enabled. Right now, the procmail just dumps incoming emails to fs. I have a use-case where I want to add a custom string to be prepended to each email's body which is received this ML.

I've been reading up on procmail for the past few days and all the answers/examples I see related to modifying email subjects/bodies either explicitly use sendmail to "forward" the modified email or dump the modified email it to a custom mailbox.

What I want is to intercept the message before it is delivered to the ML, prepend some custom text to its body and then let it be delivered to the originally intended ML (i.e. mailboxes of the members of the ML).

Is there a way to achieve this?

  • What tool are you using to forward mails sent to the ML "submit" address to all members of the ML? Or is the ML just an address-book entry? – dirkt Mar 11 '22 at 12:33
  • @dirkt The ML is an Outlook mailing list. I'm not sure how they're internally implemented. – Priyansh Agrawal Mar 11 '22 at 12:38
  • 1
    As far as I know, Outlook is inherently Windows only, so even if you can figure out how to intercept a message, I don't think there is a straightforward way to run any Unix tool. – tripleee Mar 11 '22 at 13:30
  • 1
    Originally posted to Stack Overflow where I asked for a number of clarifications. – tripleee Mar 11 '22 at 13:44
  • If you want to be able to apply procmail at all, you'll somehow need to set up a Linux box with a working mailer (that alone isn't trivial today, with DKIM and spam protection etc.), and then you can install some mailing list manager, and then you can use procmail. For Outlook mailing lists, procmail isn't going to help. – dirkt Mar 11 '22 at 14:20
  • Thanks for your responses. The systems admin at my place have somehow enabled procmail on that ML for me (I guess it's not an outlook ML then) such that a basic procmail config like dumping incoming emails to a certain folder is working just fine. Now, I want to figure out how to have the modified message (I know how to modify the message) be delivered to the members of the ML instead of the original message. Please let me know if any other clarifications are needed. Thanks. – Priyansh Agrawal Mar 11 '22 at 14:47
  • Please [edit] your question to update and clarify it. If you have the ability to run Procmail, I alr ady explained in a comment how to do what you asked, and your response seemed to say you already knew how to do that. So what exactly is your question then? – tripleee Mar 12 '22 at 08:54
  • @tripleee please lmk if the edits seem fine. – Priyansh Agrawal Mar 13 '22 at 09:42
  • You are now asking two separate questions, and you have not clarified whether to and if so how to cope with MIME messages. – tripleee Mar 13 '22 at 10:02
  • I've already said that I do not need guidance on how to edit my messages. I'll take care of that. I don't know why you're asking to repeat my self – Priyansh Agrawal Mar 13 '22 at 10:04
  • Procmail by itself has no control over when and how it gets invoked anyway; this depends entirely on the surrounding infrastructure. Typically it gets invoked when the MTA tries to deliver the message to the user, but we still have no idea which MTA and how, if at all, a local user maps to a mailing list. If your MTA is Postfix and the mailing list is implemented as a simple alias, I don't think that will invoke Procmail at all. – tripleee Mar 13 '22 at 10:05
  • Also, if I AM asking multiple questions, please let me know if you happen to know the answer to any of them. – Priyansh Agrawal Mar 13 '22 at 10:05
  • Understood, thank you for your response. – Priyansh Agrawal Mar 13 '22 at 10:06
  • I'm asking for you to clarify the topic of your question to a single, well-defined inquiry about a specific problem. You really don't appear to be asking about Procmail at all then, but we have no idea how your mailing list is implemented or even how to get you to clarify which problem you need help with. – tripleee Mar 13 '22 at 10:07
  • Voting to close as lacking focus; see also the [help] and in particular How to ask as well as what to avoid. – tripleee Mar 13 '22 at 10:08
  • I understand the second part to the question might not be specific but how's the first part "lacking focus"? – Priyansh Agrawal Mar 13 '22 at 10:10
  • Again, please review the help links I already provided. A post which asks more than one question is problematic for our model because it is then unclear what to do when an answer covers one of the questions adequately but not others, or what it means when an answer which only covers a subset of the topics is accepted. We expect a single question per post; posts which fail this are subject to closing as "lacking focus". I encourage you to take the tour to refresh your memory of how Stack Exchange works. – tripleee Mar 14 '22 at 07:54
  • Edited. Please let me know if you have the answer to this "specific" question. – Priyansh Agrawal Mar 14 '22 at 08:09
  • The problem now is that this is not specific at all. "Yes, it's possible." Probably. But we need more details about which MTA etc you are using, and how the mailing list is implemented. I feel like I have asked for these clarifications at least half a dozen times already. – tripleee Mar 14 '22 at 08:16
  • Thanks for letting me know that this is indeed possible. – Priyansh Agrawal Mar 14 '22 at 08:40

0 Answers0