News for hackers. Stuff that matters.
Re:Announcing Notqmail by cryptonector on Tuesday August 20, 2019 @07:08PM (#20753170)
Why not Postfix? I trust Wietse V. and Viktor D. a great deal, and I trust their coding abilities at least as much as if not more than DJB's for anything that isn't a cryptographic algorithm.

FYI, "I’ve learned more C, reduced build-time complexity, ..." probably isn't confidence-inspiring. I work with C a great deal and have for a very long time, and I though I'm very comfortable with C, I treat it with fear and respect -- I have found far too many security vulnerabilities just from staring at C source code to do anything else. Now, I too have "learned more C" over the years, but I wouldn't write a sentence like that as part of justification for some project written in C -- I would fear that others would wonder if I don't just know enough C to be dangerous. Perhaps one should not write "I've learned more C" as part of anything other than justification for moving to Rust.

Re:Announcing Notqmail by sigil on Tuesday August 20, 2019 @09:02PM (#20753779)
Postfix has had 9 CVEs in 20 years, a few of them quite bad. [0]

qmail has had 1 CVE in 20 years, a local DoS. [1]

I trust djb to write correct code more than almost any other human on the planet. That includes all the non-crypto code found in qmail, daemontools, dnscache, ucspi-tcp, etc. If you’ve read it, you know how almost supernaturally careful and minimal it is.

Your points about mere mortals writing C are well taken though!

[0] https://www.cvedetails.com/vulnerability-list.php?vendor_id=...

[1] https://www.cvedetails.com/vulnerability-list.php?vendor_id=...

Re:Announcing Notqmail by pilif on Wednesday August 21, 2019 @01:10AM (#20754714)
The moment you start patching qmail you're not running qmail any more. None of the CVE numbers are meaningful to your custom-patched qmail.

qmail was good when you could use it in its default configuration. Unfortunately, very few sites could (much less still can).

Which brings us to the question of who you trust more: The maintainers of a full-featured MTA who have maintained their software for 20 years or some person's patches to scratch their itch before moving on and never touching it again?

Re:Announcing Notqmail by linsomniac on Wednesday August 21, 2019 @01:00AM (#20754681)
Can you revise that "9" number, because looking at it I feel like some of those are inappropriately filed against postfix.

I find it hard to pin a "postfixadmin" CVE on postfix, are we going to blame vmailmgr bugs on qmail? :-) The BSDDB one I'm on the fence about. "postfix_groups.pl" is marked as disputed. Another seems to be clearly a Debian package issue.

CVE-2011-0411 is interesting because, IIRC, qmail had no SSL/TLS abilities, and the hacks you had to put into place to enable it were abominations and likely opened up issues of their own.

Re:Announcing Notqmail by sigil on Wednesday August 21, 2019 @02:07AM (#20754897)
Fine, let’s call it 7, since postfixadmin & the debian postinst script can’t be attributed to postfix proper.

I’m not sure this qualitatively changes the argument. CVE-2011-1720 and CVE-2008-2936 are examples of postfix vulns no one has found, or reasonably expects to find, in djb code.

Re:Announcing Notqmail by pilif on Wednesday August 21, 2019 @02:28AM (#20754969)
> CVE-2011-1720 and CVE-2008-2936 are examples of postfix vulns no one has found, or reasonably expects to find, in djb code.

CVE-2011-1720 is related to SMTP authentication which qmail doesn't support out-of-the box. So. Yes you're right: You don't find that vulnerability in qmail because qmail doesn't have that feature.

Can you run an SMTP server without authentication these days? Not if you have users using you as a relay. So I guess you have to custom patch qmail and now you're back to not running djb code in the first place.

CVE-2008-2936 I grant you. Though once we are at doing hardlinks to symlinks, we might hit other edge-cases too, some might even affect qmail in some way.

Re:Announcing Notqmail by geocar on Wednesday August 21, 2019 @02:30AM (#20754977)
Road warriors with Thunderbird may need SMTP authentication, but most people do relaying with just IP authentication just fine.
Re:Announcing Notqmail by pilif on Wednesday August 21, 2019 @02:43AM (#20755019)
Aside of the fact that I doubt your "most people" assertion here, it's beside the point that I was trying to make which is that a CVE affecting a feature of Postfix that qmail doesn't have to begin with is not a fair mark against postfix.

Because if you disable a feature you don't use, you won't be affected by the vulnerability.

If you use smtp authentication, you're not running djb's code and all advantages of djb's code are moot. If you don't use smtp authentication then that CVE is inconsequential and you can't count it as a black mark against Postfix with regards to the security of your specific setup.

Re:Announcing Notqmail by geocar on Wednesday August 21, 2019 @05:30AM (#20755717)
> it's beside the point that I was trying to make which is that a CVE affecting a feature of Postfix that qmail doesn't have to begin with is not a fair mark against postfix.

I disagree. It is a fair mark against postfix if (as I claim) most users really don't need it.

Here's my reasoning to that point:

I think most email end-users either use their ISPs mail settings (who know who they are and don't need authentication), or webmail (which doesn't use SMTP for relaying anyway), or outlook (which doesn't need SMTP at all). Fastmail is becoming more popular and it doesn't need SMTP either. The end-users who remain are either business users (who could use a VPN which is better than SMTP AUTH in every way), and nutters with vanity domains.

If that's contended, and note I do believe there are probably end users who are actually still manually entering SMTP AUTH settings into email clients, but I would struggle to believe they're the majority and would need evidence.

Meanwhile on the enterprise, pretty much every machine in every enterprise environment I've ever worked in has been set up for local relay. Again, if you think they're all using SMTP AUTH I'd need to see evidence.

> If you use smtp authentication, you're not running djb's code and all advantages of djb's code are moot

Do you actually believe that if you apt-get install postfix that you don't have any of the advantages of postfix's development processes?

I'm not sure I can engage with that. It's like saying running linux invalidates "all advantages of djb's code" simply because you're (sometimes) not running his code (e.g. when you're in a syscall). Madness runs down that way.

For what it's worth, most of the qmail smtpd patches I've seen to add SMTP AUTH (including the one I wrote nearly twenty years ago) are sensible, integrate well with the rest of qmail. You might not get djb's warrantee, but I can't believe you gain nothing by starting from a solid foundation.

Re:Announcing Notqmail by pilif on Wednesday August 21, 2019 @05:42AM (#20755765)
>I disagree. It is a fair mark against postfix if (as I claim) most users really don't need it.

if they don't need it, they won't be affected by that vulnerability because it won't be active.

>Meanwhile on the enterprise, pretty much every machine in every enterprise environment I've ever worked in has been set up for local relay.

In every enterprise setup I have seen, local relay was still protected using SMTP-AUTH for accounting purposes.

Plus in case of end-users, many ISPs still provide SMTP for mail delivery, all of whom need to support SMTP auth. That includes Fastmail and Gmail.

>but I can't believe you gain nothing by starting from a solid foundation.

Of course you do. But saying "Postfix is worse because it had a security vulnerability in a component that qmail doesn't even support" is unfair to postfix.

If you are running qmail with a custom patch then that custom patch will for sure have been exposed to less scrutiny than Postfix proper. It's not valid to extend the scrutiny given to vanilla qmail to all of the custom patches.

Re:Announcing Notqmail by geocar on Wednesday August 21, 2019 @08:21AM (#20756609)
> saying "Postfix is worse because it had a security vulnerability in a component that qmail doesn't even support" is unfair to postfix.

Ok, well that's your opinion, and hopefully now you at least know why I have mine.

I can't imagine forgiving Microsoft for all those AD/SMB and explorer CVE just because Linux doesn't support those things, but it's not really that important to me.

> In every enterprise setup I have seen, local relay was still protected using SMTP-AUTH for accounting purposes.

I have no idea what you mean by "accounting purposes" -- it sounds like you're talking about users relaying and not machines relaying.

There is no way you'd get a SOC2 (or SSAE/SOC1) if you used SMTP auth to protect local relays, so perhaps we are talking about different things when we say "enterprise".

> If you are running qmail with a custom patch then that custom patch will for sure have been exposed to less scrutiny than Postfix proper.

I'm still not sure you can have it both ways. Why is it when Debian patches postfix that it's still (in your mind) "postfix proper" but when I download a well-distributed and discussed patch from a mailing list, and read it myself, that you somehow think I'm at higher risk?

Re:Announcing Notqmail by pilif on Wednesday August 21, 2019 @09:22AM (#20756880)
>it sounds like you're talking about users relaying and not machines relaying

there is such a thing as machine- or even application-specific accounts that can be terminated or their credentials rotated.

Even better; you could use something like Vault (https://www.vaultproject.io/) to manage such application-specific credentials.

All of this is much better than relying on IP addresses never changing and never being reused.

>Why is it when Debian patches postfix that it's still (in your mind) "postfix proper" but when I download a well-distributed and discussed patch from a mailing list, and read it myself, that you somehow think I'm at higher risk?

I never said it was postfix proper. It really isn't.

Debian is known to f'up the security of its packages. But it's my hope that distributors have a better equipped security team and bigger exposure compared to some guy putting a patch on some website.

Debian also has a proper security update process that makes sure that patches go out to users quickly and painlessly. And because Debian is big enough, it's usually included in embargoed security vulnerability reports, so usually a patch will be out and sometimes even deployed by the time the vulnerability is known.

But the relative security of Debian-maintained postfix vs. Debian-maintained custom-patched qmail is the same as postfix proper vs custom-patched qmail.

However, vanilla whatever, in my opinion is superior to custom-patched whatever. And while postfix is usable vanilla, qmail isn't. It was bordering unusable back in the 90ies and it definitely is unusable nowadays.

qmail doesn't support TLS, it doesn't support spf, much less domainkeys or dmarc. It doesn't (as we're talking about) support SMTP auth, it doesn't support ipv6. It doesn't support any other common anti spam measures like greylisting or rbl checks, nor does it support a plugin system that would allow for easy plugging them in.

Heck, it doesn't even support rejecting mail at SMTP time so it's one of the worst offenders for backscatter which is one of the big annoyances for mail admins.

At this point, an unpatched qmail is as useful in fulfilling MTA roles as a closed port 25 is (which would totally be safer than both qmail and postfix)

Hence my assertion that everybody is running a patched qmail and none of these patches ever enjoyed the same scrutiny as even the security abominations that are sendmail and exim.

And worse: None of these patches were ever reviewed for side-effects of arbitrarily combining them.

Nearly every custom patch was made against a vanilla qmail because there is no central project to manage these patches. So every site runs a different version of qmail, none of them vetted at all for security.

This is a mess and we should really discourage this rather than dreaming of long-gone times where vanilla qmail at least was useful to a minor degree.

Partially-related update: I just looked at the qmail code: This thing is written in K&R style C and sometimes uses single-character variable and function names. I would argue nobody but djb can actually safely make changes to this code-base. This is all from a bygone age. Let it rest.

Re:Announcing Notqmail by schmonz on Wednesday August 21, 2019 @12:31PM (#20758835)
Sorry, we think it's rested plenty long enough :-)

You've given some excellent examples of how qmail got this way, and what notqmail needs to change to be viable. I have my own running-in-production solutions to most of them -- for instance, https://schmonz.com/qmail/rejectutils for SMTP recipient rejection and https://schmonz.com/qmail/acceptutils for user-facing AUTH and TLS.

These may or may not become part of notqmail. But we believe that together we can carefully and safely evolve notqmail to meet modern needs.

Re:Announcing Notqmail by LargoLasskhyfv on Thursday August 22, 2019 @12:16AM (#20764581)
Diversity is good!
Re:Announcing Notqmail by rodgerd on Wednesday August 21, 2019 @05:58AM (#20755857)
If you think an IP address is a reliable identifier, your opinions on security have no value.
Re:Announcing Notqmail by amdavidson on Wednesday August 21, 2019 @07:47AM (#20756402)
While you and I agree that Parent is incorrect, let's not resort to personal attacks.
Re:Announcing Notqmail by sigil on Wednesday August 21, 2019 @02:47AM (#20755030)
> You don't find that vulnerability in qmail because qmail doesn't have that feature.

But being selective about what features to add is itself a valid strategy for writing secure software — perhaps even the most effective one!

Re:Announcing Notqmail by pilif on Wednesday August 21, 2019 @04:56AM (#20755563)
I agree. But if the software is lacking essential features so that everybody patches them back in it's a very ineffective strategy because anybody's home-grown patches are worse than properly maintained features.

I can put a machine on the net with a closed port 25. That's the most minimal implementation of an MTA and it's entirely secure. Guaranteed.

The thing is that qmail was severely lacking features back in the 90ies and it has received zero feature additions by its original author since then, so it's safe to assume that it's now lacking even more features to the point where anybody running qmail these days is nearly guaranteed to be running franken-qmail full of third-party patches which are surely less well maintained than proper Postfix.

That was my point.

Re:Announcing Notqmail by yellow_postit on Wednesday August 21, 2019 @01:03AM (#20754692)
Just a count of CVE, while interesting, I think misses calibrating by how much attention each has gotten. Given its popularity I'd assume much more security research and testing on postfix.
Re:Announcing Notqmail by schmonz on Tuesday August 20, 2019 @07:18PM (#20753235)
Hey dude! Been a little while. Hope you’re well.

If we were starting from scratch, I’d be first to say let’s pick something safer than C. But we’re starting from where DJB left off, so there’s not much left to decide about language. Our roadmap aims to provide mostly Unix-process extension points such that new code can be written in any language.

Postfix is great, and I certainly hold Viktor in high regard (haven’t met Wietse). It’s just that some of us really like qmail. :-)

Re:Announcing Notqmail by cryptonector on Wednesday August 21, 2019 @01:14PM (#20759179)
Hey! I'd not noticed you were involved. EDIT: Where are my manners. Hope you're well too!

So, yeah, qmail is fine as a starting base, but there are important things that a modern MTA/MSA needs to have:

  - MSAs need to support user authentication in
    SUBMIT (no open relays)
  - MTAs and MSAs need to support TLS
  - MTAs should -really, need to- support DANE
    for authenticating SMTP servers
There's more stuff too (delivery options, filtering, ...), but protocol-wise, the above are critical.

I'm not sure that portability is such a problem that you can't use Rust. Rust runs on all modern OSes, which is all you need to support in a new MTA/MSA. And Rust is fairly easy to get into, actually.

Re:Announcing Notqmail by schmonz on Wednesday August 21, 2019 @05:33PM (#20762071)
Vanilla qmail was never an open relay unless you really intended to configure it as one. It's just that the only relay controls were IP-based. Back in the day, before AUTH was widely supported, I used a really nice "relay-ctrl" add-on from Bruce Guenter for POP-before-SMTP.

For mandatory user-facing TLS and AUTH on port 587, and opportunistic server-to-server TLS on port 25, I've written https://schmonz.com/qmail/acceptutils. For SMTP recipient checks, I've written https://schmonz.com/qmail/rejectutils. It's too soon to say how notqmail will solve these problems, but they're solvable and we intend to solve them. For DANE... definitely not there yet.

Re:Announcing Notqmail by schmonz on Wednesday August 21, 2019 @05:35PM (#20762095)
P.S. On the acceptutils page, check out the POP3 hole I found :-)
Re:Announcing Notqmail by xvilka on Tuesday August 20, 2019 @10:38PM (#20754145)
Yes, Rust is a perfect fit for such a project.
Re:Announcing Notqmail by tptacek on Wednesday August 21, 2019 @12:28AM (#20754568)
Not that I disagree, but to inject some clarity: Python would be a perfect fit too. The major MTAs are written in C not because they need to be, but because C was the only serious option in the mid-late 1990s. Any modern language would work.
Re:Announcing Notqmail by atq2119 on Wednesday August 21, 2019 @01:07AM (#20754702)
If all you care about it is memory safety, sure.

If you also care about performance, I'd be skeptical of such claims.

Re:Announcing Notqmail by vidarh on Wednesday August 21, 2019 @07:56AM (#20756457)
I used to run Qmail on a system that handled ~2m users. The main limitation was IO capacity. Today the M.2 NVMe SSD in my laptop can do substantially faster IO than the rack sized storage array we used for that mail system.

If you're building a competitor for Gmail or Hotmail, then maybe that performance difference will matter. For almost everyone else it's largely irrelevant.

EDIT: I'm confused by the downvotes for this. If someone has practical experience that suggests that performance is a real concern for this type of use, I'd love to hear about it. For my part I built and ran such a system for a couple of years, and spent a lot of time looking at the performance constraints. CPU usage just was not a factor even on ~20 year old (by now) hardware, running on 4-5 machines where the beefiest one had either 2 or 4 cores. All our optimization efforts consistently went on trading increased CPU usage for reducing IO use, because that is where the bottlenecks were. That's been reinforced with other mail systems I've run over the years, including large scale mail processing with PHP (not my choice) - every such system I've seen have been IO constrained rather than CPU constrained.

Re:Announcing Notqmail by stevekemp on Wednesday August 21, 2019 @04:27AM (#20755415)
A few years back I ran `qpsmtpd` which is a flexible mailserver written in Perl. It was extremely easy to hack upon, so you could write plugins for SMTP-time spam-detection, rejection, etc.

These days the project is stalled, I think most of the development moved over to a nodejs based project.

Anyway the project was pretty simple to work with, and scaled wonderfully:

http://smtpd.github.io/qpsmtpd/

Re:Announcing Notqmail by cryptonector on Wednesday August 21, 2019 @12:08PM (#20758604)
It's not just memory-safety, but type-safety.
Re:Announcing Notqmail by pilif on Wednesday August 21, 2019 @01:14AM (#20754728)
for all sites memory safety trumps performance.

For most sites, performance is a total non-issue for providing the feature-set that qmail provided.

And if you are a site that processes enough email for performance to start becoming an issue, you're probably better off with a custom solution that's tailored to your specific issues

Re:Announcing Notqmail by gypsyharlot on Wednesday August 21, 2019 @05:17AM (#20755653)
Re:Announcing Notqmail by stonogo on Tuesday August 20, 2019 @07:18PM (#20753234)
Postfix cannot do what qmail can do. Specifically, users can create and destroy email addresses themselves with .qmail files. This is different and more powerful than Google's plus-addressing approach. There are many, many other features of qmail's implementation that Postfix cannot compete with.

Postfix is not alone in this; no other MTA/MDA can do what qmail can do.

Re:Announcing Notqmail by pmoriarty on Tuesday August 20, 2019 @08:09PM (#20753506)
It would be really useful to have an exhaustive list of all these things that qmail can do that other MTA's can't.
Re:Announcing Notqmail by pilif on Wednesday August 21, 2019 @01:15AM (#20754730)
it would be a very small list.

However, the exhaustive list of things other MTAs can do that qmail can't would be huge (starting with backscatter-proof bounces for example)

qmail was limited back in the 90ies and it's horribly behind the times now.

Re:Announcing Notqmail by amaccuish on Tuesday August 20, 2019 @08:22PM (#20753585)
I've got a similar thing with my postfix setup though. My users can go to their account portal and apply for an alias, which when approved (to avoid taking of important names like postmaster etc.) is added to their otherMailboxes LDAP attribute. They can delete the alias themselves when they're done with it.

I'm tempted to start auto-allowing new aliases and just having a list of names that can't be used (postmaster, webmaster) etc, that some services use for domain ownership verification.

As an aside I do hope qmail offers similar limiting abilities. It wouldn't be great if a user could make themselves receive [email protected] emails!

Re:Announcing Notqmail by schmonz on Tuesday August 20, 2019 @09:11PM (#20753815)
They can’t, unless qmail has been configured to know they control mail for domain.tld. The admin configuration mechanism for this (control/virtualdomains) is simple and powerful.
Re:Announcing Notqmail by amaccuish on Wednesday August 21, 2019 @05:25AM (#20755680)
Sorry I'm confused. If your mail server is setup for control of a domain (e.g. domain.tld), then what stops someone from putting [email protected] in this .qmail file?
Re:Announcing Notqmail by schmonz on Wednesday August 21, 2019 @09:50AM (#20757107)
People can put whatever they want in their own .qmail files. That doesn't affect anything unless qmail believes those .qmail files are relevant to what it's delivering. A user controls .qmail files for a domain if and only if an admin has configured qmail to delegate that domain to that user.
Re:Announcing Notqmail by amaccuish on Thursday August 22, 2019 @05:09AM (#20766082)
Ahh I see. So it's a per domain thing, and you can't restrict more granularly. That's a shame.
Re:Announcing Notqmail by schmonz on Friday August 23, 2019 @11:10AM (#20778415)
I haven't experienced a need for more granular restrictions. Can you give an example of a problem it would solve?
Re:Announcing Notqmail by Tepix on Wednesday August 21, 2019 @03:20AM (#20755150)
The standard postfix setup these days uses a DB backend and users can edit the database to create new email addresses and aliases.
Re:Announcing Notqmail by peterwwillis on Tuesday August 20, 2019 @08:05PM (#20753487)
This reads a bit like if you posted that you were going to restore your Camaro Z28 with modern parts, and someone replied, "Why not a Corvette?"
Re:Announcing Notqmail by gypsyharlot on Wednesday August 21, 2019 @05:17AM (#20755655)
Re:Announcing Notqmail by cryptonector on Wednesday August 21, 2019 @12:13PM (#20758667)
I think that blog is wrong.

Rust is not a magical language. It's just got the right features to be a C replacement, which is mostly: a simple type system (much simpler than C++'s or Java's) that has the right extensibility (traits, no inheritance) and can have an ABI that programmers can reason about due to monomorphization (no v-table dispatch).

All the borrow checker stuff amounts to: just enough pain that to avoid it you must design better APIs.

Re:Announcing Notqmail by schmonz on Wednesday August 21, 2019 @12:24PM (#20758767)
Yep, after reading the post I'm not any less impressed by (or interested in) Rust. If the post's claim were "Wait until Rust changes more slowly before investing more heavily in it," I might be able to agree.

For a project like notqmail, I would worry about portability. qmail runs on a lot of platforms and getting Rust bootstrapped is a bear.

Re:Announcing Notqmail by cryptonector on Wednesday August 21, 2019 @01:30PM (#20759325)
For any new MTA/MSA you don't need to run on old HP-UX systems. You can elect to only run on systems that support Rust, which is to say: all the modern OSes.
Re:Announcing Notqmail by schmonz on Wednesday August 21, 2019 @06:14PM (#20762465)
You wanna write a new MTA from scratch? Me neither :-p
Re:Announcing Notqmail by cryptonector on Wednesday August 21, 2019 @07:08PM (#20762892)
Eh, maybe. With Rust it's plausible to rebuild piece by piece.