No matter where they are... do a script that takes users from wherever they are and dump them to a file... later find differences between the last file you dumped and from within just dumped.... then just do INSERT or UPDATE of those users... it's important not to load databases... so only do this twice or thice a day and avoid writting nothing on the tables queried by relayhost machines. Create a table with two fields user and pass, primary key user, and be generous with mysql cache (set the mysql slave too as said before). Later for smtpd redundancy set two smtpd and create a roundrobin balanced A record with TTL of 120 seconds or so... and set you're customer mail machines to send all mail to this balanced A record by authenticating each server with it's user in you're machines. If you see a customer machine is affecting to you're performance reject it's mails with 4xx till you see what to do. This is for performance.

Now for controlling spam :

Query several rbl in background and see how they talk to you... if 3 or 4 of not very important or trustable are talking about you probably you're sending some spam and if you don't correct it or check it unless you perhaps end in spamhaus and so... you could too check for rejecting directly spamcop and spamhaus rbl. For those users wich you thing they're sending spam or similar check with spamassassin and amavis they're mail... if mail has more than 7 of spam score.... either reject, send to another place... bounce or whatever you want but don't send to destionation. If a IP is sending you more than perhaps depends on the number of mails moved by the connecting server to you're machines but... if more than 20% of mail is spam per hour.... reject them with 4xx saying that server is busy or something... and later check how many bounces have they get because incorrect rcpt or so... and how many mails are sending now from the normal average they send... check if they're sending mailing lists... or whatever.... and till you don't know exactly what they're doing to allow them to relay through you're server.

This are my advises :).

2.0.0 Bye

El 19/09/2009, a las 17:56, Egoitz Aurrekoetxea Aurre escribió:

No matter where they are... do a script that takes users from wherever they are and dump them to a file... later find differences between the last file you dumped and from within just dumped.... then just do INSERT or UPDATE of those users... it's important not to load databases... so only do this twice or thice a day and avoid writting nothing on the tables queried by relayhost machines. Create a table with two fields user and pass, primary key user, and be generous with mysql cache (set the mysql slave too as said before). Later for smtpd redundancy set two smtpd and create a roundrobin balanced A record with TTL of 120 seconds or so... and set you're customer mail machines to send all mail to this balanced A record by authenticating each server with it's user in you're machines. If you see a customer machine is affecting to you're performance reject it's mails with 4xx till you see what to do. This is for performance.

Now for controlling spam :

Query several rbl in background and see how they talk to you... if 3 or 4 of not very important or trustable are talking about you probably you're sending some spam and if you don't correct it or check it unless you perhaps end in spamhaus and so... you could too check for rejecting directly spamcop and spamhaus rbl. For those users wich you thing they're sending spam or similar check with spamassassin and amavis they're mail... if mail has more than 7 of spam score.... either reject, send to another place... bounce or whatever you want but don't send to destionation. If a IP is sending you more than perhaps depends on the number of mails moved by the connecting server to you're machines but... if more than 20% of mail is spam per hour.... reject them with 4xx saying that server is busy or something... and later check how many bounces have they get because incorrect rcpt or so... and how many mails are sending now from the normal average they send... check if they're sending mailing lists... or whatever.... and till you don't know exactly what they're doing to allow them to relay through you're server.

This are my advises :).

2.0.0 Bye




El 19/09/2009, a las 17:33, Martin Allan Jensen escribió:

Egoitz Aurrekoetxea Aurre wrote:
Is not valid for doing all you're customers mail machines to connect to a relayhost, because machines connecting to relay host smtpd server are not doing any pop against nothing. Take a list of users in all databases, do a small table in mysql set the primary key properly (refresh table with changes with cron several times per day, 2 or 3) and set a dedicated mysql machine and another one in backup replicating from the master and not be queried. And you should move with this structure the mail without serious problems. I think you're more worried about authentication wich is pretty easy and forgotten about other problems... like spam I said... because if you have so huge number of users you should control what are they doing and here you should be perhaps more skillful. I'm working on a new project for helping Postfix preventing spam and rejecting it quite easy (not just through spamassassin, that is not enough) in some months I'll have it available and opened under BSD license too as Postfix quota reject.

I will try to do that. It's just that some users are in MySQL, some in passwd, some in BerkeleyDB, and so on.
But I guess it is the only stable solution.

Thank you all for your opinions.

Have a nice weekend.

--
Martin


Reply via email to