Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Thanks for the response guys. I don't think I gave you enough information to work from as usual!
What I want to do is catch incoming mail to say me@my-domain.com and store a copy in a folder such as /backups/mail/my-domain.com/users/me/dd-mm-yyyy/ so at the end of the day i can run a cron job to turn it into a tar.gz and delete the other files so if a client asks for their mail due to loss I can place it back in their mail box for them.
Thanks for the replies I will follow the current leads now
You want recipient_bcc_maps in use with a virtual mailbox, which specifies the location of the archive. The archive cannot be date-based (it is just a Maildir style mailbox), but you can write your archive script to pick up mail from only given dates.
The idea is this:
Code:
main.cf:
recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc
/etc/postfix/recipient_bcc recipient_bcc
# pick one of the methods below that work best for you:
# Method 1: for specific users only, such as you
me@my-domain.com me@copy.example.org
# Method 2: more complete forms, capturing original recipient and domains
/^\"(.*)\"@(.*)/ "$1=$2"@copy.example.org
/(.*)@([^@]+)$/ $1=$2@copy.example.com
This makes a copy of all mail addressed to the specified recipients.
I would actually take the approach of doing snapshots periodically and then back those up from there. That's if you have the hardware and or capability to do so. You can take snapshots with LVM.
You want recipient_bcc_maps in use with a virtual mailbox, which specifies the location of the archive. The archive cannot be date-based (it is just a Maildir style mailbox), but you can write your archive script to pick up mail from only given dates.
The idea is this:
Code:
main.cf:
recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc
/etc/postfix/recipient_bcc recipient_bcc
# pick one of the methods below that work best for you:
# Method 1: for specific users only, such as you
me@my-domain.com me@copy.example.org
# Method 2: more complete forms, capturing original recipient and domains
/^\"(.*)\"@(.*)/ "$1=$2"@copy.example.org
/(.*)@([^@]+)$/ $1=$2@copy.example.com
This makes a copy of all mail addressed to the specified recipients.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.