Aw: [SOGo] Need help with external SMTP-server

2021-01-15 Thread "Marina D."
Thanks for the help! 


I dug deeper and found a solution. 

 



Gesendet: Mittwoch, 13. Januar 2021 um 16:50 Uhr
Von: "Nicolas Höft (nico...@hoeft.de)" 
An: users@sogo.nu
Betreff: Re: [SOGo] Need help with external SMTP-server


Hi Marina,

 

I am able to send a mail from address us...@abcd.tld to us...@domain1.tld when using SOGo's webfrontend. But using the Webfrontend I cannot send an email to external services like user.n...@gmail.com or anything like that. 
This sounds like a configuration problem on the postfix configuration. Is it handling incoming email differently when they come from the inside of your network?

 

 


No, the older server A is reachable from without, it's a normal Server rented from a hoster and located in a datacenter. Server A runs with debian and Plesk, Dovecot and Postfix for mail and has been accepting and sending mails using the integrated horde-webmail on the server as well as on a webmail-client on a different server connecting or via Android-Email-Apps or Thunderbird on local machines here. 


 






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.






Where do you see the relay denied error?


 

 


That error is shown within the popup-window in which a new mail is being written. When I hit the send-button, the window is overlayed in green and then turns orange, stating "Error 5.7.1. (insert mailserver of recipient) relay denied"

I investigated the logs in server A and there I found the reason: due to a missing SPF-record for server B server A denied sever B's attempts to log in. After I included the sogo-server's IP address in server A's SPF-Record everything worked! 

The email-server A runs on Ubuntu with Plesk Onyx and has SPF-checking enabled. After server B had been listed as "allowed to send" server A allowed connections to authenticate. I never thought so far that I'd have to propagate server B's IP/FDQN as it doesn't have a postfix-installation and doesn't send itself but authenticates at A to make A send. You never stop learning. 

Thanks a lot to all!

Regards, Marina 

 

 


 

-- users@sogo.nuhttps://inverse.ca/sogo/lists


AW: [SOGo] Need help with external SMTP-server

2021-01-13 Thread "Nagel, Peter"
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 SOGoServer 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: users-requ...@sogo.nu  Im Auftrag von "Marina D."
Gesendet: Mittwoch, 13. Januar 2021 15:43
An: users@sogo.nu
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 us...@abcd.tld   to 
us...@domain1.tld   when using SOGo's webfrontend. 
But using the Webfrontend I cannot send an email to external services like 
user.n...@gmail.com   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:sogopasswordi@127.0.0.1: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