LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-09-2011, 07:15 AM   #1
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Rep: Reputation: 18
how to configure mutt mail client for mail server other that gmail


hello
I am trying to configure mutt to send email via command line . It works fine when I configure it for gmail as follows:
Quote:

# SENDING MAIL
set copy=yes
set smtp_url = "smtp://mymail@smtp.gmail.com:587/"
set smtp_pass = "PassWord"
set from = "mymail@gmail.com"
set realname = "RAAD"

# RECEIVING MAIL
set imap_user = "mymail@gmail.com"
set imap_pass = "PassWord"
set folder = "imaps://imap.gmail.com:993"
set spoolfile="imaps://imap.gmail.com/INBOX"
set postponed="imaps://imap.gmail.com/Drafts"
set record="imaps://imap.gmail.com/Sent"
set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates

set move = no
and when I use this command it works fine:

Quote:
echo "this is an email" | mutt -s "test Subject" mymail@yahoo.com
but when I change my mail server it returns an error.
this is my new config of .muttrc:
Quote:

# SENDING MAIL
set copy=yes
set smtp_url = "smtp://mymail@smtp.MyMailServer.com:587/"
set smtp_pass = "PassWord"
set from = "mymail@MyMailServer.com"
set realname = "RAAD"

# RECEIVING MAIL
set imap_user = "mymail@MyMailServer.com"
set imap_pass = "PassWord"
set folder = "imaps://imap.MyMailServer.com:993"
set spoolfile="imaps://imap.MyMailServer.com/INBOX"
set postponed="imaps://imap.MyMailServer.com/Drafts"
set record="imaps://imap.MyMailServer.com/Sent"
set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates

set move = no
it returns:
Quote:
echo "this is an email" | mutt -s "test Subject" mymail@yahoo.com
Could not find the host "smtp.MyMailServer.com"
Could not send the message.
with this configuration:
Quote:

# SENDING MAIL
set copy=yes
set smtp_url = "smtp://mymail@mail.MyMailServer.com/"
set smtp_pass = "PassWord"
set from = "mymail@MyMailServer.com"
set realname = "RAAD"

# RECEIVING MAIL
set imap_user = "mymail@MyMailServer.com"
set imap_pass = "PassWord"
set folder = "imaps://imap.MyMailServer.com:993"
set spoolfile="imaps://imap.MyMailServer.com/INBOX"
set postponed="imaps://imap.MyMailServer.com/Drafts"
set record="imaps://imap.MyMailServer.com/Sent"
set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates

set move = no
it returns:
Quote:
echo "this is an email" | mutt -s "test Subject" mymail@yahoo.com
Segmentation fault
and I have to say many people are using this server for their mail server and they are using outlook or other mail clients to send and receive email.
 
Old 01-09-2011, 09:50 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
You may try:
Code:
set smtp_url = "smtp://mymail@smtp.MyMailServer.com/:587/"
Regards
 
Old 01-10-2011, 12:13 AM   #3
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Original Poster
Rep: Reputation: 18
I did it:
Quote:

# SENDING MAIL
set copy=yes
set smtp_url = "smtp://mymail@smtp.MyMailServer.com/:587/"
set smtp_pass = "PassWord"
set from = "mymail@MyMailServer.com"
set realname = "RAAD"

# RECEIVING MAIL
set imap_user = "mymail@MyMailServer.com"
set imap_pass = "PassWord"
set folder = "imaps://imap.MyMailServer.com:993"
set spoolfile="imaps://imap.MyMailServer.com/INBOX"
set postponed="imaps://imap.MyMailServer.com/Drafts"
set record="imaps://imap.MyMailServer.com/Sent"
set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates

set move = no
but got this again:
Quote:
echo "this is an email" | mutt -s "test Subject" mymail@yahoo.com
Could not find the host "smtp.MyServer.com"
Could not send the message.
another thing that I checked is:
Quote:
host smtp.MyServer.com
Host smtp.MyServer.com not found: 3(NXDOMAIN)
then I used my server's IP address instead of name:
Quote:

