Hi,


you told us that the name of Server a is fqn.abc.tld, but you configured 
SOGoSMTPServer = "smtp://abc.tld"; instead of SOGoSMTPServer = 
"smtp://fqn.abc.tld"; leading to the error in the log saying Could not connect 
to the SMTP server smtp://abc.tld:587/?tls=YES



The SOGoXXXXServer variables have to contain something that can be found in 
DNS or IP addresses (something like SOGoSMTPServer = "smtp://192.168.178.14";)



Bye, Peter



Von: [email protected] <[email protected]> Im Auftrag von "Marina D."
Gesendet: Mittwoch, 13. Januar 2021 15:43
An: [email protected]
Betreff: [SOGo] Need help with external SMTP-server



Hello,



for  a few days now I have been fiddling around with a SOGo-Server (selfhosted 
nightly-build, version 5, updated daily at the moment) and so far I managed to 
get almost everything up and running.

But there is one big issue I'd be very glad if anyone could give me a hint 
what is wrong here.



The problem in short: I cannot send Mails to external recipients.



This is the basic setup:



The Mailserver with Dovecot and Postfix is on Server A, running for several 
years now and I don't want to change the way things are on here too much. This 
server has several the domains on it, among them abcd.tld and the Server-FQDN 
is fqn.abc.tld



The new server B on which SOGo has been installed is a fresh VServer using 
Debian 10, LetsEncrypt-Certificate for accessing the webfrontend and it uses 
the nightly-builds. I followed the official installation guide and set up a 
SOGo-Instance using Postgresql 11 for users authentification. The view within 
my database with the names, passwords matching the mail-passwords and so on 
exists and I can login successfully. I can see the Folders, read mails, create 
appointments and so on.

This Server B on which SOGo is installed has received its own subdomain so 
it's reachable at sogo.abcd.tld.



Long description of the problem:

My problem is that I cannot send mails to addresses outside of my own 
domain-range. Meaning: I can send Emails with SOGos Webfrontend to any 
email-address @abcd.tld or any other domain hosted on the server "A".

On this server A with postfix and dovecot there are several vhost-domains, for 
example domain1.tld. As it resides on the same server as abc.tld I am able to 
send a mail from address [email protected] <mailto:[email protected]>  to 
[email protected] <mailto:[email protected]>  when using SOGo's webfrontend. 
But using the Webfrontend I cannot send an email to external services like 
[email protected] <mailto:[email protected]>  or anything like that.

Using a classic Mail-App like thunderbird on my desktop pc which connects to 
the emailserver on fqn.abc.tld directly works perfect and there are no 
restrictions to send emails in any kind like mentioned above.





When I try to send mails from SOGo's Webfrontend I get these possible errors 
depending on the config in /etc/sogo/sogo.conf:



First case:

more or less vanilla config setting as few ports as possible:



/etc/sogo/sogo.conf:



  /* Mail */
  SOGoDraftsFolderName = INBOX.Drafts;
  SOGoSentFolderName = INBOX.Sent;
  SOGoTrashFolderName = INBOX.Trash;
  SOGoJunkFolderName = INBOX.Spam;
  SOGoIMAPServer = "imap://abc.tld";
  SOGoSieveServer = "sieve://abc.tld:4190";
  SOGoSMTPServer = "smtp://abc.tld";
  SOGoMailingMechanism = smtp;
  SOGoForceExternalLoginWithEmail = YES;
  //... standard-settings untouched

  SOGoUserSources =

    (
      {
        type = sql;
        id = directory;
        viewURL = 
"postgresql://sogo:[email protected]:5432/sogo/sogo_view";
        canAuthenticate = YES;
        isAddressBook = YES;
        userPasswordAlgorithm = md5;
      }
    );

  /* Web Interface */
  SOGoPageTitle = MeinTestSOGo;
  SOGoVacationEnabled = YES;
  //SOGoForwardEnabled = YES;
  SOGoSieveScriptsEnabled = YES;
  SOGoMailAuxiliaryUserAccountsEnabled = YES;
  //SOGoTrustProxyAuthentication = NO;
  //SOGoXSRFValidationEnabled = YES;



  //... more untouched stuff

   /* Debug */
  SOGoDebugRequests = YES;
  SoDebugBaseURL = YES;
  ImapDebugEnabled = YES;
  //LDAPDebugEnabled = YES;
  //PGDebugEnabled = YES;
  //MySQL4DebugEnabled = YES;
  //SOGoUIxDebugEnabled = YES;
  //WODontZipResponse = YES;
  WOLogFile = /var/log/sogo/sogo.log;




In this scenario I can send with sogo to all emailboxes hosted on Server A. As 
soon as I try to send a mail to a mailbox hosted by anyone else (gmail, yahoo, 
...), I get a 5.7.1 relay denied message from the recipient's server (eg. 
gmail or yahoo) in my mail-browserwindow and the log in /var/log/sogo.log 
says:



