Results 1 to 5 of 5

Thread: Problem sending emails with mutt and sendmail

  1. #1
    Join Date
    Nov 2010
    Beans
    13

    Problem sending emails with mutt and sendmail

    I can send emails as root and when I go into mutt as root it connects to gmail's smtp servers but if I am a normal user (in this case Nagios) it does not connect to gmail's smtp server and will try to send it as nagios@sendemail@gmail.com instead of the sendmail@gmail.com account I have set up. Any help is greatly appreciated.

  2. #2
    Join Date
    Nov 2010
    Beans
    13

    Re: Problem sending emails with mutt and sendmail

    Tried using sudo hoping it would be a little work around but then it just does root@sendingemail@gmail.com. Really have no idea why it puts the user in front of the email but if anyone knows it should fix it I hope. It only does this for normal users and not root.

  3. #3
    Join Date
    Jul 2010
    Location
    Basingstoke
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Problem sending emails with mutt and sendmail

    I think you need to make sure that you have a ".muttrc" file inside your own profile. so if you login as yourself and copy the contents or root's ".muttrc" to your own.
    Code:
    touch ~/.muttrc ; sudo cat /root/.muttrc > ~/.muttrc
    the .muttrc should look something like this
    Code:
    set imap_user = "yourname@gmail.com"
    set imap_pass = "YOUR-PASSWORD"
     
    set smtp_url = "smtp://yourname@smtp.gmail.com:587/"
    set smtp_pass = "YOUR-PASSWORD"
    set from = "yourname@gmail.com"
    set realname = "Your Name"
     
    set folder = "imaps://imap.gmail.com:993"
    set spoolfile = "+INBOX"
    set postponed="+[Gmail]/Drafts"

  4. #4
    Join Date
    Jul 2010
    Location
    Basingstoke
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Problem sending emails with mutt and sendmail

    to send a test email. And "email-address@hotmail.com" needs to be a real email address
    Code:
    echo "Test" | mutt -s Hello email-address@hotmail.com

  5. #5
    Join Date
    Nov 2010
    Beans
    13

    Re: Problem sending emails with mutt and sendmail

    Quote Originally Posted by toekneewood View Post
    I think you need to make sure that you have a ".muttrc" file inside your own profile. so if you login as yourself and copy the contents or root's ".muttrc" to your own.
    Code:
    touch ~/.muttrc ; sudo cat /root/.muttrc > ~/.muttrc
    the .muttrc should look something like this
    Code:
    set imap_user = "yourname@gmail.com"
    set imap_pass = "YOUR-PASSWORD"
     
    set smtp_url = "smtp://yourname@smtp.gmail.com:587/"
    set smtp_pass = "YOUR-PASSWORD"
    set from = "yourname@gmail.com"
    set realname = "Your Name"
     
    set folder = "imaps://imap.gmail.com:993"
    set spoolfile = "+INBOX"
    set postponed="+[Gmail]/Drafts"
    Thanks. That got me being able to send the email as my user. Now I just have to get it working with nagios sending the notification which shouldn't be too difficult. Famous last words.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •