"Error: message file too big" Is the limit on outgoing or receiving end? [closed] - mail-server

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
A client is trying to send a rather large email but it gets bounced back with the following message:
Hi. This is the qmail-send program at server2.hysir.net.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
<maria#laeknastodin.is>:
157.157.98.19 failed after I sent the message.
Remote host said: 552 5.3.4 Error: message file too big
I've checked and there is no limit on outgoing mail size on our end and this ip address i.e 157.157.98.19 is the ip for the receiving mail server, am I right to assume the mail server for laeknastodin.is is denying the mail due to its size rather than our smtp refusing to send?

Remote host said: 552 5.3.4 Error: message file too big
The error message clearly states that receiving host is limiting the message size. If you check with telnet you can see that the limit configured on the target host is 20 MB (20480000 bytes)
telnet 157.157.98.19 25
Trying 157.157.98.19...
Connected to 157.157.98.19.
Escape character is '^]'.
220 mail.laeknastodin.is ESMTP Postfix
EHLO example.com
250-mail.laeknastodin.is
250-PIPELINING
250-SIZE 20480000 <----------- 20 MB limit
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

Related

Error when trying to send mail over smtp with Office 365 account

An application, which obviously uses Chilkat plugin, does not correctly send E-mails anymore using an Office 365 account. After a migration from on-premise exchange to Microsoft 365, the account and server settings were changed at end of March this year. Furthermore, client authentication needed to be disabled for the mailbox. After that, sending E-mails from the application had worked. Now, it again doesn't. Yesterday, one E-mail could successfully be sent after a computer restart - the next ones failed again.
I'm stuck to find the cause of the error and also I don't know, what data exactly is sent from the application during the connection, which makes the analysis more difficult.
I found this post mentioning that entries for TLS 1.0 need to be in the registry. Those were missing, but there were entries for TLS 1.2, so I didn't assume this is an issue, espccially because the entries concerning cryptography (also mentioned in the post) did already exist. In the meantime, I have added them nonetheless.
Below is the Chilkat Log, showing that - after the server is ready - the clientHandshake2 fails with error code 0x2746.
The support person of the application he couldn't find any problem and asked concerning that error code - what i assumed he should be able to examine. When I talked to him on the phone, I found out that he doesn't know more about Chilkat than I do. He mentioned an interesting point, which need to be double checked: As far as he was informed from the user directly - or how he had understood it - the error doesn't show up, if the user chooses another "Mandant" (client) in the application and sends E-mails from there.
Can someone help identify the cause of the error?
SendEmail:
DllDate: May 25 2017
ChilkatVersion: 9.5.0.68
UnlockPrefix: WERNERMAILQ
Architecture: Little Endian; 32-bit
Language: Visual C++ 2017 (32-bit)
VerboseLogging: 0
sendEmailInner:
renderToMime:
createEmailForSending:
Auto-generating Message-ID
--createEmailForSending
renderToMime: Elapsed time: 0 millisec
--renderToMime
sendMimeInner:
ensureSmtpSession:
ensureSmtpConnection:
SmtpHost: smtp.office365.com
SmtpPort: 587
SmtpUsername: edith.beer#halten.ch
SmtpSsl: 0
StartTLS: 1
smtpConnect:
smtpHostname: smtp.office365.com
smtpPort: 587
connectionIsReady:
Need new SMTP connection
--connectionIsReady
smtpSocketConnect:
socketOptions:
SO_SNDBUF: 262144
SO_RCVBUF: 4194304
TCP_NODELAY: 1
SO_KEEPALIVE: 1
--socketOptions
--smtpSocketConnect
smtpGreeting:
readSmtpResponse:
SmtpCmdResp: 220 AM0PR02CA0163.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 23 Aug 2021 11:51:12 +0000
--readSmtpResponse
--smtpGreeting
startTLS:
sendCmdToSmtp:
SmtpCmdSent: EHLO EWGH-N-FV<CRLF>
--sendCmdToSmtp
readSmtpResponse:
SmtpCmdResp: 250-AM0PR02CA0163.outlook.office365.com Hello [213.221.219.37]
SmtpCmdResp: 250-SIZE 157286400
SmtpCmdResp: 250-PIPELINING
SmtpCmdResp: 250-DSN
SmtpCmdResp: 250-ENHANCEDSTATUSCODES
SmtpCmdResp: 250-STARTTLS
SmtpCmdResp: 250-8BITMIME
SmtpCmdResp: 250-BINARYMIME
SmtpCmdResp: 250-CHUNKING
SmtpCmdResp: 250 SMTPUTF8
--readSmtpResponse
sendCmdToSmtp:
SmtpCmdSent: STARTTLS<CRLF>
--sendCmdToSmtp
readSmtpResponse:
SmtpCmdResp: 220 2.0.0 SMTP server ready
--readSmtpResponse
clientHandshake:
clientHandshake2:
readHandshakeMessages:
WindowsError: Eine vorhandene Verbindung wurde vom Remotehost geschlossen.
WindowsErrorCode: 0x2746
maxToReceive: 5
Failed to receive data on the TCP socket
Failed to read beginning of SSL/TLS record.
b: 0
dbSize: 0
nReadNBytes: 0
idleTimeoutMs: 30000
--readHandshakeMessages
--clientHandshake2
--clientHandshake
Client handshake failed. (1)
connectionClosed: 0
Failed to establish TLS connection.
--startTLS
--smtpConnect
--ensureSmtpConnection
--ensureSmtpSession
--sendMimeInner
--sendEmailInner
Failed.
--SendEmail
--ChilkatLog
23.08.2021 13:48:27 -F- Beim Versand der Lohnabrechnung per Email an Mitarbeiter(in) Nadine Aeschlimann ist ein Fehler aufgetreten!
You are using an old version of Chilkat. Try testing with the latest version.
In the meantime we could solve it.
The reason was that the outgoing requests were blocked by the firewall. Strangely, a few of them went through, but not all. This is the reason why a network issue was initially not in the focus of our investigation.

