[SOLVED] root@missing_domain

Discussion in 'Linux Beginners' started by Taxick, Mar 2, 2022.

Tags:
  1. Taxick

    Taxick Member

    Hi :)
    I have Linux beginner questions, that I hope you can help me fix...
    First some info:
    • I'm running a Ubuntu 20.04 server
    • I have installed SSMTP that relays to my mail mailgun ACC.
    • I have not installed Postfix - I only use SSMTP and mailgun
    The problem:
    When i got mails from ROOT, the sender mail is: "root@missing_domain"
    And because of the mail address, the mail goes to spam!
    So my question is. How can I change "missing_domain" to my domain???
    All places where you see "mydomain.dk" it not my real domain name!
    I hope you understand me!

    My SSMTP config (ssmtp.conf)
    Code:
    #
    # Config file for sSMTP sendmail
    #
    # The person who gets all mail for userids < 1000
    # Make this empty to disable rewriting.
    [email protected]
    
    # The place where the mail goes. The actual machine name is required no
    # MX records are consulted. Commonly mailhosts are named mail.domain.com
    mailhub=smtp.eu.mailgun.org:587
    
    # Where will the mail seem to come from?
    #rewriteDomain=
    
    # The full hostname
    hostname=mydomain.dk
    
    [email protected]
    AuthPass=MYPASSWORD
    UseTLS=YES
    UseSTARTTLS=YES
    rewriteDomain=mydomain.dk
    # Are users allowed to set their own From: address?
    # YES - Allow the user to specify their own From: address
    # NO - Use the system generated From: address
    FromLineOverride=YES
    SSMTP revaliases
    Code:
    # sSMTP aliases
    #
    # Format:       local_account:outgoing_address:mailhub
    #
    # Example: root:[email protected]:mailhub.your.domain[:port]
    # where [:port] is an optional port number that defaults to 25.
    
    root:[email protected]:smtp.eu.mailgun.org:587
    ghost-mgr:[email protected]:smtp.eu.mailgun.org:587
    Regards
    Thomas
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    My guess is
    Code:
    # Where will the mail seem to come from?
    #rewriteDomain=
    should be the senders domain. Read sSMTP docs to be sure what that setting means.
     
  3. Taxick

    Taxick Member

    "rewriteDomain=mydomain.dk" - Is already added -- Look at the config again
    But Thanks
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You are right. My bad, sorry.
     
  5. Taxick

    Taxick Member

    Anyone that can help me out here?

    EDIT: @Taleman NP :)
     
  6. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    try:
    FromLineOverride=No
     
  7. Taxick

    Taxick Member

    Hi @nhybgtvfr
    I can see when I use SSMTP it works fine
    If I run this command:
    Code:
    echo "Test Email message body" | mail -s "Email test subject" [email protected]
    I get the mail with the right receiver and from name/mail
    2.png

    But when the cronjob sents mail like this

    2022-03-04_19-56-22.png
    Did it make sense
    Regards
    Thomas
     
  8. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

  9. Taxick

    Taxick Member

    Hi
    Finally I got it to work :) - Thanks
     

Share This Page