:-)
My postfix configuration is quite complex with a lot of special cases
and rules. However I'd like to make an anti-spam configuration as simple
and lightweight as possible (KISS).
/etc/postfix/master.cf
------------------------------------------------------------------------
smtp inet n - n - - smtpd
-o content_filter=spamassassin
spamassassin unix - n n - - pipe
user=nobody argv=/usr/bin/vendor_perl/spamc -e /usr/sbin/sendmail -oi
-f ${sender} ${recipient}
------------------------------------------------------------------------
then the simplest sieve rule I can think of:
------------------------------------------------------------------------
require "fileinto";
if header :contains "X-Spam-Flag" "YES" {
fileinto "Spam";
}
------------------------------------------------------------------------
I'd like to make this rule active for only local deliveries via dovecot
LMTP with sieve plugin and setting postfix `mailbox_transport' to
dovecot LMTP.
I believe it is so simple it should work (am I wrong?). But...
It would be more convenient to do some tests before applying changes to
a production environment config. The problem is: I have no separate
testing environment with my strange configuration I'm able to test a
spamassassin score for an e-mail manually. How about dovecot LMTP? Can I
test local mail delivery by dovecot LMTP manually? I mean: to simulate
"I'm the Postfix" and produce for some testing e-mail the same
effect as
postfix granting it via `local_transport' to dovecot?
Best regards,
Marek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3914 bytes
Desc: S/MIME Cryptographic Signature
URL:
<https://dovecot.org/pipermail/dovecot/attachments/20190316/e60702bf/attachment.p7s>
On 3/16/19 3:49 PM, Marek Kozlowski via dovecot wrote:> Can I test local mail delivery by dovecot LMTP manually? I mean: to > simulate "I'm the Postfix" and produce for some testing e-mail the > same effect as postfix granting it via `local_transport' to dovecot? > > Best regards, > Marek >You can use dovecot-lda like this : cat <<EOF | /usr/lib/dovecot/dovecot-lda -d $USER From: sender To:Recipient Subject: Test Hello, this is the body of the message EOF "I am The Postfix" really has potential as a t-shirt banner ^^' Yassine.
:-) On 3/17/19 10:22 AM, Yassine Chaouche via dovecot wrote:> > On 3/16/19 3:49 PM, Marek Kozlowski via dovecot wrote: >> Can I test local mail delivery by dovecot LMTP manually? I mean: to >> simulate "I'm the Postfix" and produce for some testing e-mail the >> same effect as postfix granting it via `local_transport' to dovecot? >> > You can use dovecot-lda like this : > > cat <<EOF | /usr/lib/dovecot/dovecot-lda -d $USER[...] Thank you but... Please mind that I'm planning to use dovecot LMTP rather than LDA. Best regards, Marek -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3914 bytes Desc: S/MIME Cryptographic Signature URL: <https://dovecot.org/pipermail/dovecot/attachments/20190317/1d1bd27c/attachment.p7s>
On 16/03/2019 11:49, Marek Kozlowski via dovecot wrote:> Can I test local mail delivery by dovecot LMTP manually? I mean: to > simulate "I'm the Postfix" and produce for some testing e-mail the > same effect as postfix granting it via `local_transport' to dovecot? >You can probably use swaks for that, it has LMTP support. -- You canna change the laws of physics, Captain; I've got to have thirty minutes! Eduardo M KALINOWSKI eduardo at kalinowski.com.br
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
<br>
</div>
<blockquote type="cite">
<div>
On 17 March 2019 13:30 Eduardo M KALINOWSKI via dovecot <
<a
href="mailto:dovecot@dovecot.org">dovecot@dovecot.org</a>>
wrote:
</div>
<div>
<br>
</div>
<div>
<br>
</div>
<div>
On 16/03/2019 11:49, Marek Kozlowski via dovecot wrote:
</div>
<blockquote type="cite">
<div>
Can I test local mail delivery by dovecot LMTP manually? I mean: to
</div>
<div>
simulate "I'm the Postfix" and produce for some testing
e-mail the
</div>
<div>
same effect as postfix granting it via `local_transport' to dovecot?
</div>
</blockquote>
<div>
You can probably use swaks for that, it has LMTP support.
</div>
<div>
<br>
</div>
<div>
<br>
</div>
<div>
--
</div>
<div>
You canna change the laws of physics, Captain; I've got to have thirty
minutes!
</div>
<div>
<br>
</div>
<div>
Eduardo M KALINOWSKI
</div>
<div>
<a
href="mailto:eduardo@kalinowski.com.br">eduardo@kalinowski.com.br</a>
</div>
</blockquote>
<div>
socat stdio unix-connect:/path/to/socket
</div>
<div class="io-ox-signature">
<pre>---
Aki Tuomi</pre>
</div>
</body>
</html>