Live data from Hacker News

A serverless email server on AWS using S3 and SES

github.com

151–160 of 217 posts

Re: A serverless email server on AWS using S3 and SES

#151
post #96

When the documentation says "this may cost you money" what they really mean is "this will cost you a lot of money the moment your email address gets onto any spam lists". The number of lambda invocations will go through the roof, and even if you're able to catch 90% of the spam before dumping messages into S3, the cost of putting a message into a bucket will make your bill skyrocket periodically as spammers temporari…

depends how you define a lot of money. How much would this cost to receive 30k messages per month?

Assuming a default message size of ~10kbytes the SES pricing is about $6 for the connections plus the chunks. Your lambda pricing is negligible and the S3 pricing gets you another dollar or so.

But you're operating at the wrong scale-- 30k messages to a domain can happen in an hour by a spammer doing a directory attack. The point is that this solution is extremely open to abuse that happens all day every day over SMTP. Without a fixed-cost firewall to reject messages and only allow clean messages through to this solution, you are going to have escalating costs.

Re: A serverless email server on AWS using S3 and SES

#152
post #146

Something link that could be useful as disaster recovery action. I case of problems with the Mail infrastructure redirect the DNS to something like that and incoming e-mails won't get lost in the meantime. The standby cost for something like that is much lower then a independent secondary e-mail system.

Why redirect anything? You can have backup MX records. This is already a solved problem. And backup system can be quite lightweight, if it only needs to store emails for the time primary is down and then push them to primary once it's up again.

Re: A serverless email server on AWS using S3 and SES

#154
post #121

Earlier quoted context omitted.

> Botnets continue to be the number one source of junk email and will likely continue as we add more and more insecure doorbells, garage openers, refrigerators, etc, to our home networks. Surely that's an argument against blocking IPs? Unless I suppose you argue they're predominantly in homes; and homes are predominantly not running (intentional, well-behaved) email servers, so sorry-not-sorry those who are.

Yes. The days of running a legitimate MTA at home are unfortunately over. Many US-based consumer ISPs block port 25 entirely except for connections to their own MTAs, but for the ones who don't, very very many of those IP addresses wind up on policy-based blacklists -- eg "this network is a bunch of consumer addresses and should never be connecting directly to an MTA"

Running from home IP sucks for other reasons too, like non-static IP addresses, or lack of public IPv4/use of CGNAT.

I certainly would not risk my emails being delivered to someone else's computer just because IP address changed, and DNS still points to the previous one.

But having the server and data at home is still possible via VPN.

Re: A serverless email server on AWS using S3 and SES

#155

I was trying to set up Amazon Cognito (an authentication service) recently which basically needs a verified email address to send users emails for user verification and password reset, and I was shocked that Amazon has no basic email hosting service. Of course it’s easy enough to work around for my use case, but I was surprised nonetheless.

They have workmail.

Re: A serverless email server on AWS using S3 and SES

#156

Earlier quoted context omitted.

depends how you define a lot of money. How much would this cost to receive 30k messages per month?

Assuming a default message size of ~10kbytes the SES pricing is about $6 for the connections plus the chunks. Your lambda pricing is negligible and the S3 pricing gets you another dollar or so. But you're operating at the wrong scale-- 30k messages to a domain can happen in an hour by a spammer doing a directory attack. The point is that this solution is extremely open to abuse that happens all day every day over SMT…

That's a lot of money for a LKML subscription. :)

Re: A serverless email server on AWS using S3 and SES

#157
post #22

A serverless server? It is a great illustration of how the term "serverless" has shifted from literally no server (ex: sqlite database) to "somebody else's computer".

> serverless server? This isn’t a contradiction. “Server” is an overloaded term and the “server” in “serverless” refers to a different meaning of “server” than the “email server” bit. “Serverless” means there is no physical or virtual hosts to manage, you just supply the request handler i.e., the email server . It's amusing because it sounds like a contradiction, but it's not one.

Cloud 2.0 "serverless" often expects:

- Just add code/logic

- Scales to zero (zero calls to your endpoints, $0/mo)

- Scales up automagically to match load

- You don't do anything to provision/patch servers (e.g. FaaS)

Classic PHP shared hosts don't meet this definition because:

- You paid a flat monthly hosting fee (e.g. Dreamhost)

- You only scaled to 1 node (need more, too bad)

True, you didn't usually need to mess with PHP.ini or Apache server installs and configs, but you still didn't get the same benefits as modern serverless.

Re: A serverless email server on AWS using S3 and SES

#158
post #33

Earlier quoted context omitted.

I was doing serverless pages back in late 90s when I uploaded PHP scripts to "website providers".

Different thing though. When you uploaded your PHP script, you uploaded it to a single server, and it ran on a single server. Unless your provider were doing some kind of load balancing (doubt it). With serverless you upload your 'script' to the 'cloud' and then it will run on any number of servers, usually assigned to one when it dry-runs. Then it'll unload from the server afterwards. And therefore unless you have a…

Scaling: upload file to another server.

Re: A serverless email server on AWS using S3 and SES

#159
post #141

Earlier quoted context omitted.

"means there is no physical or virtual hosts to manage" We're just swapping one type of management for another, really. Becoming proficient in all the permutations of AWS stack, for example, to * make sure you don't get overbilled, * have appropriate memory/limit resources on your lambdas, * have correct backup/redundancy on s3, * make sure all your IAM policies are correct and not allowing malicious actors, etc. and…

Billing exists for servers as well. Servers need to be configured as do lambdas. Servers also have backup needs. Servers also present security problems of access. It's not that hard to configure a lambda to run in just as limited a way as a physical machine. Not having to worry about MCEs or disk failure patching makes the concerns less like a "different set" and more like a subset of things to worry about relative t…

Amen.

How many times did you update your Node.js AWS Lambdas or GCP Cloud Functions because of the Linux kernel CVE of the week? You didn't because all you're responsible for is your few lines of Node.js logic that kept on scaling and humming along. The cloud vendor cares for the rest.

Re: A serverless email server on AWS using S3 and SES

#160
post #18
post #7

Reading it I get that AWS now by default restricts email by - 200 mails per day max. 1 per second. - Can only send mail to verified addresses. Not sure how they verify though. - Can only send mail from the domain you own and verified. All these are good steps. Guess that will gradually take AWS IPs out of all those mail blacklists. And while we are on the topic, I find IP based mail blacklist services such as BRBL ob…

> 200 mails per day max. 1 per second They've been limiting max sends per day for a long time. I set up an account around 4-5 years ago and they had a limit back then. I forgot the exact amount but it was 200 or less. But, they do make it pretty easy to get the limit raised. I filled out a form and about a day later they bumped my limit to 50,000 per day and I think I only requested 10k per day. The form required bas…

They must just give 50k as the baseline. I asked for the minimum, which I think was 200, and they gave me 50k. I was surprised because my plan for handling bounced email was “by hand.” Lol.
Post reply on HN