# Help with mailx [solved]

## at

I am trying to send an e-mail using mailx (mail-client/mailx-8.1.2.20050715-r1).

I know that I can send e-mails using KMail with the following settings:

```
Host: smtp.comcast.net

Port: 25

Server requires authentication

Login: crazy_j

Password: z123456

Encryption: TLS

Authentication method: plain
```

I have created the following ~/.mailrc file:

```
set from=crazy_j@joe.com

set smtp=smtp.comcast.net:25

set smtp-auth-user=crazy_j

set smtp-auth-password=z123456

set smtp-use-starttls

```

I also tried to add 'set smtp-auth=cram-md5', but that made no difference.

However, sending mail fails with the error message whose usefulness reminds the Windows world:

```
# mailx -v -s "Test 7" crazy_j@joe.com

Test 7

Cc:

[<-] 220 OMTA06.emeryville.ca.mail.comcast.net comcast ESMTP server ready

[->] EHLO Joe38

[<-] 250 OK

Can't send mail: sendmail process failed
```

/var/log/mail.info and /var/log/mail.log files:

```
Nov 18 21:22:34 Joe38 sSMTP[386940]: Creating SSL connection to host

Nov 18 21:22:35 Joe38 sSMTP[386940]: SSL connection using DHE-RSA-AES256-SHA
```

/var/log/mail.err file and syslog have no entries.

Would you have any suggestions?

Thank you!Last edited by at on Sun Dec 02, 2007 8:41 pm; edited 1 time in total

----------

## Bones McCracker

What are you using for an MTA (e.g., ssmtp, sendmail, exim, etc.) and how is it configured?

----------

## at

I thought mailx was MTA. But I do have ssmtp also installed.

/etc/ssmtp/ssmtp.conf:

```
mailhub=smtp.comcast.net:25

UseTLS=YES

AuthUser=crazy_j

AuthPass=z123456
```

----------

## Bones McCracker

I don't think mailx is a MTA;  I think it is a MUA only (a minimalist MUA mostly used in scripts).

I think the error message you were getting "sendmail process failed" is from mailx indicating it got a bad return code from the MTA.  Since you have ssmtp installed, this most likely means ssmtp is improperly configured (although it could be the port is blocked, server-side problem, etc.).

I haven't used ssmtp in a long time, but it has additional config files named something like 'aliases' and 'revaliases' that govern some basic header rewrites.  If you didn't set those up, that might be your problem.

There's a howto for ssmtp on the gentoo wiki.  If you haven't looked at it, you might want to check that out.  

http://gentoo-wiki.com/HOWTO_Gmail_and_sSMTP

There are a couple of threads in the forums addressing ssmtp configuration as well.  I seem to recall finding these more readily by googling "gentoo ssmtp" than by searching the forum directly.

Keep in mind there are other MTAs in the portage tree (under "mail-mta/"); ssmtp is the gentoo default because it's the bare minimum needed to send mail.  There are several minimalist ones (nbsmtp, msmtp, nullmailer, etc.); I use esmtp because its very minimal but lets me also send mail locally (when augmented by a local MDA like procmail or maildrop).  Or you may want to opt for a full-featured MTA: the old-school standard MTA is 'sendmail', good modern equivalents include exim, qmail, and others.

----------

## at

I have installed msmtp and it works beautifully.

Thank you!!!

----------

## charlesnadeau

 *BoneKracker wrote:*   

> There's a howto for ssmtp on the gentoo wiki.  If you haven't looked at it, you might want to check that out.  
> 
> http://gentoo-wiki.com/HOWTO_Gmail_and_sSMTP

 

Worked perfectly the first time: Wow!

Thanks!

Charles

----------

