Skip to Content
IPv6 Network Administration
book

IPv6 Network Administration

by Niall Richard Murphy, David Malone
March 2005
Intermediate to advanced
308 pages
10h 32m
English
O'Reilly Media, Inc.
Content preview from IPv6 Network Administration

Case Study: MMDF

As a case study, we consider the changes made to a locally-maintained version of MMDF[2] by one of the authors to make it IPv6-capable. MMDF is a mail transfer agent (MTA), similar in purpose to Sendmail or Postfix. It interacts with the network in three ways.

  • To accept incoming mail by SMTP.

  • To send outgoing mail by SMTP.

  • To look up DNS records for the routing of mail.

These components of MMDF are relatively modularized—there is an SMTP channel daemon that runs from inetd for accepting mail, an SMTP channel program that sends mail by SMTP and a table system for looking up hosts in the DNS.

Incoming SMTP Channel

A server handling an incoming SMTP connection, must get the address of the remote machine so that it can be included in the Received: headers of the email. This address is obtained by calling getpeername, but the code must now expect a response containing an IPv4 or IPv6 address. We achieved this by using a sockaddr_storage rather than a sockaddr_in. MMDF's old code had a limit of 250 bytes for a hostname; we replaced this with the new constant NI_MAXHOST , which is the length of the longest hostname you will need to deal with.

The original MMDF code then called gethostbyaddr to try to convert the address into a hostname. We replaced this call with a getnameinfo call. For the SMTP header, we need to know if the address can be resolved to a hostname or not, so we can first call getnameinfo with the NI_NAMEREQD flag, to determine the hostname. To prevent spoofing ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Cisco Self-Study: Implementing IPv6 Networks (IPV6)

Cisco Self-Study: Implementing IPv6 Networks (IPV6)

Régis Desmeules
IPv6 Core Protocols Implementation

IPv6 Core Protocols Implementation

Qing Li, Tatuya Jinmei, Keiichi Shima
Security in an IPv6 Environment

Security in an IPv6 Environment

Daniel Minoli, Jake Kouns

Publisher Resources

ISBN: 0596009348Errata Page