# postfix and relaying mail

## jstubbs

Hi,

I've just changed e-mail providers and am unable to send mail. The maillog contains:

```
Dec 20 15:46:23 [postfix/smtp] E7001202A7F: to=<gentoo-doc-subscribe@gentoo.org>

, relay=smtp.gawab.com[204.97.230.39], delay=2798, status=bounced (host smtp.gaw

ab.com[204.97.230.39] said: qmail-smtpd: pid 99256 from 219.206.44.154 Non-exist

ing DNS_MX: MAIL FROM:<jason@localhost.localdomain> SIZE=473 552 sorry, your env

elope sender domain must exist (#5.7.1) (in reply to MAIL FROM command))
```

I believe I got this with the previous provider as well, but it worked after enabling sasl. Is it possible to get postfix to use the mail headers instead of using my current username and computer name. If not, is there another way I can get this to work?

Relevant parts of main.conf:

```
myhostname = localhost

mydomain = localdomain

mydestination = $myhostname, localhost.$mydomain

smtp_sasl_auth_enable = yes

smtp_sasl_password_maps = hash:/etc/postfix/saslpass

smtp_sasl_security_options =
```

Relevant parts of saslpass:

```
smtp.gawab.com  <username>:<password>
```

Relevant parts of transport:

```
localdomain     :

.localdomain    :

dk.pdx.ne.jp    smtp:dk.pdx.ne.jp

*               smtp:smtp.gawab.com
```

----------

## xoomix

Hope I know what I am talking about here, but had an idea ...

You are actually using a defined relay host (smtp.gawab.com) -- I know on the relay bastions/relays I am running for my client if Postfix is unable to reverse DNS lookup the sender address/domain we have it set to automatically block/bounce the relay request because that is how a LOT of spamming domains work -- 90 % of the spam we get through our bastions every day the reverse DNS lookups are bogus or non-existant. Of course, reverse lookups for localhost.localdomain won't be accepted. Also, anyone in my organization who wants to specify my bastions/relay servers as a relay host has to have me enter that info (domain and IP address) to allow relaying in Postfix -- has the sys admin of smtp.gawab.com explicitly allowed you that priveledge? (I am thinking impossible unless you have a static ip and node name to keep in a static record).

Just a few questions on some basics, if you have that all set up somehow let us know so we can troubleshoot it further.

----------

## xoomix

I re-read you post and realized that I do not understand the sasl part of the picture, is this supposed to override all normal Postfix authentication methods?

----------

## jstubbs

Thanks for your reply.

Basically, all the sasl part does is authenticate with the server I'm trying to relay to. That part is working fine, but it's not accepting the mails anyway. The previous mail provider I used accepted them after authentication, even with the localhost.localdomain hostname.

It's really only half a problem. There is only two users of this machine - me and my wife. We're both using free internet mail accounts. Mine is now gawab.com and hers is hotmail.com. I can just use the email client to send direct to gawab.com, but she can't (with hotmail.com). I could hack it by specifying my computer name as gawab.com and adjusting transports accordingly, but then I could never send to gawab.com.

[edit]I can't just use postfix to send direct to the destination for the reason that you specified. Many mail servers will not accept mail if it's not from a valid host even if the recipient is correct.[/edit]

Is there no way to do this cleanly without having a domain name? Should I look into dyndns or the like?

----------

## UberLord

Have you tried changing the domain to the fqdn of your internet connection?   :Question: 

----------

## xoomix

According to the error you receive that is exactly it:

"(host smtp.gawab.com[204.97.230.39] said: qmail-smtpd: pid 99256 from 219.206.44.154 Non-existing DNS_MX: MAIL FROM:<jason@localhost.localdomain> SIZE=473 552 sorry, your envelope sender domain must exist"

Dydns would probably fix all your worries, that or any other free service, like the one I use no-ip.com  :Smile: 

I do wonder though why you are having to specify a relay host at all, can't you just set your outgoing mail server to localhost and call it good? I do that, and it works fine that way -- but I don't know how you have everything set up, what kind of firewalling we are talking about, etc.

----------

