I want to use command line mail client on the basic installation of Arch Linux, either mail or mutt or some other utility. I read that these are only mail clients means along with them we have to also install mail transfer agents. I tried to configure exim but that did not work out. Is there any other utility which can be easily configured and how to configure it ?

link|improve this question

57% accept rate
feedback

3 Answers

Postfix is quite easy to configure, especially for relaying through a "smarthost" (Gmail or ISP or whatever).


Configuring Postfix for Gmail:

  1. Update /etc/postfix/main.cf:

    relayhost = [smtp.gmail.com]:587
    smtp_tls_security_level = encrypt
    smtp_tls_CApath = /etc/ssl/certs
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options = noanonymous
    
  2. Create /etc/postfix/sasl_passwd:

    [smtp.gmail.com]:587     joe@gmail.com:JoesSekritPassword
    
  3. Run as root:

    postmap /etc/postfix/sasl_passwd
    chmod 640 /etc/postfix/sasl_passwd*
    chgrp postfix /etc/postfix/sasl_passwd*
    
  4. Tell Postfix to reload configuration:

    postfix reload
    

Exim is not bad either, as long as you ignore all the Debian-specific tutorials and their macros nonsense.

There also are msmtp and esmtp, which can only use a smarthost and so don't need to be run as a daemon. They also are much easier to configure, especially for multi-user environments.


If you are looking for the mail command, make sure you get either heirloom-mailx or GNU mailutils. (The classic bsd-mailx works, but it lacks many features such as Maildir or MIME support.) I still prefer mutt, though.

link|improve this answer
Could you provide me the link to configure PostFix for Gmail? – pineapple Jan 15 '11 at 18:28
@pineapple: See edited answer, or google postfix gmail. (Btw, it's "Postfix", not "PostFix.") – grawity Jan 15 '11 at 21:17
I configured the Postfix as you mentioned. But when I send mails using mutt or sendmail,they show no error but I am not receiving any mails in gmail. I want to know how to check the status of mail whether it was delivered or not. Also using sendmail, I sent mail like this: sendmail <id> and then typed the body and pressed Ctrl D. Is this the correct way? When using mutt, it says mail sent. But when I open mutt for the first time,it says /var/spool/mail/root:No such file or directory I want to confirm that I only want to configure postfix for outgoing mails.I don want to fetch mails from gmail. – pineapple Jan 16 '11 at 2:50
@pineapple: No, it's not the correct way to use sendmail -- it expects to be called from a mail client and given a full RFC-(2)822 message, incl. headers. You should use mail <addr> or mutt <addr> instead. // However, a good MTA will send the message anyway -- so please check the Postfix queue (mailq) and the system logs (sudo tail -f /var/log/mail.log) for any error messages. – grawity Jan 16 '11 at 11:21
@grawity See the suggested edit, please review if that's correct or requires any additional comment. – slhck Feb 28 at 11:34
show 1 more comment
feedback

I think Vmail is pretty good, although I don't believe we can shoot files around from within scripts... like my favorite trick of sending myself email notifications when a job is complete. But if you're just looking for a text-based front end for Gmail, this is it.

link|improve this answer
feedback

ssmtp is a very lightweight, easy-to-configure MTA.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.