SugarMailer can not send a email with a attachment

Hi greeting

i use helm to install suitecrm on my k8s cluster
i do the following test on suitecrm 7 and 8.
i can send email without attachment successfully
i can send email with small size of attachment successfully, 4KB
i can’t send email with attachment which size over 400KB
i use mailgun to provide smtp service for my suitecrm
i use gmail to test my mailgun smtp server , i can send email with attachment successfully, 13MB
i enable smtp full log , to see that happen, following is the key word

Sat Apr 15 20:11:44 2023 [121][381233cf-2cb0-c470-c5f3-6439a809ab53][DEBUG] smtp send: { 1: CLIENT -> SERVER: bmQucG86YS1kYXRlLWlzLWV4cGVjdGVkIiBzcmNsYW5nPSJlbi1VUyI+C
gkJCTx0dXYgeG1sOmxh^M }
Sat Apr 15 20:11:44 2023 [121][381233cf-2cb0-c470-c5f3-6439a809ab53][DEBUG] smtp send: { 1: CLIENT -> SERVER: bmc9ImVuLVVTIj4KCQkJCTxzZWc+YSBkYXRlIGlzIGV4cGVjdGVkPC9zZ
Wc+CgkJCTwvdHV2PgoJ^M }
Sat Apr 15 20:11:44 2023 [121][381233cf-2cb0-c470-c5f3-6439a809ab53][DEBUG] smtp send: { 1: CLIENT -> SERVER: CQk8dHV2IHhtbDpsYW5nPSJ6aC1DTiI+CgkJCQk8c2VnPumcgOeUqOaXp
eacnzwvc2VnPgoJCQk8^M }
Sat Apr 15 20:11:44 2023 [121][381233cf-2cb0-c470-c5f3-6439a809ab53][DEBUG] smtp send: { 3: Connection failed. Error #2: fwrite(): SSL: Connection reset by peer [/bitn
ami/suitecrm/vendor/phpmailer/phpmailer/src/SMTP.php line 1127] }
Sat Apr 15 20:11:44 2023 [121][381233cf-2cb0-c470-c5f3-6439a809ab53][DEBUG] smtp send: { 1: CLIENT -> SERVER: L3R1dj4KCQk8L3R1PgoJCTx0dSB0dWlkPSJ6YWJiaXgtbWFzdGVyOkxDX
01FU1NBR0VTL2Zyb250^M }
Sat Apr 15 20:11:44 2023 [121][381233cf-2cb0-c470-c5f3-6439a809ab53][DEBUG] smtp send: { 3: Connection failed. Error #2: fwrite(): SSL: Broken pipe [/bitnami/suitecrm/
vendor/phpmailer/phpmailer/src/SMTP.php line 1127] }

as you can see, attachment was uploading by SugarMailer, but the smtp connect was interrupt by some unknow reason, which the error occur on SMTP.php line 1127
i check SMTP.php , i but did not find out useful info, i m not a coder. not familiar to PHP.
i did not know if there any argument can be set , such smtp stream buffer , and smtp response timout to fix this issue.
i don’t know if this is the mailgun smtp server’s problem or suitecrm mailer’s problem.

please help me , i have google 3 days and try my best to fix this problem.

greeting

just add a 163.mail account to suitecrm , and send a email with a 1.3MB attachment successfully. so it might be a mailgun smtp response limit issue , but i have search all setting option on my mailgun , i haven’t seen any setting about this function. please guide me if you know how to do .

and the strange point is ,
i set my own email address to the FROM on gmail web . so that i can use my own email address as the sender on GMAIL
Gmail will use mailgun smtp server to send the email content , even with a attchment
and i am able to send the email with a attachment, 13MB.

i am confuse now , suitecrm or mailgun ?

hi guys
just do a test with swaks, commandline as following:

swaks --auth \
        --server mxb.mailgun.org \
        --au remove@domain1.com \
        --ap somepassword \
        --from remove@domain.com \
        --to receiver@domain2.com \
        --h-Subject: "Hello, this is a test email from swaks" \
        --body 'Testing some Mailgun awe' \
        --attach /home/user1/13MB.file

and the result of the test as following:

=== Trying mxb.mailgun.org:465...
=== Connected to mxb.mailgun.org.
=== TLS started with cipher TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128
=== TLS no local certificate set
=== TLS peer DN="/C=US/ST=Texas/L=San Antonio/O=MAILGUN TECHNOLOGIES, INC/CN=*.mailgun.org"
<~  220 Mailgun Influx ready
 ~> EHLO removed
<~  250-419fa5d055d6
<~  250-AUTH PLAIN LOGIN
<~  250-SIZE 52428800
<~  250-8BITMIME
<~  250-SMTPUTF8
<~  250-PIPELINING
<~  250 STARTTLS
 ~> AUTH LOGIN
<~  334 VXNlcm5hbWU6
 ~> dXNlcm5hbWU6Cg==
<~  334 UGFzc3dvcmQ6
 ~> YWNiZGtla3NkZnNmZQo=
<~  235 Authentication successful
 ~> MAIL FROM:<removed-user1@domain.com>
<~  250 Sender address accepted
 ~> RCPT TO:<removed-receiver@domain.com>
<~  250 Recipient address accepted
 ~> DATA
