On Wed, Jun 13, 2012 at 07:39:46PM +0200, Jan Stary wrote: > Through my smtpd, I am sending an email to an address > in the fjfi.cvut.cz domain. The email get delivered alright, > but the maillog message is strange: > > Jun 13 19:32:08 mini smtpd[7138]: 93fe4a4f: from=<r...@mini.stare.cz>, > size=427, nrcpts=1, proto=ESMTP, relay=0@localhost [IPv6:::1] > Jun 13 19:32:10 mini smtpd[6586]: 93fe4a4f700df332: > to=<jan.st...@fjfi.cvut.cz>, delay=2, relay=n003-000-000-000.static.ge.com > [147.32.9.3], stat=Sent (2.0.0 Ok: queued as CECD3C0083) > > $ host -t mx fjfi.cvut.cz. > fjfi.cvut.cz mail is handled by 70 brk1.fjfi.cvut.cz. > fjfi.cvut.cz mail is handled by 30 mailgw1.fjfi.cvut.cz. > fjfi.cvut.cz mail is handled by 50 mailgw2.fjfi.cvut.cz. > fjfi.cvut.cz mail is handled by 60 brk2.fjfi.cvut.cz. > > So smtpd correctly chooses the first priority MX, which is > > $ host mailgw1.fjfi.cvut.cz. > mailgw1.fjfi.cvut.cz has address 147.32.9.3 > > $ host 147.32.9.3 > 3.9.32.147.in-addr.arpa domain name pointer mailgw1.fjfi.cvut.cz. > > All the resolvers in my /etc/resolv.conf resolve > mailgw1.fjfi.cvut.cz. to 147.32.9.3 and back, as above. > > So how did "relay=n003-000-000-000.static.ge.com [147.32.9.3]" > get into the log? Am I missing something? > > Jan
That's an endianness issue. I thought I fixed that already... Can you try this? Eric. Index: sockaddr.c =================================================================== RCS file: /cvs/src/usr.sbin/smtpd/sockaddr.c,v retrieving revision 1.4 diff -u -p -u -r1.4 sockaddr.c --- sockaddr.c 16 May 2011 10:57:41 -0000 1.4 +++ sockaddr.c 13 Jun 2012 18:40:52 -0000 @@ -114,7 +114,7 @@ sockaddr_as_fqdn(const struct sockaddr * switch (sa->sa_family) { case AF_INET: - addr = ((const struct sockaddr_in *)sa)->sin_addr.s_addr; + addr = ntohl(((const struct sockaddr_in *)sa)->sin_addr.s_addr); snprintf(dst, max, "%d.%d.%d.%d.in-addr.arpa.", (addr >> 24) & 0xff,