I pretend to have the best backup of all e-mail of my servers than run
Postfix and Cyrus/Dovecot. It would be simple for me to backup just
/var/spool/mail or /var/spool/imap every night but there are so many
people that use POP3, or simply deletes messages from their mailbox
while using IMAP.
So I thought that making a organized copy of all send/receipt e-mail
that went through postfix would be the best solution (for me at
least). I know I can achieve this archiving feature with MailScanner
but I want to avoid using that.
Do you know any method of create an archiving system using only
postfix (and maybe procmail, maildrop or other filters maybe but no
amavis)? I know there are commercial products to achieve this but I'm
looking for an open source solution first.
I hope someone can give me some ideas.
Thanks
Yes, please avoid using MailScanner.
> Do you know any method of create an archiving system using only
> postfix (and maybe procmail, maildrop or other filters maybe but no
> amavis)?
If you don't need to preserve the original envelope, always_bcc or
recipient_bcc_maps will to what you want.
If you do need to preserve the exact incoming message, use an smtp proxy
to do $whatever-you-want.
--
J.
I never knew why postfix users apparently hate MailScanner. I know
that this question isn't the purpose of my thread but... Can I know
why you don't like MailScanner?
>
>> Do you know any method of create an archiving system using only
>> postfix (and maybe procmail, maildrop or other filters maybe but no
>> amavis)?
>
> If you don't need to preserve the original envelope, always_bcc or
> recipient_bcc_maps will to what you want.
>
> If you do need to preserve the exact incoming message, use an smtp proxy to
> do $whatever-you-want.
>
Ok, I'm not a postfix expert but could you give me some additional
explanation about a smtp proxy to do $whatever-i-want? Just give me
some tips so look up in google.
MailScanner directly manipulates the postfix queue.
As documented, this is not supported - use it at your own risk.
>>> Do you know any method of create an archiving system using only
>>> postfix (and maybe procmail, maildrop or other filters maybe but no
>>> amavis)?
>> If you don't need to preserve the original envelope, always_bcc or
>> recipient_bcc_maps will to what you want.
>>
>> If you do need to preserve the exact incoming message, use an smtp proxy to
>> do $whatever-you-want.
>>
> Ok, I'm not a postfix expert but could you give me some additional
> explanation about a smtp proxy to do $whatever-i-want? Just give me
> some tips so look up in google.
I suggest the documentation, instead:
http://www.postfix.org/postconf.5.html#smtpd_proxy_filter
This can be anything that speaks SMTP.
(Note that implementing one of the *_bcc options will be far easier)
--
J.
Thanks, I'm going to read it.
> This can be anything that speaks SMTP.
>
> (Note that implementing one of the *_bcc options will be far easier)
>
I'm not pretty sure how to do that because I don't want to bcc all my
e-mail to one address.
The To: and From: addresses in the headers won't be changed; only the
envelope recipient.
Think "mailbox" instead of "address".
--
J.
/etc/postfix/main.cf:
recipient_bcc_maps = pcre:/etc/postfix/recipient_pcre
recipient_delimiter = +
/etc/postfix/recipient_pcre:
# Send copy of mail for each us...@example.org recipient
# to archive+user=examp...@example.com
/^(.*)@([^@]+)$/ archive+$1=$2...@example.com
This sends a copy for each recipient to arc...@example.com, with
the original recipient encoded in the address extension.
This question comes up every few months or so.
Wietse
sorry to thread jump
can the pcre map include multilines ? what Im looking at is a bcc to archive but ^not aliasu...@example.com does it read line by line or can in include an if $user=fred dev/null else /^......
/^!aliasusername@([^@]+)$/ archive+$1=$2...@example.com
/^(.*)@([^@]+)$/ archive+$1=$2...@example.com
or
/^aliasusername@([^@]+)$/ deny
/^(.*)@([^@]+)$/ archive+$1=$2...@example.com
-j
> can in include an if $user=fred dev/null else /^......
http://linux.die.net/man/5/pcre_table
or simply execute
/$ man 5 pcre_table
--
Stan
On 05/13/2011 02:08 AM, Wietse Venema wrote:
> Jason Voorhees:
>>> I suggest the documentation, instead:
>>>
>>> http://www.postfix.org/postconf.5.html#smtpd_proxy_filter
>>>
>>
>> Thanks, I'm going to read it.
>>
>>> This can be anything that speaks SMTP.
>>>
>>> (Note that implementing one of the *_bcc options will be far easier)
>>>
>>
>> I'm not pretty sure how to do that because I don't want to bcc all my
>> e-mail to one address.
>
> /etc/postfix/main.cf:
> recipient_bcc_maps = pcre:/etc/postfix/recipient_pcre
> recipient_delimiter = +
>
> /etc/postfix/recipient_pcre:
> # Send copy of mail for each us...@example.org recipient
> # to archive+user=examp...@example.com
> /^(.*)@([^@]+)$/ archive+$1=$2...@example.com
>
> This sends a copy for each recipient to arc...@example.com, with
> the original recipient encoded in the address extension.
>
> This question comes up every few months or so.
>
> Wietse
>
How can I protect incoming Emails, when the IMAP Server use mailbox
autocreating for mailboxes doesn't exists?
Can I filter and REJECT incoming Emails where the email address contains
'+'? With mailbox autocreating everyone can mail to email addresses and
so autocreate folders.
Ralf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iQEcBAEBAgAGBQJNzOq2AAoJENVjhbwuX+/H5QYIAKVAvDJv7iqQOMFxWnzIUd98
xdi4vxEFH68aqyN+FkkF2d03sVe61AsjzuRt+QOiyUQmM0YH2gdDutm4J5dbYZs9
l3k85KBuSp3zVv+4G1iSCIn/NufLmPAxZxxDYByEShej9QWAS9DhSzNkn0Ha6o/T
9gL1c0qB/u+W2ryR80RvEmBlt6ymYIquWyWPVvMT3cZi6ZWVnYdRSGicrNm09sRp
u0TB7CegIUvL+o0Zle8BHarRlDfs4zaf1xeFuxv3JZd19gknEwoNI+RG9Wx+k/Di
O9MzwXbbVKRSlCiEyGJAVIDyAcbK1sP5qakVNmyl7BrDKig2m7lCUuFb02yBnUc=
=g4eY
-----END PGP SIGNATURE-----
/^aliasusername@([^@]+)$/ aliasu...@discard.localhost
/^(.*)@([^@]+)$/ archive+$1=$2...@example.com
Then create a transport entry:
discard.localhost discard:
that depends on
- whether you need delimiters in inbound mail
- why you need autocreation and which imap server you use
with dovecot, you can create two dovecot deliver transports, one with
autocreation enabled and the other with autocreation disabled. then use
transport_maps to select which one to use.
ASSP will accomplish this... and provide an excellent anti-spam service
at the same time, complete with scheduled *and* on-demand user
quarantine reports...
--
Best regards,
Charles