Office 365 Ubuntu



Configure Postfix to use Office365 SMTP Relay on Ubuntu 18.04

In this post I’ll show how to install and configure Postfix on Ubuntu 16.04 to use Office 365 services like smarthost/mail relay.

In this post I’ll show how to install and configure Postfix on Ubuntu 16.04 to use Office 365 services like smarthost/mail relay. Apt-get upgrade apt-get update apt-get install postfix sasl2-bin mailutils. Sasl2-bin is an API thet implement Cyrus SASL API, and permit to integrate authentication mechanisms in Postfix. Microsoft Office is a commonly-used, proprietary office suite. Because the Microsoft Office suite is designed for Microsoft Windows, it cannot be installed directly onto a computer running Ubuntu. However, it is possible to install and run certain versions of Office using the WINE Windows-compatibility layer available in Ubuntu.

  1. Office 365 runs on my Ubuntu 18.04 via Firefox. Have 365 at work and can send & receive messages at home. Can also load & run Word & Excel at home. Not 100% functional but is doable.
  2. Microsoft Teams for Linux is your chat-centered workspace in Office 365. Instantly access all your team’s content from a single place where messages, files, people and tools live together. This is a preview version, so bear with us while we do some fine-tuning.
  3. In the search box on top left corner in office 365 SharePoint home page, type 'contentclass:STSSite' and search. It will give you list of all site collections you have access to. If you need to see all site collection + subsites, search for ' contentclass:STSSite OR contentclass:STSWeb'.

apt-get upgrade
apt-get update
apt-get install postfix sasl2-bin mailutils

sasl2-bin is an API thet implement Cyrus SASL API, and permit to integrate authentication mechanisms in Postfix
mailutils is a simple mail commands that will help testing our configuration.

During the Postfix configuration in request “General type of mail configuation” select “Internet Site”, and set your “System mail name” to use your FQDN (Fully Qualified Domain Name): in my case mailserver.infpressapochista.local
You can use the next command to obtain your FQDN.

hostname –fqdn
Now we need to define the credentials that will be used to establish the connection with Office 365 smtp server.
Create a file called sasl_passwd in /etc/postfix that contains the credentials: the username and password.

[smtp.office365.com]:587 usernameOffice365@domainOffice365.it:password
Att.: Replace usernameOffice365@domainOffice365.it and password with the appropriate credentials.
Postfix for some config files doesn’t use the flat ascii format, but uses a hash version of the same files that allows quicker lookup/retrieval.
This is one of them !

Download pirelli usb devices driver. postmap hash:/etc/postfix/sasl_passwd
This command create an hash version of sasl_passwd plain ascii file: in /etc/postfix you should see sasl_passwd and sasl_passwd.db in the list.

Using Office 365 smtp we can only send mail (FROM field in email header) as the user we are connecting with, or an another account specified in office365 (Send As permission).

For this reason we need to configure postfix to modify the from field for all the outgoing mail.
Create a file called sender_canonical in /etc/postfix.

nano /etc/postfix/sender_canonical
Here you can add the next line.

Office

/.+/ usernameOffice365@domainOffice365.it
Att.: Replace usernameOffice365@domainOffice365.it with the same account used in /etc/postfix/sasl_passwd or an another enabled account.
Create the hash version.

postmap hash:/etc/postfix/sender_canonical
For security purposes let’s make sure the owner of the files created above is the root user and the permissions are 644.

chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
chmod 644 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
chown root:root /etc/postfix/sender_canonical /etc/postfix/sender_canonical.db
chmod 644 /etc/postfix/sender_canonical /etc/postfix/sender_canonical.db
I prefer to use TLS to transmit mail.

cp /etc/ssl/certs/thawte_Primary_Root_CA.pem /etc/postfix/cacert.pem
Now we can configure Postfix to use this files. Edit /etc/postfix/main.cf and add/modify the following lines to our main.cf

….
inet_protocols = ipv4
relayhost = [smtp.office365.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = may
sender_canonical_maps = regexp:/etc/postfix/sender_canonical
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
….
Att.: The line inet_protocols = ipv4 force postfix to use only ipv4.

Restart Posfix.

service postfix restart
Now we can send a test message to see if everything worked. Create a file like /etc/postfix/mailtest.txt

to: emailto@domain.it
subject:Subject Test
Att.: Replace emailto@domain.it with the address you want to send your test to.

sendmail -v emailto@domanin.it < /etc/postfix/mailtest.txt Att.: Replace emailto@domain.it with the address you want to send your test to. If your test fails you can check the mail.log file to try and determine why.

tail – f /var/log/mail.log
Att.: After making changes be sure to restart Postfix before testing.
service postfix restart

Ref::

Microsoft Outlook is an communications platform from Microsoft that lets you connect and stay organized with your email, calendar, and contacts from a single application….

It allows teams and users to communicate and collaborate and, also integrates with Office 365…

For Linux users, the official Outlook app is not available. To get Outlook on Ubuntu and other Linux distributions, you’ll have to settle for a workaround app called Prospect Mail (an unofficial Outlook client for Linux)

prospect Mail is an unofficial Microsoft Outlook client for Linux using Electron… It uses the Web App and wraps it as a standalone application using Electron.

This brief tutorial shows students and new users how to install Outlook client desktop app on Ubuntu 16.04 | 18.04 desktops…

Microsoft Outlook brings users together to communicate and share so work can get done as quickly and efficiently as possible… Whether you’re a small or large enterprise, Outlook can help your team communicate and collaborate… and these conversations will be available on the desktop, mobile devices and everywhere you have Outlook installed…

For more about Prospect Mail, visit its homepage….

Some of the features you get with Prospect Mail:

  • Receive your Outlook OWA MS Office 365 online from the desktop app
  • Close to minimize
  • Dock tray support
  • System notification

When you’re ready to install Prospect Mail for Linux follow the steps below

Install Prospect Mail (Outlook Client) via Snap

Install Microsoft Office On Ubuntu

Prospect Mail (Outlook) can also be installed via Ubuntu snap package management… This might be the quickest way to install Prospect Mail. Snaps are applications packaged with all their dependencies to run on all popular Linux distributions from a single build. They update automatically and roll back gracefully…

To install via Snap, run the commands below

When you’re done, Prospect Mail should be installed and ready to use… To launch it, go to the Activities Overview and search Prospect Mail and launch it…

Install Office 365 University

When it opens, type in your Outlook’ email address and password to logon…

You can begin to send and receive email from your desktop without having to logon online…

If you’re a student or new user looking for a Linux system to start learning on, the easiest place to start is Ubuntu Linux OS…. It’s a great Linux operating system for beginners.

Ubuntu is an open source Linux operating systems that runs on desktops, laptops, server and other devices…

During your introduction to Ubuntu, you will find that Linux isn’t so different than Windows and other operating systems in so many ways, especially when it comes to using the system to get work done.…

Both Ubuntu and Windows systems allow you to be productive, easy to use, reliable and enable you to install and run thousands of programs, from gaming to productivity suite software for individuals and businesses.

Office 365 Ubuntu 19.04

That’s it!

Congratulations! You have successfully installed Prospect Mail for Linux on Ubuntu 16.04 | 18.04.

You may also like the post below: