Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Mutt (with compiled SMTP support) while sending a message can display the progress of the operation, but it only does that in the interactive mode. If one tries to run Mutt in the batch mode:

% mutt -s 'test #1' -a huge_file.tar.gz --
SSL connection using TLSv1/SSLv3 (RC4-MD5)

he will not see progress updates, which is inconvenient for sending very big files.

My question is: is there any SMTP command line client that have an ability to send message through GMail smtp server and display a progress bar (or something similar) to user?

Thanks in advance.

share|improve this question

I believe swaks is exactly what you're looking for.

share|improve this answer
It works with gmail but cannot display any decent progress bar. (-stl option is not very helpful.) – Alexander Gromnitsky Sep 18 '09 at 10:36
Came to this thread for a decent shell script for SMTP transaction. swaks fits the bill perfectly. Thanks! – Rajkumar S Apr 26 '12 at 14:27

after rereading the question and getting the essential part (which should be highlighted) i think i would do this (since i found no such solution in existing smtp-clients):

use the source of msmtp, in its 'smtp.c' there is 'smtp_send_mail()' where the actual sending happens. i would patch that file to print out how much of the mail is sent. maybe as an option, maybe to react on a signal (like 'kill -USR1 ') ...

share|improve this answer

I would set up Postfix as my local MTA with SASL enabled.

On an Ubuntu 9.04 example system, install the postfix, libsasl2-2 and ca-certificates packages. Create/modify the following Postfix config files.


biff = no
append_dot_mydomain = no
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
myhostname =
mydomain =
myorigin = $mydomain
smtpd_banner = $myhostname ESMTP $mail_name 
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination =, linuxbox, localhost.localdomain, localhost
relayhost = []:587
mynetworks =
inet_interfaces = loopback-only
mailbox_size_limit = 0
recipient_delimiter = +

All other values can be defaults, in fact many of these are, of note are the smtp_* at the beginning. Change the hostname and domain for your environment.


[]:587 gmail_username:gmail-password

Replace with whatever Google's SMTP server is and the gmail_username and gmail-password with the proper values.

Run postmap and restart postfix:

sudo postmap /etc/postfix/sasl_passwd
sudo /etc/init.d/postfix restart

Now when you send mail on your system, it will use Postfix as the local MTA and automatically authenticate with SASL.

share|improve this answer
Thanks for the answer, but my question was not how to setup MTA (I'm quite happy with sendmail+cyrus-sasl2). I just want a simple command line util that can send mail (without touching my MTA) in batch mode like mutt and display a sort of progress bar like wget. – Alexander Gromnitsky Aug 21 '09 at 5:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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