質問

The short version: I need to save mail from Exim to a networked directory, but ideally I want to save these as unqiue files rather than appended to a mailbox.

The long version: I have a PHP script which parses mail. Currently this is located on the same box as the mail server, allowing me to pipe the mail directly to the PHP script - easy.

Soon my mail server will be hosted on a separate (connected over NFS) server. My initial plan was to simply create a symlink to the mailbox, and schedule the script to parse the mail via cron, deleting mail after it has been parsed.

The problem is that the mail is stored in mbox format, ie appended into a single file. With PHP unable to reliably use file locks over NFS, I'm worried that my script will trash new mail which arrives during execution.

So - instead of writing mail to a single file, can I get Exim to save each mail into a separate file?

Thanks for any advice.

役に立ちましたか?

解決

In short, you use use maildir for your mailboxes instead of mbox.

Take a look at this how-to on Exim4 and Maildir setup.

Something else you can do, is use the PHP IMAP extension to access your local mail server. This way, each message would be parsed independently as well, and allow you to access individual files without changing your mail server configuration.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top