I have my smtp server -- smtp.drdb.com which is registered in DNS. I need to setup Mutt utility in my RHEL 6 server. Where should I input my smtp server details in mutt.rc file so that I can send mail. When I try to send mail from mutt, it goves me error Invalid URL - smtp.drdb.com
3 Answers
If you use a version of mutt that is compiled with SMTP support then mutt can send mail to another server via SMTP. Otherwise it will always use the local mail server.
To use it, you have to set the smtp_urlvariable.
smtp_url Type: string Default: “” Defines the SMTP smarthost where sent messages should relayed for delivery. This should take the form of an SMTP URL, e.g.: smtp[s]://[user[:pass]@]host[:port] where “[...]” denotes an optional part. Setting this variable overrides the value of the $sendmail variable. - Where would one find the
smtp_url- also the link is dead:( ?3kstc– 3kstc2019-02-21 22:15:20 +00:00Commented Feb 21, 2019 at 22:15
Just to complement the original answer - in order to set external SMTP server you need to add following line either to /etc/Muttrc (for system-wide configuration) or ~/.muttrc (for user configuration):
set smtp_url = "smtp[s]://[user[:pass]@]host[:port]" where host is your SMTP server, and as said in the original answer everything inside [] is optional...
- example:
set smtp_url = "smtp://gmailusername:[email protected]:587"red-o-alf– red-o-alf2022-10-19 16:20:17 +00:00Commented Oct 19, 2022 at 16:20
The actual sending of mail is traditionally delegated to an external program like sendmail, mutt does not connect to SMTP directly itself. If sendmail is too much for you, you can consider using something like msmtp for a simple delivery mechanism to an SMTP server, the actual SMTP server is then configured in a simple ~/.msmtprc configuration. Consult the documentation (man msmtp).
- 4Mutt is capable of connecting to an SMTP server. See
smtp_urlas described in another answer.jsbillings– jsbillings2015-09-26 12:19:37 +00:00Commented Sep 26, 2015 at 12:19