Unverified.email
kerestey.net
kerestey.net
Shouldn't GETs be idempotent? (Sorry for not having feedback on the idea, skimming it it seems nice, though there is fierce competition as others have shown here)
To be pedantic, every GET request to a modern website makes a state change somewhere... to a log file, to a database, to a tracking system. The difference is it has no side effect for the user (i.e. your comment gets duplicated or your order placed twice)
> safe, meaning that applying it to a resource does not result in a state change of the resource (read-only semantics)
It should never be used to -create- anything, only to retrieve existing resources (and not change their state). For creating we have POST requests. Obviously no one is going to care or do anything about it if you use GET, but if we're going to be pedantic le t's not mischaracterise GET requests.
I'm not suggesting that it's named wrong or anything like that, this is just about your comment.
Request methods are considered "safe" if their
defined semantics are essentially read-only; i.e.,
the client does not request, and does not expect,
any state change on the origin server as a result
of applying a safe method to a target resource.
Likewise, reasonable use of a safe method is not
expected to cause any harm, loss of property, or
unusual burden on the origin server.
This definition of safe methods does not prevent
an implementation from including behavior that is
potentially harmful, that is not entirely read-only,
or that causes side effects while invoking a safe
method. What is important, however, is that the
client did not request that additional behavior and
cannot be held accountable for it. For example, most
servers append request information to access log files
at the completion of every response, regardless of the
method, and that is considered safe even though the
log storage might become full and crash the server.
Likewise, a safe request initiated by selecting an
advertisement on the Web will often have the side
effect of charging an advertising account.
Of the request methods defined by this specification,
the GET, HEAD, OPTIONS, and TRACE methods are defined
to be safe.
https://tools.ietf.org/html/rfc7231#section-4.2.1A subsequent GET may return different data because another POST/PUT modified the data but a GET should never modify the data itself (e.g. i won‘t be able to safe this comment by GET but by POST).
Idempotent == if you do it more than once, you get the same result.
As soon as the API is figured out, it'll be used for mass spam signups. I've done one of these before, and pretty much if you allow any form of being able to retrieve a code or URL or number from the body/subject, it'll be used for millions of spam signups.
That it doesn't actually relay mail doesn't hinder its spam potential.
It would appear that it is configured to receive email sent to @unverified.email
I don't think there's any obligation to try to make that work, nor how allowing people to do so is in any way harmful.
The few times I've hosted something like this (previously running open source https://gitlab.com/markbeeson/maildrop), it just never ends well.
What typically happens is abuse reports start rolling in for mass forum spam, mass registration, comment spam, domains get blacklisted and added to global blacklists like URIBL.
Over time as bad actors found it, I eventually was doing more than 50-80 Mbps of _purely text traffic_ of bots flooding registrations, inbound SMTP traffic of nothing but spam, bots effectively sending DoS-level requests looking for activation links. It was frustrating to want to run something fun and inevitably end up spending half your day responding to "this is a development/testing INBOUND ONLY mail service, we did not originate the spam, we are not signing up 5000 times to your forum", adding a domain blacklist to never show messages from certain websites, etc.
I'd suggest a POST here. Theres some extra web browser checks against sending cross origin POSTs that GETs don't have. The GET makes abuse easier.
But I'm curious about your statement:
> if you're intent on not letting users sign up with disposable email addresses (and you shouldn't be)
Why not? It seems like some people are eager to not be on any mailing lists, and the worst downside seems to be that they won't able to reset their password.
Yahoo.com et al. are still available to create one-off emails to allow someone to get past a (say) 14-day free trial every 14 days, so how does blocking these guys help?
I think you missed his double-negative there - he is saying that you shouldn't not be letting users sign up with ...
... which I agree with ...
Yahoo requires SMS verification on every signup.
It works well for peace of mind as it gave me a high degree of confidence that I'm testing almost exactly what the end-user would experience. However, it does add 5-10 seconds of delay to your tests while polling the email inbox, it can be a little expensive depending on your test frequency, I think there are even some cases where you can hurt your email deliverability stats during automated email sending.
In the end, I decided to keep this test manual which I run every now and then only after making big changes. Instead integration tests which mock the email service are probably enough for my use case.
Curious how do others test the end-to-end behaviour of their web application, when it comes to emailing?
In the past I've also used a local test SMTP server, similar to the service in the article, but much more basic (I forget the name of it now).
I'm using Guerrilla Mail[0] for that, and it works, but it's slow to receive the email and make it available.
I'm using gauge[1] with taiko[2] to write the tests, and liking it a lot, even though I never liked cucumber. taiko is just very reliable, and the test support code is much nicer to write.
[0] https://www.guerrillamail.com [1] https://gauge.org [2] https://taiko.dev
I'm very curious why this takes the approach it appears to take: running two docker containers with opensmtpd in one of them, and then scanning the maildir for message content; compared to what the numerous existing solutions (mailcatcher, mailtrap, mailhog, maildump) all do: run an in-process SMTP server.
Meanwhile https://thehackernews.com/2020/01/openbsd-opensmtpd-hacking....
Here's the iptable command: "iptables -t nat -A OUTPUT -p tcp --dport 25 -j REDIRECT --to-port 2000"
The catch-all server is ridiculously simple. It just responds with a "220 hello" when connected to, and then just reads input line by line, logging all input to a file. It only knows about two SMTP commands: DATA and QUIT.
On QUIT it sends "221 bye" and closes the connection.
On DATA it sends "354 send the message" and then just reads the data and logs it to the file.
Anything else? It just sends "250 OK".
Note that this is pretty useless if what you are trying to test is a mail client, because you cannot test error cases. The purpose of this SMTP catch-all is for testing the content of messages your software sends, not for testing the process of mailing itself.
Each connection is logged to a separate file.
The source is a single Java file. Here it is if anyone wants it [1]. "javac SmtpSink.java" to compile. "java SmtpSink" to run. Messages are stored in the "msgs" directory, which you should make before running it.
This can be easily accomplished with a single iptables / nftables / pf / etc. rule.
(A non-insignificant number of ISPs, CSPs, etc., block outbound connections to 25/TCP by default -- except, in some cases, those going to to their own mail servers or "smarthosts".)
587/TCP is the "submission" port and is exactly what people should be using instead of 25/TCP (it usually -- but not always -- requires authentication and is pretty much never blocked). Indeed, that's the intended purpose!
Afaict, this isn't a forwarder, just a mailbox endpoint.
Mailslurper appears to be abandoned and seems to be missing deterministic builds that go module support provides.
Mailcatcher has been around for a while, with my first discovering it being used in a legacy project's test suite back in 2014.
Both could use some better SEO since it's nearly impossible to find unless you know exactly the right keywords to use.
Sorry... how does it know what mailbox id to look for?
Edit: it used a cron job that runs every minute and used `find` to delete any file that’s 5 minutes old. This both cleans up emails and deleted mailbox ids.
This is a rather simple way to do this but you could just dump a massive amount of email on the service and it’ll run really slowly for the next 5 minutes.