how make a file copy of incoming email?
comsyspro opened this issue · comments
comsyspro commented
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:
- 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 - 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?
- does postfix have a setting how it will create the filename and can you change this?
- 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?