• # @home pour mes sauvegardes !

    Posté par . En réponse au message Postfix : copie silencieuse de mails. Évalué à 1.

    main.cf:

    sender_bcc_maps = hash:/etc/postfix/sender_bcc_maps

    recipient_bcc_maps = hash:/etc/postfix/recipient_bcc_maps

    home_mailbox = Maildir/

    mailbox_command =

    /etc/postfix/sender_bcc_maps:
    @chez.moi.fr outgoing
    
    /etc/postfix/recipient_bcc_maps:
    @chez.moi.fr incoming
    
    /usr/local/bin/svg_incoming:

    #!/bin/sh

    # déplacement des mails d'hier dans tmp

    su - incoming -c "find ~/Maildir -daystart -type f -mtime +0 |xargs -n 1 -i mv {} ~/tmp \

    && ( cd ~/tmp;tar cjf ~/SVG/incoming-`date --date 'yesterday' '+%Y_%m_%d'`.tar.bz2 . ) \

    && find ~/tmp -type f -exec rm -f {} \; "

    /usr/local/bin/svg_incoming:

    #!/bin/sh

    # déplacement des mails d'hier dans tmp

    su - outgoing -c "find ~/Maildir -daystart -type f -mtime +0 |xargs -n 1 -i mv {} ~/tmp \

    && ( cd ~/tmp;tar cjf ~/SVG/outgoing-`date --date 'yesterday' '+%Y_%m_%d'`.tar.bz2 . ) \

    && find ~/tmp -type f -exec rm -f {} \; "

    /etc/crontab:

    1 0 * * * root /usr/local/bin/svg_incoming

    1 0 * * * root /usr/local/bin/svg_outgoing