Friday, November 8, 2013

Dovecot MTA

I've never really wanted to create my own MTA, because I like Postfix quite a lot. And I always thought it would require a horribly lot of time to be able to create something that was anywhere even close to having Postfix's features. (I would shudder to even think about recreating Dovecot from scratch nowadays.) But slowly over time I've also been thinking of ways how things could be done a bit better, and I think I have enough ideas to start thinking about Dovecot MTA more seriously in a few more months (after my current busy schedule calms down a bit). And (unlike Dovecot!) I'm not planning on taking over the world with the MTA (or at least not very quickly), but it would definitely be useful for many installations I know of.

My main design goals for the MTA are:
  • In normal load don't queue mails, just continue delivering the mail through different processes/services until it succeeds or fails, and only after that return ok/failure to the SMTP client. So there's no (forced) post-queue filtering, everything would normally happen pre-queue. This is required because in Germany (and EU in general?) you aren't allowed to just drop spams after SMTP server has responsed OK to the client, even if you’re 100% sure it’s a spam. So this would also mean that the SMTP DATA replies will come more slowly, which means that the SMTP server must be able to handle a lot more concurrent SMTP connections, which means that in large installations the smtpd process must be able to asynchronously handle multiple SMTP client connections.
  • In some cases you can't really avoid placing mails into a queue. This could be because of temporary failures or maybe because of an abnormal load spike. A mail queue in local disk isn't very nice though, because if the local disk dies, the queued mails are lost. Dovecot MTA will allow the queue to be in object storage and it will also likely support replication (similar to current dsync replication). In both of these cases if a server dies, another server can quickly take over its queue and continue handling it.
  • Dovecot MTA is a new product, which means we can add some requirements to how it's being used, especially related to securely sending emails between servers. It could do a bunch of checks at startup and fail to even start if everything isn't correct. Here are some things I had in mind - not sure if all of these are good ideas or not:
    • Require DKIM configuration. All outgoing mails will be DKIM signed.
    • Require the domain’s DNS to contain _submission._tcp SRV record (and actually might as well require _imap._tcp too)
    • Require SSL certificates to be configured and always allow remote to use STARTTLS
    • Require DANE TLSA record to exist and match the server's configured SSL cert
    • Have very good (and strict?) DNSSEC support. If we know a remote server is supposed to have valid DNSSEC entries, but doesn't, fail to deliver mail entirely?
    • Add a new DNS record that advertises this is a Dovecot MTA (or compatible). If such entry is found (especially when correctness is guaranteed by DNSSEC), the email sender can assume that certain features exist and work correctly. If they don't, it could indicate an attack and the mail sending should be retried later. This DNS record would of course be good to try to standardize.
  • Configuration: It would take years to implement all of the settings that Postfix has, but I think it's not going to be necessary. In fact I think the number of new settings to dovecot.conf that Dovecot MTA requires would be very minimal. Instead nearly all of the configuration could be done using Sieve scripts. We'd need to implement some new MTA-specific Sieve extensions and a few core features/configurations/databases that the scripts can use, but after that there wouldn't be really any limits to what could be done with them.
  • Try to implement as many existing interfaces as possible (e.g. Milter and various Postfix APIs like policy servers) so that it wouldn’t be necessary to reimplement all the tools and filters.
So perhaps something like this could be done in time for Dovecot v2.4. Any thoughts/ideas/suggestions?

29 comments:

  1. You have touched some pleasant factors here. Any way keep up writing. 바카라사이트

    ReplyDelete
  2. This is a very interesting article. Please, share more like this! Great blog! Thanks for the info, it is much appreciated. 바둑이게임

    ReplyDelete
  3. Nice one! thank you so much! Thank you for sharing this post. Your blog posts are more interesting and impressive. 바카라사이트

    ReplyDelete
  4. I simply couldn’t go away your web site before suggesting that I actually loved the standard info a person provide for your guests? Is gonna be again steadily to inspect new posts.
    토토
    경마사이트

    ReplyDelete
  5. Good post. I study one thing more difficult on totally different blogs everyday. It can all the time be stimulating to learn content from different writers and follow a bit one thing from their store.
    majortotosite
    racesite
    oncasinosite
    totopick

    ReplyDelete
  6. I would appreciate you that you pick up an important topic to write a thoroughly informative post on. I hope that you never stop and keep posting such valuable content 바카라사이트

    ReplyDelete
  7. MEGA GAME, try all slots for free credit. mega game

    The best online slots game PG SLOT direct website. https://pgslot-games.com/


    The best online slots game PG SLOT direct website. https://pgslot-games.co/

    ReplyDelete
  8. I would like to use the ability of saying thanks to you for this article here. I have usually enjoyed checking out this site. 온라인카지노

    ReplyDelete
  9. betflix Slots Auto Deposit-Withdrawal Financial System Safe, Accurate, Fast

    ReplyDelete
  10. It was very well authored and easy to understand. Thanks alot. ทางเข้าjoker

    ReplyDelete
  11. I don't usually comment, but I have to say thank you for this amazing post.

    토토
    안전놀이터
    우리카지노탑
    카지노사이트

    ReplyDelete
  12. Thanks For sharing such valuable information. 토토사이트

    ReplyDelete

  13. Thanks again for the post. Great blog. Cool.
    I like the helpful information you provide in your articles.
    스포츠토토365

    ReplyDelete
  14. I do agree with all of the ideas you’ve presented in your post.바카라사이트닷컴

    ReplyDelete
  15. It is extremely nice to see the greatest details presented in an easy and understanding manner. 카지노사이트넷

    ReplyDelete
  16. Thank you for nice information. Please visit our web: click here

    ReplyDelete
  17. Thank you for this excellent website. I am trying to read even more articles. Many thanks again! 카지노사이트

    ReplyDelete
  18. Thanks for Nice and Informative Post. This article is really contains lot more information about This Topic. 바카라사이트

    ReplyDelete
  19. vape modules from famous brands, they're all here.Long-term stable supply, holiday discounts, regular discount code issued.Augvape KitsArtery Nugget GT.
    vapeciga

    ReplyDelete
  20. I like the article you wrote very much, which has benefited me a lot. I have been very interested in electronic cigarettes recently. There is a very good store. This is its website:vapeciga.com. If you are interested, you can come in and browse and choose the products that suit you.

    ReplyDelete
  21. 토토사이트
    Really a great addition. I have read this marvelous post.

    ReplyDelete
  22. Thanks for Nice and Informative Post. This article is really contains lot more information nice web info for you 토토사이트

    ReplyDelete
  23. The evolution of the peppered moth is an example of natural .토토사이트

    ReplyDelete
  24. "It's really good to build up information knowledge. My hobby is web surfing. If I have a chance, I will visit you again. The website is really cool. But its necessary to click the link below

    토토사이트 파워볼분석
    스포츠토토 카지노사이트

    ReplyDelete
  25. It was wondering if I could use this write-up on my other website, I will link it back to your website though.

    바카라사이트

    ReplyDelete
  26. The post is written in very a good manner and it contains many useful information for me.

    카지노사이트

    ReplyDelete