mail-in-a-box / mailinabox

Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.

Home Page:https://mailinabox.email/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how make a file copy of incoming email?

comsyspro opened this issue · comments

when postfix receives an incoming email to
info@test.net
it is saved into the directory
/home/user-data/mail/mailboxes/test.net/info/new
and the filename will become something like
1708161199.M378768P25198.mail.test.net,S=4323,W=4437
now i want to make a copy of this filename and save it to another folder for example to /home/copy.

i have 2 options to do this:

  1. make a filewatcher script which observes recursively /home/user-data/mail/mailboxes folder and detects new files arriving in */new folders and copy this file to /home/copy/myemail.eml
  2. piping the incoming email to a script which reads it over stdin and saves the complete content to /home/copy/myemail.eml

but i'm interested if there are also another options?

  1. does postfix have a setting how it will create the filename and can you change this?
  2. it seems that postfix uses a timestamp and a hashvalue and produces this 1708161199.M378768P25198.mail.test.net,S=4323,W=4437 as filename. where or in which config file is the creation of this naming convetion defined and can you somehow influence it?