Score:0

Why is procmail saving my emails with a format like .{x}AA1?

iq flag

I'm simply trying to save all incoming emails to a folder so that I can have a watchdog script comb through and parse the attachments in various ways as changes happen to the folder. We'll call this specific folder "incoming_emails".

I've configured fetchmail with procmail, and I've written a recipe which saves emails to incoming_emails, but they're saved in a format like "msg.aAA1", "msg.XAA1", or "msg.bAA1", etc. From what I understand, they should be saving in a .eml format instead. I'm not sure how I could work with a dynamic file format... What should I do here?

This is my recipe:

 :0
 * .*
 $HOME/incoming_emails
tripleee avatar
ar flag
Which email client are you using? What do you mean by "work with" these files?
Score:0
ar flag

It's not clear exactly what the problem is here. ".eml format" is not entirely well-defined, but what you'll find inside those files is certainly honest-to-Postel RFC5322 (née 822) standard email format.

Procmail supports a few folder formats but what differs between them is mainly how the files are organized.

  • Berkeley mbox format is a single file with a From_ line prepended before each individual message. This is the traditional standard format for local mailboxes. It is the default format for Procmail delivery if the destination is not a directory.
  • MSGPREFIX format is one file per message, like what you are experiencing now. The message prefix can be configured, but there is no built-in way to add an .eml file extension, if that's what you're asking.
  • MH format is vaguely similar, only the file names are simply numbers.
  • Maildir format is the modern standard for many mail servers; it is a directory with subdirectories named new, tmp, and cur. Within those directories, each file name is a long unique identifier which is assigned based on a number of factors to ensure that it is unique and safe.

Anything else, you need to write an explicit rule, or call an external utility. (For example, some IMAP servers want you to always call their delivery utility, which takes care of also adding the message to the server's indices, etc.)

Which directory-based format is selected depends on how the directory name is formatted in the rule (dir vs dir/ vs dir/.), and IIRC some heuristics to determine whether the Maildir subdirectories already exist.

See also https://www.iki.fi/era/procmail/mini-faq#appendix-folders

By the way, to unconditionally execute a recipe, just leave out the condition line entirely. To simply deliver all mail to a single location, it suffices to set DEFAULT to that folder path.

tripleee avatar
ar flag
If this answer doesn't satisfy you, could you please explain what more information you need in order to be able to accept this answer?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.