How do I correctly configure exim4 on Debian so I can use `sendmail -t` to send mail via my office365 account?

591

I have restored my system's sendmail -t functionality:

Studying the section for /etc/exim4/passwd.client in man exim4_passwd_client led me to realize that just because my outgoing mail is sent via smtp.office365.com, listing that DNS name in passwd.client may not actually be sufficient... there's some reverse DNS lookup involved in the process. Doing ping smtp.office365.com actually gets responses from something called outlook.ms-acdc.office.com. So I updated my /etc/exim4/passwd.client file to contain a line

*.office.com:<myid@mydomain>:<mypassword>

and now everything is working again. (I note previously I did actually also have a line *.office365.com in the passwd.client file; my guess is that in early June something changed in MS' setup affecting whether exim4 thought it was connecting to an SMTP server under the office365.com or office.com domains).

Of course the question now is how long it'll be until Microsoft decide on yet another rebrand of the service formerly known as Hotmail and all the DNS names change again :^)

Update 2021-06-10: Over the last week, my sendmail using scripts seem to have become unreliable (not a complete failure; sometimes something gets through anyway). ping smtp.office365.com now gets responses from lhr-mvp.trafficmanager.net; adding a *.trafficmanager.net:<myid@mydomain>:<mypassword> line to the /etc/exim4/passwd.client file seems to have fixed the issue, I think. Apparently trafficmanager.net is part of Azure infrastructure; I guess Microsoft are migrating to that. Script-sent emails which worked may have been sent at times when the new configuration was rolled back for some reason.

Share:
591

Related videos on Youtube

Khalid
Author by

Khalid

Updated on September 18, 2022

Comments

  • Khalid
    Khalid almost 2 years

    My Code :

    var dbpath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "ot.db3");
    Context myContext = null;
    try
    {
          var dbcon = new SQLiteConnection(dbpath);
             var db=   dbcon.Query<records>("SELECT * FROM records WHERE sno = ? ", "1");
                int count = db.Count;
    }
    catch (IOException ex)
    {
        var reason = string.Format("The database failed to create - reason {0}", ex.Message);
        Toast.MakeText(myContext, reason, ToastLength.Long).Show();
    }
    
    1. I Create a Sqlite Database from my SQL Server Database.
    2. Now I save it to my Phone on this path (Android/Data/Application/File)
    3. Now using Sqlite-net-pcl nugget package for Sqlite Connection the connection works fine showing have no error.
    4. When I try to read a table from database this Give any error that "No Such Table exist in database". And the table exists in the database and is populated with data.

    5. What can I do?

    Thanks in advance

    • Rui F Ribeiro
      Rui F Ribeiro about 6 years
      If you are paying them and it stopped worked seemingly at random, why not opening a ticket with Microsoft?
    • wurtel
      wurtel about 6 years
      MAIL FROM:<> SIZE=3347: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail: that's the problem. You're sending mail as the empty user, and apparently Microsoft doesn't like that (anymore), which is stupid as it also means you'll never receive bounce messages. Either configure a dummy address (e.g. your own email address) to be used or complain to Microsoft, as Rui already suggested. Unfortunately I can't help right now with the exim config, as it's not really something that should be done. PS: are you sending to the MX for your domain?
    • timday
      timday about 6 years
      @wurtel: I do have "From: <myid@mydomain>" in the message piped to sendmail -t. Ah, but maybe that alone is not enough to trigger use of the authentication for <myid@mydomain> in /etc/exim4/passwd.client ? I will investigate along these lines further. (I send these script-generated emails to both myid@mydomain but also duplicate them to things like a gmail account and some other POP3 boxes on domains I hold. It makes no difference).
    • wurtel
      wurtel about 6 years
      A From: header is basically independent of the SMTP envelope sender.
  • Khalid
    Khalid almost 7 years
    var dbcon = new SQLiteAsyncConnection(dbpath); List<records> li = new List<records>(); dbcon.ExecuteAsync("Select * from records",li); Still the same result.
  • Khalid
    Khalid almost 7 years
    i have already sqlite database file. Here i want to retrive data from it. error:-> no such table: records
  • Sunny
    Sunny almost 7 years
    Try This IEnumerable<records> recordsList = (from i in dbcon.Table<Place>() select i).ToList();
  • Khalid
    Khalid almost 7 years
    it throw this exception : no such table: records