Jan 13 12:26:04 sogod [27233]: |SOGo| starting method 'POST' on uri 
'/SOGo/so/orange/Mail/0/folderINBOX/folderDrafts/newDraft1610537152-1/send'
Jan 13 12:26:05 sogod [27233]: [WARN] <0x0x55f51340a7c0[SOGoUserDefaults]> 
expected an NSString for 'SOGoMailComposeFontSize' (ignored)
Jan 13 12:26:05 sogod [27233]: [ERROR] <0x0x55f513552a50[SOGoMailer]> Could 
not connect to the SMTP server smtp://abc.tld
Jan 13 12:26:05 sogod [27233]: |SOGo| request took 0.666737 seconds to execute




I mean, why do I get a relay-denied-error from the recipient's server?! Why 
does sogo try to send via google or yahoo or whoever, I want to send via my 
smtp-server defined in sogo.conf - this gives me a headache.



Second Case:

Keeping everything the same but changing the smtp-line in sogo.conf to



SOGoSMTPServer = "smtp://abc.tld:587/?tls=YES";



results in  an errormessage in the browser-window saying:

Requires state 2, now 1



and in the log I find:



Jan 13 12:36:31 sogod [29373]: |SOGo| starting method 'POST' on uri 
'/SOGo/so/orange/Mail/0/folderINBOX/folderDrafts/newDraft1610537787-1/send'
Jan 13 12:36:31 sogod [29373]: [WARN] <0x0x5562213901e0[SOGoUserDefaults]> 
expected an NSString for 'SOGoMailComposeFontSize' (ignored)
2021-01-13 12:36:31.750 sogod[29373:29373] ERROR(-[NGActiveSSLSocket 
startTLS]): couldn't setup SSL connection on host abc.tld 
(error:00000001:lib(0):func(0):reason(1))...
2021-01-13 12:36:31.750 sogod[29373:29373] SMTP: unable to perform STARTTLS on 
socket
Jan 13 12:36:31 sogod [29373]: [ERROR] <0x0x5562213bdf60[SOGoMailer]> Could 
not connect to the SMTP server smtp://abc.tld:587/?tls=YES
Jan 13 12:36:31 sogod [29373]: |SOGo| request took 0.566150 seconds to execute






Third case:



Changing the smtp-line to



SOGoSMTPServer = "smtp://abc.tld:465";



results in endless waiting until proxytimeout occurs in the frontend, the log 
says:

Jan 13 14:13:10 sogod [2141]: |SOGo| starting method 'POST' on uri 
'/SOGo/so/orange/Mail/0/folderINBOX/folderDrafts/newDraft1610543582-1/send'
Jan 13 14:13:10 sogod [2141]: [WARN] <0x0x55d5782cf990[SOGoUserDefaults]> 
expected an NSString for 'SOGoMailComposeFontSize' (ignored)
Jan 13 14:14:10 sogod [2118]: [WARN] <0x0x55d577e61b80[WOWatchDogChild]> pid 
2141 has been hanging in the same request for 1 minutes
Jan 13 14:15:10 sogod [2118]: [WARN] <0x0x55d577e61b80[WOWatchDogChild]> pid 
2141 has been hanging in the same request for 2 minutes
Jan 13 14:16:10 sogod [2118]: [WARN] <0x0x55d577e61b80[WOWatchDogChild]> pid 
2141 has been hanging in the same request for 3 minutes
Jan 13 14:17:10 sogod [2118]: [WARN] <0x0x55d577e61b80[WOWatchDogChild]> pid 
2141 has been hanging in the same request for 4 minutes
Jan 13 14:18:10 sogod [2118]: [WARN] <0x0x55d577e61b80[WOWatchDogChild]> pid 
2141 has been hanging in the same request for 5 minutes
2021-01-13 14:18:11.243 sogod[2141:2141] SMTP: reply has invalid format 
((null))
Jan 13 14:18:11 sogod [2141]: [ERROR] <0x0x55d57809eb50[SOGoMailer]> Could not 
connect to the SMTP server smtp://abc.tld:465
Jan 13 14:18:11 sogod [2141]: |SOGo| request took 300.957260 seconds to 
execute
Jan 13 14:18:11 sogod [2141]: [ERROR] <0x0x55d57823ba30[WOHttpTransaction]> 
client disconnected during delivery of response for 
<WORequest[0x0x55d5780bd200]: method=POST 
uri=/SOGo/so/orange/Mail/0/folderINBOX/folderDrafts/newDraft1610543582-1/send 
app=SOGo rqKey=so 
rqPath=orange/Mail/0/folderINBOX/folderDrafts/newDraft1610543582-1/send> 
(len=61): the socket was shutdown








I already tested if the mailserver A is reachable by SOGo on B via openssl for 
Port 587 and also 465 and it works on both ports. I can connect and 
authenticate, these problems shouldn't be there.



What am I missing? Any help is appreciated.



Regards & thx in advance,

Marina

-- 
[email protected] <mailto:[email protected]>
https://inverse.ca/sogo/lists

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to