exim Timing Out to Gmail

I have a Centos server with exim installed. I am trying to send en email from the command line like this:
exim -v account#gmail.com
From: email#mydomain.com
To: account#gmail.com
Subject: test email
this is a test
^D
I have also tried:
echo 'test message' | mail -s Test1 account#gmail.com
as well as sending from a PHP script.
The result is the email times out. The logs indicate exim is timing out:
H=alt2.gmail-smtp-in.l.google.com [173.194.219.26] Connection timed out
I believe iptables are correct. I have scanned the server from an external IP and ports 25, 265 and 587 are open. (Not sure 587 needs to be since this will be a send-only situation most likely.)
I have also telnet'd to port 25 successfully. (Most of the successful resolutions I have found involved port 25 being blocked. I don't think that is the case here. I have also called my provider and checked. They claim port 25 connections are not blocked.)
I would appreciate some ideas.
Thank you.

Connecting to Gmail SMTP via socket returns different responses per server

I am trying to understand why opening a socket to Gmail's server via SSL provides different responses for different servers. This is stopping me from connecting to Gmail for sending out emails.
Below is a very simple script:
<?php
$smtp_connect = fsockopen('ssl://smtp.googlemail.com', 465,
$errno,
$errstr,
300);
var_dump(fgets($smtp_connect, 512));
?>
On server 1 [no ssl cert installed], the output of the above code is: string(57) "220 smtp.googlemail.com ESMTP s89sm726209qkl.44 - gsmtp
"
On server 2 [ssl cert installed], the output of the above code is: string(71) "220-mycompany.pro.com ESMTP Exim 4.87 #1 Wed, 26 Oct 2016 07:42:49 -0400
"
Can anyone explain why this happens, and how can I make server 2 have the same behavior as server 1?
Update: I have also tried smtp.gmail.com, the output is same as using smtp.googlemail.com.
The line you get the the SMTP welcome message. It is perfectly normal that different servers give a different welcome message. It is even normal that the response to commands you send is different. This means that when communicating with an SMTP server you should not assume fixed strings as response but implement proper parsing of SMTP. See the SMTP standard (RFC 2821) for details about this protocol.

Telnet SMTP send mail timeout

