-1

i want to configure procmail. Right now i've got code to redirect mails with selected topic from server mail to my mail. It's my code:

:0 c
*Subject.*ExampleTopic
Example@Mail.com

I want to copy mail content to selected .txt file on server. How can i do it?

  • If the answer helped you solve your problem, please accept it. If not, please provide feedback. Thanks. – tripleee Nov 14 '16 at 10:35

1 Answers1

0

Your current code saves a copy to a folder named Example@Mail.com. To save to a file with a different name, simply change that string. (To forward each matching message to another email address, the syntax is ! Email@example.com with an exclamation mark as the action "verb".)

The default saving action appends to a flat text file in Berkeley mbox format. This includes both the headers and the body. With a b flag you can save just the email body, but this is still the raw MIME transport format, which is very rarely what you actually want.

:0b
* some condition, perhaps
bodyfile.txt

Procmail regrettably knows nothing about MIME, so if getting a particular body part is what you actually need, you'll probably want to pipe the message to some script which understands MIME and can implement your extraction policy.

:0
* some condition, maybe
| extracttool >>bodyfile.txt

The vague wording of your question implies that you are probably not too familiar with the details of email formatting in general and MIME in particular. You'll probably want to post another question with more detailed requirements once you have a proper idea of what the challenges are. For a start, the source of a message you want to mainpulate might help us help you.

tripleee
  • 139,311
  • 24
  • 207
  • 268