Using SMTPD to catch spam

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Using SMTPD to catch spam

karlis.mikelsons
Hello,

My idea is quite simple - I have list of IP addresses that are only
sending spam and I need to collect that spam, instead of rejecting it,
so that I can report it to authorities.

I've been thinking about using OpenBSD SMTPD for this task, but can't
figure out how to do that.

PF has table of spammer IPs that it would redirect to other server or
port. On that server I need SMTPD running and receiving emails for any
destination and deliver it to specific maildir. That's where I have my
first problem. How can I tell SMTPD to receive every email, no matter
what receiver is?

I've tried this, but it doesn't work and SMTPD complains about syntax
error:
   accept from any for any deliver to maildir /var/spamdb

What am I doing wrong here?

Second question, is it possible to run both Postfix (as primary MDA) and
OpenBSD SMTPD (as spam MDA, listem to port 9025) simultaneusly on the
same server?


Thanks!
Karlis

Reply | Threaded
Open this post in threaded view
|

Re: Using SMTPD to catch spam

karlis.mikelsons
>> My idea is quite simple - I have list of IP addresses that are only
>> sending spam and I need to collect that spam, instead of rejecting it,
>> so that I can report it to authorities.
> Why do you want to do that?
I need it to report spam to authorities, they only react here if you
have actually received the spam.

>>   accept from any for any deliver to maildir /var/spamdb
>> What am I doing wrong here?
>
> You need to show your full and exact smtpd.conf
> and the full and exact error message(s).
That's all there is to show (except for comments):
   listen on lo0 port 9025
   accept from any for any deliver to maildir /var/spamdb

# /usr/sbin/smtpd
/etc/mail/smtpd.conf:17: syntax error
warn: no rules, nothing to do

Line 17th is "accept" rule in smtpd.conf file.

By the way, I'm doing this on OpenBSD 5.3.


Thanks,
Karlis

Reply | Threaded
Open this post in threaded view
|

Re: Using SMTPD to catch spam

Reyk Floeter-2
On Wed, Sep 04, 2013 at 08:10:53PM +0300, K�?rlis Miķelsons wrote:
>   listen on lo0 port 9025
>   accept from any for any deliver to maildir /var/spamdb
>
> # /usr/sbin/smtpd
> /etc/mail/smtpd.conf:17: syntax error
> warn: no rules, nothing to do
>

try putting the path in quotes:

accept from any for any deliver to maildir "/var/spamdb"

Reyk

Reply | Threaded
Open this post in threaded view
|

Re: Using SMTPD to catch spam

karlis.mikelsons
>> # /usr/sbin/smtpd
>> /etc/mail/smtpd.conf:17: syntax error
>> warn: no rules, nothing to do
>>
> try putting the path in quotes:
>
> accept from any for any deliver to maildir "/var/spamdb"
Thank you, Reyk, that fixed the problem!

Is there a way to create catchall aliases or virtuals so that SMTPD
would receive email for all domains and all user accounts? I've been
trying different combinations of alias and virtual databases, but
nothing seems to work.


Thanks,
Karlis

Reply | Threaded
Open this post in threaded view
|

Re: Using SMTPD to catch spam

karlis.mikelsons
> Is there a way to create catchall aliases or virtuals so that SMTPD
> would receive email for all domains and all user accounts? I've been
> trying different combinations of alias and virtual databases, but
> nothing seems to work.
To answer my own question:
# cat /etc/mail/smtpd.conf
listen on lo0 port 9025
table vusers db:/etc/mail/vusers.db
accept from any for any virtual <vusers> deliver to maildir
"/var/spamdb"

# cat /etc/mail/vusers
@ _spamdb

And /var/spamdb has to be owned by _spamdb user.

Thanks everyone for your help.

Karlis