<~  354 Continue
 ~> Date: Sun, 16 Apr 2023 16:45:28 +0800
 ~> To: removed-receiver@domain.com
 ~> From: removed-user1@domain.com
 ~> Subject: Hello, this is a test email from swaks
 ~> Message-Id: <20230416164528.1298751@removed>
 ~> X-Mailer: swaks vDEVRELEASE jetmore.org/john/code/swaks/
 ~> MIME-Version: 1.0
 ~> Content-Type: multipart/mixed; boundary="----=_MIME_BOUNDARY_000_1298751"
 ~> 
 ~> ------=_MIME_BOUNDARY_000_1298751
 ~> Content-Type: text/plain
 ~> 
 ~> Testing some Mailgun awe
 ~> ------=_MIME_BOUNDARY_000_1298751
 ~> Content-Type: application/octet-stream; name="13MB.file"
 ~> Content-Description: 13MB.file
 ~> Content-Disposition: attachment; filename="13MB.file"
 ~> Content-Transfer-Encoding: BASE64
 ~> 
 ~> I0VYVE0zVQojRVhULVgtVkVSU0lPTjozCiNFWFQtWC1BTExPVy1DQUNIRTpZRVMKI0VYVC1YLVRB
 ~> UkdFVERVUkFUSU9OOjEwCiNFWFQtWC1NRURJQS1TRVFVRU5DRTowCiNFWFRJTkY6MTAuMDAwMDAw
 ~> LAozZjU1MjQ3NjAudHMKI0VYVElORjo5LjUyMDAwMCwKM2Y1NTI0NzYxLnRzCiNFWFRJTkY6Ni40
 ~> ODAwMDAsCjNmNTUyNDc2Mi50cwojRVhUSU5GOjkuMDQwMDAwLAozZjU1MjQ3NjMudHMKI0VYVElO
 ~> RjoxMC4wMDAwMDAsCjNmNTUyNDc2NC50cwojRVhUSU5GOjEwLjAwMDAwMCwKM2Y1NTI0NzY1LnRz
 ~> CiNFWFRJTkY6MTAuMDAwMDAwLAozZjU1MjQ3NjYudHMKI0VYVElORjoxMC4wMDAwMDAsCjNmNTUy
 ~> NDc2Ny50cwojRVhUSU5GOjEwLjAwMDAwMCwKM2Y1NTI0NzY4LnRzCiNFWFRJTkY6MT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cwojRVhU
 ~> SU5GOjEwLjAwMDAwMCwKM2Y1NTI0NzYxMDEudHMKI0VYVElORjoxMC4wMDAwMDAsCjNmNTUyNDc2
 ~> MTAyLnRzCiNFWFRJTkY6MTAuMDAwMDAwLAozZjU1MjQ3NjEwMy50cwojRVhUSU5GOjEwLjAwMDAw
 ~> MCwKM2Y1NTI0NzYxMDQudHMKI0VYVElORjoxMC4wMDAwMDAsCjNmNTUyNDc2MTA1LnRzCiNFWFRJ
 ~> TkY6OS43NjAwMDAsCjNmNTUyNDc2MTA2LnRzCiNFWFRJTkY6MTAuMDAwMDAwLAozZjU1MjQ3NjEw
 ~> Ny50cwojRVhUSU5GOjEwLjAwMDAwMCwKM2Y1NTI0NzYxMDgudHMKI0VYVElORjoxMC4wMDAwMDAs
 ~> CjNmNTUyNDc2MTA5LnRzCiNFWFRJTkY6MTAuMDAwMDAwLAozZjU1MjQ3NjExMC50cwojRVhUSU5G
 ~> OjkuMTIwMDAwLAozZjU1MjQ3NjExMS50cwojRVhUSU5GOjYuMDgwMDAwLAozZjU1MjQ3NjExMi50
 ~> cwojRVhUSU5GOjEwLjAwMDAwMCwKM2Y1NTI0NzYxMTMudHMKI0VYVElORjo2Ljg0MDAwMCwKM2Y1
 ~> NTI0NzYxMTQudHMKI0VYVElORjo4LjcyMDAwMCwKM2Y1NTI0NzYxMTUudHMKI0VYVElORjoxMC4w
 ~> MDAwMDAsCjNmNTUyNDc2MTE2LnRzCiNFWFRJTkY6MTAuMDAwMDAwLAozZjU1MjQ3NjExNy50cwoj
 ~> RVhUSU5GOjEwLjAwMDAwMCwKM2Y1NTI0NzYxMTgudHMKI0VYVElORjoyLjMyMDAwMCwKM2Y1NTI0
 ~> NzYxMTkudHMKI0VYVC1YLUVORExJU1QK
 ~> 
 ~> ------=_MIME_BOUNDARY_000_1298751--
 ~> 
 ~> 
 ~> .
<~  250 Great success
 ~> QUIT
<~  221 See you later. Yours truly, Mailgun
=== Connection closed with remote host.

so i think the problem happens on SugarPHPMailer.php.

This is very technical. Maybe you can search or ask in the Github of the underlying package:

hello guy
do some update, i have found out the root case, here is my topology of network

________ ......... ________|--->eth0 ->internet
|Server| -> |Router|
--------- .......--------- |--->eth1->VPN

and smtp.mailgun was routed to VPN interface, which not so stable, it interupt the smtp session.
my solution is , replace the Router with a higher perfermence machine or route smtp.mailgun.org to eth0.

but there is a another issue on SuiteCRM UI that effecting user experience. though my email with a large size of attachment can be send now, but it take a time, big file. and i monitor the suitecrm.log and confirm that.
but suiteCRM UI did not react with a correct result. the UI just keep circling , and User will not be able to realize that email has been sent.

i was think if there is any trigger buttom to make the web UI to wait a little long for the response from smtp server.

i have find out the root case, thank you , so have another issue now.

1 Like