I want to use telnet to send an e-mail with SMTP. It seemed that I had connect to the mail service successfully. And the message had been put in the queue too. But why did the SMTP service failed to send the message to the received address?
When I searched the solution by the internet, someone had said that firewall should paid it. But I have no idea about the relationship between the firewall or antivirus software and telnet.
This is my command:
220 smtp-5-124.smtpsmail.fmail.xd.sinanode.com ESMTP
helo a
250 smtp-5-124.smtpsmail.fmail.xd.sinanode.com
auth login
334 VXNlcd5hbWU6
a25vd215aGV2341241fasYS5jbg==
334 UGFzczdvcmQ6
UmF5V2adfa23adsfZzgyNA==
235 OK Authenticated
mail from: <knowmyheart#sina.cn>
502 unimplemented (#5.5.1)
mail from:<knowmyheart#sina.cn>
553 Envolope sender mismatch with login user..
mail from:<knowmyheart#sina.cn>
250 ok
rcpt to:<517447201#qq.com>
250 ok
data
354 End data with <CR><LF>.<CR><LF>
subject: test
to:<517447201#qq.com>
from:<knowmyheart#sina.cn>
Testttttttttttttt!
.
250 ok queue id 6744281442287
451 Timeout.
By the way, I tried it both on Windows 10 and Ubuntu-15.10. And both of them failed with the same question.
Finally, I found where I was wrong.
In my previous case,I failed to send a e-mail with the above code.I had succeeded in connecting with the SMTP server, and everything worked except the "Timeout" response. Actually, the "Timeout" didn't mean I failed to send a e-mail but lose the TCP connection. Hours Later, I login my e-mail, which was used for sending, finding that I receive a mail. The mail told me the e-mail I sent hours before with telnet was given back, failing to post. So it meant that the reason was hardly because of my telnet client, but in server or something else.
Finally, I found that it was because of my mail format. In my previous code, after I sending keyword -- "data", I immediately send the content.
data
354 End data with <CR><LF>.<CR><LF>
subject: test
to:<517447201#qq.com>
from:<knowmyheart#sina.cn>
Testttttttttttttt!
.
250 ok queue id 6744281442287
When I changed it to this, it worked.
data
354 End data with <CR><LF>.<CR><LF>
subject: test
to:<517447201#qq.com>
from:<knowmyheart#sina.cn>
Testttttttttttttt!
.
250 ok queue id 6744281442287
Notice that the difference between the codes is the empty line before the content in this mail. "subject", "to" and "from" are the headers. Between the header and the content, there must be an empty line.
Similarly, the headers in mail can be ignored. The code is like this:
data
354 End data with <CR><LF>.<CR><LF>
Testttttttttttttt!
.
250 ok queue id 6744281442287
451 Timeout.
Even if there is a "Timeout", it affect nothing but break the tcp connection between localhost and smtp server.

Wireshark RST against TCP Zero Window

During application sharing with Microsoft Lync Client (Mac OS X), TCP ACK with RST flag is sent from my application end to Lync end against TCP Zero Window packets and call gets dropped.
FYI:
My Application End: 172.16.6.106:55848
Lync End (Remote): 172.16.14.58:18627
Environment:
My Application End: Centos/Linux
Lync End: Mac OSX
Shared Over Wifi.
EDIT
Wireshark TCP Dump
Lync BYE message to my Application:
BYE sip:172.16.6.106:48038;transport=tls;ms-opaque=28c9d310c1;ms-received-cid=BEED00;grid SIP/2.0
ms-user-logon-data: RemoteUser
Via: SIP/2.0/TLS 172.16.6.252:5061;branch=z9hG4bKB5634D63.2E095CFF28141DF6;branched=FALSE;ms-internal-info="agIDti2ZsTK4cWfhAGG1qbj2usseveww7YKemPpN3Jvhv_XAkuuCofIQAA"
Max-Forwards: 67
Via: SIP/2.0/TLS 192.168.2.3:51217;branch=z9hG4bK77E14D58.4A2E43E7B13911D2;branched=FALSE;ms-received-port=51217;ms-received-cid=BEE600
Authentication-Info: NTLM qop="auth", opaque="4207B105", srand="D2C8703A", snum="21", rspauth="010000008bc2daa4dc3b08b864000000", targetname="Lync-FE.LTN2013-Dev.local", realm="SIP Communications Service", version=4
Via: SIP/2.0/TLS 192.168.2.4:50740;branch=z9hG4bKFF62C04C.B8AD61CF28131DF6;branched=FALSE;ms-received-port=50740;ms-received-cid=1117700
Via: SIP/2.0/TLS 172.16.14.58:30689;received=172.16.14.58;ms-received-port=57719;ms-received-cid=BEE400
From: "" <sip:test1#ltn2013-dev.net>;epid=48777ee2e9;tag=dd8ced12ab
To: <sip:ilanaroom#ltn2013-dev.net>;tag=1442263920;epid=14422639
Call-ID: RkdVRZrTUlhKLke0Et9MiVaJTOJd5UMJKljncCC1
CSeq: 1 BYE
User-Agent: UCCAPI/4.0.7323.0 MC/14.0.5093.11 (Microsoft Lync for Mac 2011)
ms-client-diagnostics: 34; reason="Call terminated on a mid-call media failure where both endpoints are remote";MediaDebug="Diag:LastError:time out,time:3651253182890;LastRTP Seq:30662,SeqDelta:1,time:3651253152751;LastRTCP time:3651253151390;Last transport receive error:0x0,time:0;Last transport send error:0x0,time:0;"
Content-Length: 0
The capture excerpt shown indicates that Lync is sending data to your Ap Ok but, for whatever reason, is unwilling to accept any data from your Ap (since the advertised window from 172.16.14.58 is 0).
One possibilityfor the RST from your Ap: your Ap has data to send to Lync but can't (since the win = 0) and eventually gives up.
Obviously, this doesn't help much other than to suggest that there's a problem with the Lync end. It's possible that examining a complete capture would provide more information.
For example: was the Ap previously able to send data ? What was the history of the window advertised by Lync ? and so on.
Update:
*Examining the capture you've posted a link to:
It looks quite normal (other than the zero-window stuff at the end).
Starting at about the 91 sec point, the Lync server stops accepting data (win=0), sends some short messages back to your client and then your client sends an RST to the server 30 secs after the server stops accepting data.
So: there's not really any info in the capture which indicates anything much about what's going on with the Lync server.
I do note that just before the win=0 from the server, the windows advertised by the server are smaller than the range advertised previously. (Note: I expect that the actual window size is larger than that seemingly advertised because there's a "window size scale factor" greater than 1 involved. Wireshark doesn't know the scale factor since the original TCP connection establishment handshake is not part of the capture).