# SENDING MAIL
set copy=yes
set smtp_url = "smtp://smtp@IPADDRESS:587/"
set smtp_pass = "PassWord"
set from = "mymail@MyMailServer.com"
set realname = "RAAD"

# RECEIVING MAIL
set imap_user = "mymail@MyMailServer.com"
set imap_pass = "PassWord"
set folder = "imaps://imap.MyMailServer.com:993"
set spoolfile="imaps://imap.MyMailServer.com/INBOX"
set postponed="imaps://imap.MyMailServer.com/Drafts"
set record="imaps://imap.MyMailServer.com/Sent"
set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates

set move = no
then:
Quote:
echo "this is an email" | mutt -s "test Subject" mymail@yahoo.com
Could not connect to IPADDRESS (Connection refused).
Could not send the message.
and I wanted to know even isn't any way to send email with mute without smtp configuration (I mean what can I use instead of smtp in .muttrc file).

Last edited by golden_boy615; 01-10-2011 at 01:08 AM.
 
Old 01-10-2011, 02:04 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
Are you sure that there is a mail server running on that IP address and it's listening on the submission port 587? Did you try to use the default smtp port (port 25)?

Instead of mutt you can try the mail command (A.K.A. mailx or nail depending on distro). In this case you can run:
Code:
env MAILRC=/dev/null from=sender@somedomain.com smtp=mail.domain.com \
                 smtp-auth-user=username smtp-auth-password=passwd smtp-auth=login \
                 mail -n -s "subject" recipient@otherdomain.com < content_file
