haraka / Haraka

A fast, highly extensible, and event driven SMTP server
https://haraka.github.io
MIT License
5.08k stars 661 forks source link

Rate Limit For Single user #1196

Closed Manojkumar09 closed 9 years ago

Manojkumar09 commented 9 years ago

Hi All,

I am trying to set rate limit for single user. I have 2 users in my file-

  1. manoj
  2. hsmt

I have installed rate limit plugin and i see that there is limit for some things like -

But there is no entry to limit max connections for a user.

I am running this plugin successfully but this is not i want. I want to limit max connections for manoj and for hsmt different-2.

Like Manoj can send 100 emails and hsmt can send 200 emails from any sender id they want but limit should not exceed from 100 and 200.

Give me a hint i will try.

smfreegard commented 9 years ago

You want to limit rate and concurrency by the authenticated user?

If so - the rate limit plugin does currently do this. Code is welcome to add that functionality though.

Manojkumar09 commented 9 years ago

Hi, I can see in code there is limit for host and sender -

var chain = [ { name: 'rate_rcpt_host', lookup_func: 'lookup_host_key', lookup_args: [connection.remote_ip, connection.remote_host], }, { name: 'rate_rcpt_sender', lookup_func: 'lookup_mail_key', lookup_args: [connection.transaction.mail_from], }, { name: 'rate_rcpt_null', lookup_func: 'lookup_mail_key', lookup_args: [params[0]], check_func: function () { if (transaction && !transaction.mail_from.user) { // Message from the null sender return true; } return false; }, }, { name: 'rate_rcpt', lookup_func: 'lookup_mail_key', lookup_args: [params[0]], }, ];

But where is particular user limit? could you highlight the part of code which is responsible for limit for authenticated users.

smfreegard commented 9 years ago

There is no code to limit authenticated users.

Manojkumar09 commented 9 years ago

Hi, Thanks for your reply but i don't think it is not possible if limit can be at sender's domain so it could be at users also. I am working on this project since last 5 months and it is necessary for me so please help me to solve this. Give me a hint that how it can be done so i will try to apply this.

smfreegard commented 9 years ago

Thanks for your reply but i don't think it is not possible if limit can be at sender's domain so it could be at users also.

I didn't say it couldn't. If you want to rate limit the sender address then:

[rate_sender]
foo@bar.com = 100/1h

I am working on this project since last 5 months and it is necessary for me so please help me to solve this. Give me a hint that how it can be done so i will try to apply this.

And you paid precisely $0 for it. Helping you work out how to code or to read the documentation doesn't come with the $0 you paid.

I strongly suggest you read http://www.catb.org/esr/faqs/smart-questions.html before you raise any further 'issues'.

BTW Vivek - it's pretty obvious that you're the same person that spoke to me via PM on IRC yesterday and this account is merely another way to ask the same questions you've been asking repeatedly for ages and attempting to get helpful people like me to do your own work for you either because you're lazy or simply don't have a clue.

I'm blocking both you and your other account on Github as I'm annoyed at your behaviour and the way I was coerced into spending about 2 hours explaining code and modifying a plugin by you.

Manojkumar09 commented 9 years ago

Hi, First of all i want to say sorry to you because i do not want that you do my work but i opened a issue after trying many things but could not get results. I can pay also for the code which i want because as i said it is necessary for me. i think my node.js is nt very good also i am not able to find a node.js developer. I am not attempting to get any help because i am lazy it is because i am doing but not successful. Please try to understand and if you want i can pay you via any way.

Waiting for your reply.

msimerson commented 9 years ago

@Manojkumar09 , a way to ask for help and offer payment is after you open an issue, head on over to Bountysource and post a bounty on it. Then a Haraka developer that has the time and inclination to write some code for you can do so.

Bountysource

Manojkumar09 commented 9 years ago

Hello sir, Thanks for this suggestion. I have checked this but i am little bit confuse that i will pay for that person who will write code for me but what if he give me any other code or his code doesn't work? How this bountysource payment process work? When any developer can release payment?

Dexus commented 9 years ago

Hi Manoj Kumar 09, because the ticket is public, certainly none of us will come up with the idea to give you a different code, or a non-working code. Alone the idea would take us back already in a bad light. We are of course always there for our customers / users and want to support you, as far as possible as open source support. The Bounty is only released, though is achieved really the goal.

Your questions like Bountysource works are answered here: https://github.com/bountysource/frontend/wiki/Frequently-Asked-Questions