Live data from Hacker News

A serverless email server on AWS using S3 and SES

github.com

191–200 of 217 posts

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

#191

Earlier quoted context omitted.

> 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…

I'm a little confused about why you're responding to me. I think I agree with everything you're saying, but I'm not sure where the comparison with PHP hosting is coming from. Are you sure you responded to the right thread?

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

#192
I built something on those lines, although way simpler in terms of functionalities and resources used.

All I wanted was to receive/send emails from a custom address (@acme.com) using Gmail, but I didn't want to pay Google Suite for that.

So I used SES+S3+Lambda to receive emails and forward then to a Gmail alias (email+acme@gmail.com) so I can attach a filter on them using a label. And for sending emails using the address, I simply authenticated it on Gmail using the "Send mail as" option using AWS SES SMTP credentials.

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

#193

Earlier quoted context omitted.

> 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.

So if you get an omelette at a restaurant, I can call it an eggless omelette because I didn’t have to cook the eggs myself?

If "egg" was an overloaded term that meant the noun "egg" and the noun "process of cooking an egg for an omelette", then yes, you could.

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

#194

Earlier quoted context omitted.

EC2 micro instances are free.

but are often blacklisted as SMTP sources, unfortunately.

Not really, only if it the IP was used to delivery spam.

But IP reputation can be established with a bit of warm up and human interaction.

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

#195
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".

My understanding of it has been "look, I reinvented cgi-bin."

I don't think there's anything wrong with reinventing something to be more accessible.

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

#197

Earlier quoted context omitted.

You are incorrect, see man pages.

This makes no sense (too abstract of a statement), but here let's try this: $ man systemd | head -4 | tail -1 systemd, init - systemd system and service manager An email daemon (Postfix, Exim, Dovecot, UW-IMAP, Sendmail, etc.) are services running on a server. An "email server" would be a server running a daemon to provide email service in this example.

Makes plenty of sense: https://man7.org/linux/man-pages/man1/smtp.1.html

"SMTP transaction against an SMTP server"

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

#198
post #174

Earlier quoted context omitted.

No, you can't set it to anything, you'll fail DKIM/DMARC/SPF. Just leave it as it is! You just wrap the original email in an 'envelope' with envelope-to (you @ other provider) and envelope-from (whatever @ verified with SES). You can see this here, if it helps at all, though it's a bit DSL-y: https://github.com/OJFord/amail/blob/c602f4d36c1bb9df4da1744...

I download and run your Rust code. And apparently it's same as others. You cannot set the FROM header to any value, therefore cannot forward the email as it's by retaining the original header. thread 'main' panicked at 'Failed to send test: Permanent(Response { code: Code { severity: PermanentNegativeCompletion, category: MailSystem, detail: Four }, message: ["Message rejected: Email address is not verified. The foll…

We're saying the same thing? I said no, you can't modify FROM, but you don't want to (for my/these purposes anyway).

What you can do, and what the code does (with values from env) is set the envelope addresses.

The email ('letter') inside is still from the original sender, and to my original receiver. It's just 'repackaged' in an 'envelope' from my relay (some arbitrary but SES verified address) to wherever I want it to end up (e.g. Gmail in your case).

It looks like you tried to send 'from' Gmail, which doesn't make sense, [edit: I suppose you could verify just your Gmail address in SES, if you really wanted to use that as the 'envelope from'/`MAIL FROM`] in this setup you want to send it on from Lambda (SES having received it) to Gmail.

More about email 'envelope's here (just my first search result, looks ok) https://www.mybluelinux.com/what-is-email-envelope-and-email...

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

#199
post #174

Earlier quoted context omitted.

No, you can't set it to anything, you'll fail DKIM/DMARC/SPF. Just leave it as it is! You just wrap the original email in an 'envelope' with envelope-to (you @ other provider) and envelope-from (whatever @ verified with SES). You can see this here, if it helps at all, though it's a bit DSL-y: https://github.com/OJFord/amail/blob/c602f4d36c1bb9df4da1744...

By envelope-from (whatever @ verified with SES), do you mean the `MAIL FROM` command in SMTP protocol or do you mean the `header FROM` in the email header? I don't know how `send_raw` work under the hood in Rust, but without a way to set `from` header. how do recipient(say an @gmail.com) address show the original from too? Did I miss something here? It would be great if somehow the email is forward as it's in so it a…

Yes, I had to check that, but MAIL FROM & RCPT TO are the 'envelope' addresses.

> It would be great if somehow the email is forward as it's in so it appear in my inbox and all the information(header) is retain.

Yup that's exactly it. In the client reader it looks exactly the same as if it'd been sent there directly, rather than to SES and relayed on.

(If you dig into the headers it's all there of course, but just from a 'consumer' perspective it all looks normal viewing the email.)

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

#200
post #199

Earlier quoted context omitted.

By envelope-from (whatever @ verified with SES), do you mean the `MAIL FROM` command in SMTP protocol or do you mean the `header FROM` in the email header? I don't know how `send_raw` work under the hood in Rust, but without a way to set `from` header. how do recipient(say an @gmail.com) address show the original from too? Did I miss something here? It would be great if somehow the email is forward as it's in so it a…

Yes, I had to check that, but MAIL FROM & RCPT TO are the 'envelope' addresses. > It would be great if somehow the email is forward as it's in so it appear in my inbox and all the information(header) is retain. Yup that's exactly it. In the client reader it looks exactly the same as if it'd been sent there directly, rather than to SES and relayed on. (If you dig into the headers it's all there of course, but just fro…

That's really weird though. I'm really curious to see how did you made it work because I want to make it works too.

As I understand, an mail client, like gmail.com web UI, use FROM header to show who send this email(not the MAIL FROM, which apparently is envelop FROM address).

So my questions: without ability to changing the FROM header in email, how can your mail client display original sender? because the original sender is outside of your domain.

So I have a domain: `acme.com`. Someone, let's say from OJFord@gmail.com send an email to `acme.com`. And I want it to forward to kureikain@gmail.com using AWS SES? But obviously, and I can confirm by trying `smtp.send_raw`, I can only set "FROM: "header to a verified address. But in my case, the "From" is "OJford@gmail.com"...

Also, I think MAIL FROM/RCPT TO(Envelop header) rarely being used to show on a mail client. They work at a higher level, mostly for routing purpose. https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-e...

I really hope to make it works. So anyone can send email to my domain, and I can retain their original FROM. like the example above.

Post reply on HN