1

I got a third-party application running on localhost trying to send mails with postfix via smtp on the same machine. The problem is that postfix seems to refuse mails to some recipients:

Content of /var/log/mail

Sep  1 00:05:35 myhost postfix/smtpd[20574]: connect from localhost[127.0.0.1]
Sep  1 00:05:35 myhost postfix/smtpd[20574]: B70E59A050: client=localhost[127.0.0.1]
Sep  1 00:05:35 myhost postfix/smtpd[20574]: lost connection after DATA (0 bytes) from localhost[127.0.0\
.1]

Meanwhile the sending application says:

cannot send mail to recipient@... please check connectivity

This error only happens with some recipients.

I checked my main.cf:

mynetworks = 127.0.0.1/32, 192.76.247.2/32, 192.76.247.3/32, 192.76.247.4/32
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination

Is there anything I missed? Or is there any other setting to restrict recipients?

Running postconf, mail_version = 2.9.4 on SLES11 SP3

Sending mails to the same domains using

echo "test" | mail -s "test" notworking@domain.com

works without problems.

TCP dump output

11  0.001483    127.0.0.1   127.0.0.1   SMTP    107 C: RCPT TO:myrec@domain.de>
12  0.002311    127.0.0.1   127.0.0.1   SMTP    80  S: 250 2.1.5 Ok
13  0.002485    127.0.0.1   127.0.0.1   SMTP    72  C: DATA
14  0.002555    127.0.0.1   127.0.0.1   SMTP    103 S: 354 End data with <CR><LF>.<CR><LF>
masegaloeh
  • 17,978
  • 9
  • 56
  • 104
ProfHase85
  • 451
  • 3
  • 6
  • 13
  • What domains are the non working emails going to? You sure they are formed correctly? – NickW Sep 02 '14 at 08:33
  • 1
    This doesn't look like it's postfix that rejects the message. Perhaps the sending application is not well-behaved and standards-compliant? Do you see a pattern on which recipients are failing? At what rate does the sending application push it's messages? Maybe it is just the client (sending application) that times out? Check that you haven't run out of resources on the server, such as file descriptors, disk space, inodes, and so on. – MattBianco Sep 02 '14 at 08:34
  • @NickW : I edited the post accordingly, it does not seem to be about domains – ProfHase85 Sep 02 '14 at 08:37
  • @MattBianco : I'm not quite sure about the sending application (It is not opensource so I cannot see what it is doing exactly) but it surely works with this application and other mail recipients (at the same time). The resources on the server are fine. – ProfHase85 Sep 02 '14 at 08:39
  • 3
    Look at the SMTP conversation. Do a capture (e.g. "tcpdump -i lo -w /tmp/smtpfail.pcap port 25"), then load it into wireshark and reconstruct the TCP stream (right-mouse --> "follow TCP stream") and post the conversation as ASCII. – Nils Toedtmann Sep 02 '14 at 08:51
  • You could try using `strace` (or possibly `tcpdump`) to try to see what's going on. Other things to try are the `anvil` related postfix parameters to see if you can get the client to fail more frequently. I still think the sending application is the one to blame. How many emails in what time frame is it sending? (at what rate) – MattBianco Sep 02 '14 at 08:52
  • Thanks @NilsToedtmann, I pasted the TCP dump. Do I get it right, the data is empty? – ProfHase85 Sep 02 '14 at 09:29
  • 3
    Yeah, that's the sending program's issue.. – NickW Sep 02 '14 at 09:30
  • 2
    This is your application's fault. Instead of sending the email message to postfix, it disconnects. – Michael Hampton Sep 02 '14 at 09:46
  • 1
    The tcpdump output might not show the complete SMTP handshake. To be sure, you should reconstruct the TCP stream e.g. with wireshark or tshark. Another oddity: The brackets don't match in "RCPT TO:myrec@domain.de>". Or was that your edit? From what i see so far, i second the others: looks like the client is screwing up. – Nils Toedtmann Sep 02 '14 at 11:18

1 Answers1

3

< bot >Summarize the comments to answer section< /bot >

Maillog entry

lost connection after DATA (0 bytes)

means that your client disconnect itself after postfix announce DATA in SMTP transaction.

In normal transaction, client would send the header and body of emails after DATA. Your client behavior was abnormal because it disconnect without send a single byte to postfix. Your tcpdump was confirmed this behavior.

masegaloeh
  • 17,978
  • 9
  • 56
  • 104