0

With Sendmail, I want to accept messages to addresses formatted like this:

bounce+blabla@domain.com 
bounce+foofoo@domain.com

And then write them all to a separate mail file on server, instead of appending to same one email file.

I am able to fetch all mail by adding bounce+*@domain.com to /etc/mail/virtusertable, it saves to any given alias. But how to save each message to a different file ?

Thanks.

adrianTNT
  • 1,077
  • 6
  • 22
  • 43

1 Answers1

1

I'm not familiar with Sendmail but the solution is to store mails as Maildir and not as mbox.

But as this post reveals Sendmail is not able to do so. Fortunately they also provide the solution.

mailq
  • 17,023
  • 2
  • 37
  • 69
  • Thank you, I will try by saving to same one file and then try to read and filter that file. (I am trying to fetch bouncing subscribers). Can you tell me what is a reliable delimiter in the long email file that stores multiple received messages? By looking at the saved file, all emails start with "From ... etc .. date". Is that the best delimiter to look for? – adrianTNT Oct 04 '11 at 18:30
  • 1
    @adrianTNT Read the Wiki about mbox. There you find many references that all mails start with `From:` and how to handle mboxes. Mailbox locking is important, dangerous and tricky. – mailq Oct 04 '11 at 18:35