(The 2nd line is needed only if the remote smtp needs authentication

If you don't want the mail client (mutt, mail), to connect directly to the remote smtp server, you can install a mail server (like sendmail, postfix etc) on your box and configure it to act as a client to the remote smtp server (add smtp-auth if needed). Usually, you can use your ISP's mail server as a smarthost.

Regards
 
1 members found this post helpful.
Old 01-11-2011, 12:20 AM   #5
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Original Poster
Rep: Reputation: 18
Quote:
Are you sure that there is a mail server running on that IP address and it's listening on the submission port 587?

how can I know that?
 
Old 01-11-2011, 12:52 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
Use telnet to try to connect to it:
Code:
telnet x.x.x.x 587
telnet x.x.x.x 25
and see if it responds
 
Old 01-12-2011, 03:27 AM   #7
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Original Poster
Rep: Reputation: 18
Hello
I did and I got this?

Quote:
[root@localhost ~]# telnet x.x.x.x 25
Trying x.x.x.x...
Connected to x.x.x.x.
Escape character is '^]'.
220-vitesse.nineservers.net ESMTP Exim 4.69 #1 Wed, 12 Jan 2011 04:23:49 -0500
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.


[root@localhost ~]# telnet x.x.x.x 587
Trying x.x.x.x...
Connected to x.x.x.x.
Escape character is '^]'.
220-vitesse.nineservers.net ESMTP Exim 4.69 #1 Wed, 12 Jan 2011 04:23:49 -0500
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.

so what does it means?
what should I do next?
 
Old 01-12-2011, 03:48 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
It means that you can connect to both ports 25 and 587, but I guess you need to authenticate in order to be able to use that smtp server.
What to do next? Try the mail command as in post #4, changing the options' values with yours
 
Old 01-12-2011, 04:41 AM   #9
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Original Poster
Rep: Reputation: 18
hello
I set my new configuration in .muttrc file like:

Quote:

# SENDING MAIL
set copy=yes
set smtp_url = "smtp://mymail@smtp.MySERVER.com:25/"
set smtp_pass = "Pass1234"
set from = "mymail@MySERVER.com"
set realname = "RAAD"

# RECEIVING MAIL
set imap_user = "mymail@MySERVER.com"
set imap_pass = "Pass1234"
set folder = "imaps://imap.MySERVER.com:993"
set spoolfile="imaps://imap.MySERVER.com/INBOX"
set postponed="imaps://imap.MySERVER.com/Drafts"
set record="imaps://imap.MySERVER.com/Sent"
set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates

set move = no
and start mutt command in debug level 5:
Quote:
root@solmate:~# echo this is a test email | mutt -d 5 -s "hello mutt" mymail@gmail.com
Debugging at level 5.
Segmentation fault
and got this in .muttdebug0:
Quote:
root@solmate:~# cat .muttdebug0
[2011-01-12 13:26:41] Mutt/1.5.20 (2009-06-14) debugging at level 5
[2011-01-12 13:26:41] Reading configuration file '/etc/Muttrc'.
[2011-01-12 13:26:41] parse_attach_list: ldata = 0x8116f90, *ldata = (nil)
[2011-01-12 13:26:41] parse_attach_list: added */.* [9]
[2011-01-12 13:26:41] parse_attach_list: ldata = 0x8116f94, *ldata = (nil)
[2011-01-12 13:26:41] parse_attach_list: added text/x-vcard [7]
[2011-01-12 13:26:41] parse_attach_list: added application/pgp.* [2]
[2011-01-12 13:26:41] parse_attach_list: ldata = 0x8116f94, *ldata = 0x83f5600
[2011-01-12 13:26:41] parse_attach_list: skipping text/x-vcard
[2011-01-12 13:26:41] parse_attach_list: skipping application/pgp.*
[2011-01-12 13:26:41] parse_attach_list: added application/x-pkcs7-.* [2]
[2011-01-12 13:26:41] parse_attach_list: ldata = 0x8116f98, *ldata = (nil)
[2011-01-12 13:26:41] parse_attach_list: added text/plain [7]
[2011-01-12 13:26:41] parse_attach_list: ldata = 0x8116f94, *ldata = 0x83f5600
[2011-01-12 13:26:41] parse_attach_list: skipping text/x-vcard
[2011-01-12 13:26:41] parse_attach_list: skipping application/pgp.*
[2011-01-12 13:26:41] parse_attach_list: skipping application/x-pkcs7-.*
[2011-01-12 13:26:41] parse_attach_list: added message/external-body [4]
[2011-01-12 13:26:41] parse_attach_list: ldata = 0x8116f9c, *ldata = (nil)
[2011-01-12 13:26:41] parse_attach_list: added message/external-body [4]
[2011-01-12 13:26:41] Reading configuration file '/usr/lib/mutt/source-muttrc.d|'.
[2011-01-12 13:26:41] Reading configuration file '/etc/Muttrc.d/charset.rc'.
[2011-01-12 13:26:41] Reading configuration file '/etc/Muttrc.d/colors.rc'.
[2011-01-12 13:26:41] Reading configuration file '/etc/Muttrc.d/compressed-folders.rc'.
[2011-01-12 13:26:41] Reading configuration file '/etc/Muttrc.d/gpg.rc'.
[2011-01-12 13:26:41] Reading configuration file '/etc/Muttrc.d/smime.rc'.
[2011-01-12 13:26:41] Reading configuration file '/root/.muttrc'.
[2011-01-12 13:26:41] Using default IMAP port 143
[2011-01-12 13:26:41] Using default IMAPS port 993
[2011-01-12 13:26:41] ../send.c:1213: mutt_mktemp returns "/tmp/mutt-solmate-0-29258-051e6d811754a0854".
[2011-01-12 13:26:41] ../send.c:987: mutt_mktemp returns "/tmp/mutt-solmate-0-29258-151e6d811754a0854".
[2011-01-12 13:26:41] mwoh: buf[Subject: hello mutt] is short enough
[2011-01-12 13:26:42] Connected to smtp.MyServer.com:25 on fd=4
[2011-01-12 13:26:44] 4< 220-vitesse.nineservers.net ESMTP Exim 4.69 #1 Wed, 12 Jan 2011 04:56:50 -0500
[2011-01-12 13:26:44] 4< 220-We do not authorize the use of this system to transport unsolicited,
[2011-01-12 13:26:44] 4< 220 and/or bulk e-mail.
[2011-01-12 13:26:44] 4> EHLO solmate
[2011-01-12 13:26:45] 4< 250-vitesse.nineservers.net Hello solmate [MyLocalIP]
[2011-01-12 13:26:45] 4< 250-SIZE 52428800
[2011-01-12 13:26:45] 4< 250-PIPELINING
[2011-01-12 13:26:45] 4< 250-AUTH PLAIN LOGIN
[2011-01-12 13:26:45] 4< 250-STARTTLS
[2011-01-12 13:26:45] 4< 250 HELP
[2011-01-12 13:26:45] 4> STARTTLS
[2011-01-12 13:26:45] 4< 220 TLS go ahead
what does it means?what should I do? please help.
 
Old 01-12-2011, 05:08 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
I cannot tell what does it means, because mutt segfaults before finishing the rest of the smtp negotiation.
Try any of the following variations:
Quote:
set smtp_url = "smtp://mymail@smtp.MySERVER.com"
set smtp_url = "smtp://mymail@smtp.MySERVER.com:25"
set smtp_url = "smtp://mymail@smtp.MySERVER.com/:25"
If it stills segfaults, I'd say you should fill-in a bug report, either to your distro's maintainer, or to the mutt developer
 
Old 01-14-2011, 09:06 AM   #11
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Original Poster
Rep: Reputation: 18
I think some thing wrong with my mail server what should I post for you to guide me?
 
Old 01-14-2011, 03:55 PM   #12
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
I don't think the problem is with your mail server, but rather it's mutt. I'm running the stock mutt-1.5.21 that comes with Slackware and it also segfaults if I use "set smtp_url = "smtp://mymail@smtp.MyMailServer.com:587/" (without the slash before :587).
To test your mail server you can run:
Code:
echo "This is a test" | mail -s "Test" user@domain.com
watch /var/log/maillog and check if you receive the email.
If it works you can try the alternative in post #4 to use mail instead of mutt.
Other than that, I suggest you once again to file a bug report.
 
Old 02-21-2011, 09:22 AM   #13
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Original Poster
Rep: Reputation: 18
Thanks but I don't think it has bug because mutt is one of most popular and powerful mail clients as I searched in google. any other suggestion or solution please...
 
Old 02-22-2011, 04:29 AM   #14
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
Hi,

I've already suggested you some muttrc variations you can try (post #10), or use mailx instead of mutt (post #4). Did you try any of them?
 
Old 02-28-2011, 07:34 AM   #15
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Original Poster
Rep: Reputation: 18
I did as you said :
Quote:
env MAILRC=/dev/null from=sender@somedomain.com smtp=mail.domain.com \
smtp-auth-user=username smtp-auth-password=passwd smtp-auth=login \
mail -n -s "subject" recipient@otherdomain.com < content_file
and got this:
Quote:
env MAILRC=/dev/null from=SENDER@gmail.com smtp=mail.gmail.com smtp-auth-user=SENDER smtp-auth-password=Pass smtp-auth=login mail -n -s "subject" receiver@gmail.com < file.txt
send-mail: Cannot open mail:25
Can't send mail: sendmail process failed with error code 1
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu server with postfix. My mail goes to Spam in Gmail and Yahoo Mail. Ideeas? bob808 Linux - Server 4 02-07-2009 04:11 PM
Mutt: Mail disappears when saved (gmail) exodist Linux - Software 2 12-07-2008 03:31 PM
A good mail client for Gmail? the3dfxdude Slackware 6 12-24-2007 04:20 AM
how to configure Linux mail client with existing mail server running on WindowsXP? Senthilvnr Linux - Networking 1 07-11-2006 12:02 AM
how to configure mail client to send mail out on different pppd threads vkrishn1 Linux - Newbie 0 12-29-2004 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration