I am in the middle of setting up the internal email settings in order for a folder in a test Alfresco site to be able to receive email when addressed to the added alias (as directed in Inbound SMTP configuration properties | Alfresco Documentation and Configuring inbound email | Alfresco Documentation). But I can't get it to work. I think the issue is what I have the email.server.domain property set to. We use Office 365/Exchange Online for our email. I want to be able to have our internal fax server email received faxes to the aforementioned folder (alias of "receivedfaxes"). It is currently able to email them to a public folder in Office 365. My question is what should I set the email.server.domain property to? Should it be outlook.office365.com, pop.office365.com, smtp.office365.com, gracemg-com.mail.protection.outlook.com (used by our copiers to send emails) or something else? Do I need to do anything on our Office 365 or internal DNS setup? Are there any other settings I need to verify?
As the name of the property states, it is meant for a domain name - not a host name. "smtp.office365.com" would be a host name and "office365.com" would be the domain of that. The value of the property must be the domain that is going to be used in the address to target an email to the Alfresco server. So if you intend for the Alfresco server to receive emails addressed to "firstname.lastname@example.org" then the value would be "alfresco.gracemg.com" (your host name might be something completely different but can actually be identical).
The main issue here will be routing of emails from Office365 to the Alfresco server. I have worked with an Exchange based setup in the past which was setup to forward an email for a very specific mailbox to an Alfresco instance. In that case the specific mailbox "my-folder-name" on the primary domain "acme.com" (full address "email@example.com") was set up to relay to "firstname.lastname@example.org". This was needed since not all clients could send emails directly to an "alfresco.acme.com" address due to firewalls and external vs internal DNS configuration.
If you have control over the public-facing DNS configuration of your domain and the Alfresco system is accessible by the origin SMTP server you may not have to configure anything in Office365. You would have to create a MX resource record for the domain "alfresco.acme.com" specifying the mail server host name, which would be the host name of your Alfresco server which in turn should have an AAAA or A record.
I've gotten everything setup but I'm still not able to receive email in that folder. When sending from my Office 365 account it returns this error - Server at alfresco.gracemg.com (18.104.22.168) returned '450 4.4.316 Connection refused(Socket error code 10061)'. Sending a message from my Gmail account gives me this error - The response from the remote server was: The recipient server did not accept our requests to connect. [alfresco.gracemg.com. 22.214.171.124: timed out]. My settings in the global properties file are;
Ok - but you are at least getting a timeout error. Is there any firewall that may be active and prevent connection on port 25? Ideally Alfresco should not bind directly to port 25 (which is a privileged port) and instead a firewall rule (i.e. via iptables) should forward any connection from port 25 to a non-privileged port that Alfresco binds to.