# Problem sending mail w/ Mutt and Postfix

## Dralnu

I've switched over to postfix from esmtp, and since then I have not been able to send mail. The error I get is:

Error sending mail, child exited 1().

both for normal and root user (this error is generated when trying to email a user on localhost)

I havn't seen an error in any logs to help with this problem.

I may have screwed up the config somewhere, but does anyone have any clues as to why I would be having so many problems with this?

----------

## steveb

Can you post your Postfix configuration? Stuff like main.cf and master.cf?

// SteveB

----------

## Rob1n

I suspect the problem is in your muttrc - the sendmail wrapper included with postfix doesn't recognise all the arguments other versions do.  I'm using:

 *Quote:*   

> 
> 
> set sendmail="/usr/sbin/sendmail -bm"
> 
> 

 

----------

## Dralnu

 *Rob1n wrote:*   

> I suspect the problem is in your muttrc - the sendmail wrapper included with postfix doesn't recognise all the arguments other versions do.  I'm using:
> 
>  *Quote:*   
> 
> set sendmail="/usr/sbin/sendmail -bm"
> ...

 

That solved the local email problem. I wasn't aware of the sendmail wrapper, but that seemed to do it. I'll try emailing something to another account of mine to see if I can send it through my other account.

Edit:

I tried emailing myself. I'm not receiving it, it seems. One problem down, one more to go...

----------

## Rob1n

Try "postqueue -p" (or mailq will probably work as well) to show any messages in the queue.  Also check /var/log/mail* to see whether there's anything useful logged there.

----------

## Dralnu

 *Rob1n wrote:*   

> Try "postqueue -p" (or mailq will probably work as well) to show any messages in the queue.  Also check /var/log/mail* to see whether there's anything useful logged there.

 

Looked through the log:

 *Quote:*   

> 
> 
> Aug 20 16:15:17 [postfix/qmgr] D16266C55E: removed
> 
> Aug 20 16:17:42 [postfix/pickup] 842FB6C55E: uid=1000 from=<wrr>
> ...

 

I'm trying to send the email through my hushmail account, which obviously isn't being used.

----------

## Rob1n

Looks like the mail's not leaving your machine.  Presumably you/your ISP are blocking connections to port 25.

 *Quote:*   

> 
> 
> I'm trying to send the email through my hushmail account, which obviously isn't being used.
> 
> 

 

Do you have this setup as a relayhost in /etc/postfix/main.cf or in /etc/postfix/transport?

----------

## Dralnu

 *Rob1n wrote:*   

> Looks like the mail's not leaving your machine.  Presumably you/your ISP are blocking connections to port 25.
> 
>  *Quote:*   
> 
> I'm trying to send the email through my hushmail account, which obviously isn't being used.
> ...

 

No. I don't remember seeing that mentioned in any of the docs (i could have missed them, though). Have a good doc you could refer me to?

----------

## Rob1n

Only the official postfix docs - they're pretty good though: http://www.postfix.org/documentation.html

----------

## Dralnu

 *Rob1n wrote:*   

> Only the official postfix docs - they're pretty good though: http://www.postfix.org/documentation.html

 

I'll look again. Thanks.

----------

## Dralnu

I've looked through the docs, and I'm honestly stumped.

I've looked at the relayhost configs, and I may be missing something (I'm fairly sure I am, actually), but how do I configure this to allow a single user to send emails to a specific host (i.e. someemail@gmail.com) instead of having everyone email that email.

----------

## Rob1n

Sorry, I'm a little confused here - I thought when you said

 *Quote:*   

> 
> 
> I'm trying to send the email through my hushmail account, which obviously isn't being used.
> 
> 

 

that hushmail was some external SMTP server.

If you're just trying to send mail directly then you don't need to bother with relayhosts.  However, there does look to be something preventing you connecting to gmail on port 25 - either you or your ISP are probably firewalling it (many ISPs require all outgoing mail to be sent via their SMTP server, in which case you'll need to set them up as a relayhost).

----------

## Dralnu

 *Rob1n wrote:*   

> Sorry, I'm a little confused here - I thought when you said
> 
>  *Quote:*   
> 
> I'm trying to send the email through my hushmail account, which obviously isn't being used.
> ...

 

www.hushmail.com

It is, but from what it looked like was that everyone would end up using that account for their email, which I only want one user to be able to access it

 *Quote:*   

> If you're just trying to send mail directly then you don't need to bother with relayhosts.  However, there does look to be something preventing you connecting to gmail on port 25 - either you or your ISP are probably firewalling it (many ISPs require all outgoing mail to be sent via their SMTP server, in which case you'll need to set them up as a relayhost).

 

I never had that problem before when I used esmtp, so unless they changed their firewalls or whatever, that shouldn't be a problem.

----------

## Rob1n

 *Dralnu wrote:*   

>  *Rob1n wrote:*   Sorry, I'm a little confused here - I thought when you said
> 
>  *Quote:*   
> 
> I'm trying to send the email through my hushmail account, which obviously isn't being used.
> ...

 

Aha - now I got it!  You need the sender_dependent_relayhost_maps parameter.  You'll also need to setup the authentication (make sure you have the sasl USE flag enabled).  Try adding to /etc/postfix/main.cf:

```

smtp_sasl_auth_enable = yes

smtp_sasl_type = cyrus

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwords

smtp_sasl_security_options = noanonymous

smtp_sender_dependent_authentication = yes

sender_dependent_relayhost_maps = hash:/etc/postfix/sender_dependent_relayhost

```

Then create a /etc/postfix/sender_dependent_relayhost file:

```

my.email@my.domain         [smtp.hushmail.com]

```

and a /etc/postfix/sasl_passwords

```

my.email@my.domain         username:password

```

And then run "postmap /etc/postfix/sender_dependent_relayhost" and "postmap /etc/postfix/sasl_passwords".

 *Quote:*   

> 
> 
>  *Quote:*   If you're just trying to send mail directly then you don't need to bother with relayhosts.  However, there does look to be something preventing you connecting to gmail on port 25 - either you or your ISP are probably firewalling it (many ISPs require all outgoing mail to be sent via their SMTP server, in which case you'll need to set them up as a relayhost). 
> 
> I never had that problem before when I used esmtp, so unless they changed their firewalls or whatever, that shouldn't be a problem.

 

Well your earlier log certainly showed a failure to connect to gmail on port 25.

----------

## Dralnu

I made the changes, but I'm still having problems with port 25. I've tried to email my gmail account again, but I never see a mention of anything being routed to/through hushmail after my postfix restart.

----------

## Rob1n

The only other odd thing I can see is that the from address in your original log is "user@localhost.localhost", which (if you didn't change it) suggests that something isn't right.  This will need to match the address you used in the sasl_passwords and sender_dependent_relayhost files.

----------

## Dralnu

Within my muttrc I have

set from="myemail@hushmail.com"

Where is it just ignoring that?

----------

## Rob1n

Do you have "set envelope_from" in your muttrc?

----------

## Dralnu

 *Rob1n wrote:*   

> Do you have "set envelope_from" in your muttrc?

 

Nope. I'll look into it.

----------

