Search code examples
emailsmtpfedora-23

Fedora 23: mail command not working


On Fedora 21, I had a simple script for sending emails

mail -a /tmp/attachment.txt -s "..." [email protected]

On Fedora 23, this no longer works.

No configuration file found at /home/mike/.esmtprc or /etc/esmtprc

I created the file and assigned correct permissions to it.

hostname = localhost.localdomain:25

(That's what Fedora 21 would send emails from: [email protected].)

Well, now I'm getting

SMTP server problem Connection refused

Question: how do I get the mail command to work on Fedora 23?


Solution

  • Okay, seems like Fedora 21 must have had an email server running by default, but Fedora 23 does not.

    In my

    ~/.esmtprc
    

    I had to add

    hostname = [SMTP SERVER THAT WORKS]:25
    mda "/usr/bin/procmail -d %T"
    

    And that worked. Thanks everyone anyway!