Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

I have Postfix suite installed locally on Ubuntu 10.10. I can send/receive mail to my local address, e.g. user@local.com. I'm given credentials to a remote mail server mailbox, e.g. other@remote.com.

What command line incantation on my local box would connect me to SMTP server at remote.com providing username and password and send mail through it?

I've read sendmail and smtp manpages but that didn't give me any clue.

share|improve this question

You will need to have Postfix relay the messages to the remote server. This will require a change to the Postfix configuration. You'll need to enable Postfix's SASL authentication to handle the authentication. Once configured, you can use your local SMTP server as you did with local addresses, and the local server will relay them on the the remote server.

share|improve this answer
up vote 0 down vote accepted

Actually, Postfix turned out to be irrelevant to my problem. Using it would be an overkill for this task: it requires per-host configuration, where per-user would do.

I figured out msmtp is well enough for my task.

share|improve this answer

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.