Can send mail to but not from my Postfix server

I, with some help, installed Postfix, Dovecot and MySQL on a Linode cloud server running CentOS 6.

I can send email from my gmail account to joe@MYDOMAIN.COM. I can't send email from joe@MYDOMAIN.COM to a valid email address.

Since I can successfully send emails to joe@MYDOMAIN.COM, I am guessing that I don't have a dns problem but rather a Postfix or Dovecot configuration error.

The following line is from my /var/log/mail.

Nov 6 04:21:26 mail postfix/smtpd[3302]: NOQUEUE: reject: RCPT from c-24-118-254-66.hsd1.mn.comcast.net[24.118.254.66]: 450 4.1.8 <joe@AsusLaptop.hsd1.mn.comcast.net>: Sender address rejected: Domain not found; from=<joe@AsusLaptop.hsd1.mn.comcast.net> to=<joe@MYDOMAIN.COM> proto=ESMTP helo= The comcast.net stuff above is my ISP and I am sending the email from a laptop behind a router.

Any help would be appreciated.

19 Replies

Not sure. I'd be able to tell you more if you included more information.

http://www.openspf.org/Tools

> We provide an e-mail based record tester. Send an e-mail to spf-test@openspf.net. Your message will be rejected (this is by design) and you will get the SPF result either in your MTA mail logs or via however your MTA reports errors to message senders (e.g. a bounce message). This is done to avoid the risk of backscatter from the tester. This test tests both MAIL FROM and HELO and provides results for both.

After, please post the resulting diagnostic / header / log information here, it would make things easier to troubleshoot.

Do you want to see more of /var/log/maillog?

Sure. That, and/or anything you have related to the SPF testing.

@joe:

Nov 6 04:21:26 mail postfix/smtpd[3302]: NOQUEUE: reject: RCPT from c-24-118-254-66.hsd1.mn.comcast.net[24.118.254.66]: 450 4.1.8 <joe@AsusLaptop.hsd1.mn.comcast.net>: Sender address rejected: Domain not found; from=<joe@AsusLaptop.hsd1.mn.comcast.net> to=<joe@MYDOMAIN.COM> proto=ESMTP helo=

Take my advice with a grain of salt, but that looks like you were sending an email to joe@mydomain.com not from there, and your server rejected it because it could not find the domain AsusLaptop.hsd1.mn.comcast.net.

The actual domain name would really help the folks here.

What I want to do is send and receive email from joe@MYDOMAIN.COM just like I send and receive email from a gmail account.

I can send emails to joe@MYDOMAIN.COM from my gmail account. I use Thunderbird to send the message. I easily read the email with mutt. I can't read the email with Thunderbird since the latest release of Thunderbird can't be configured to work with mail.MYDOMAIN.com and self-signed certificates. Just for the record, I read the email with:

$ mutt -f imaps://joe@MYDOMAIN.COM@mail.MYDOMAIN.COM

The problem is that I can't send emails so they come from joe@MYDOMAIN and go to my gmail account. I try to do this with mutt and the following line in .muttrc.

set smtp_url="smtp://joe@MYDOMAIN.COM@mail.MYDOMAIN.COM"

When I try to send an email to my gmail account, I am prompted for a password and then I get the error message:

"SMTP session failed: 450 4.1.8 <joe@AsusLaptop.hsd1.mn.comcast.net>: Sender address rejected: Domain not found"

The comcast.net stuff above is from my ISP and I am using a laptop behind a router.

Here are the entries in /var/log/maillog dealing with sending email from joe@MYDOMAIN.COM.

Nov 6 04:21:04 mail postfix/anvil[3241]: statistics: max connection rate 1/60s for (smtp:209.85.223.174) at Nov 6 04:17:10

Nov 6 04:21:04 mail postfix/anvil[3241]: statistics: max connection count 1 for (smtp:209.85.223.174) at Nov 6 04:17:10

Nov 6 04:21:04 mail postfix/anvil[3241]: statistics: max cache size 1 at Nov 6 04:17:10

Nov 6 04:21:21 mail postfix/smtpd[3302]: warning: dictnisinit: NIS domain name not set - NIS lookups disabled

Nov 6 04:21:21 mail postfix/smtpd[3302]: connect from c-24-118-254-66.hsd1.mn.comcast.net[24.118.254.66]

Nov 6 04:21:26 mail dovecot: auth: mysql: Connected to 127.0.0.1 (mail)

Nov 6 04:21:26 mail postfix/smtpd[3302]: NOQUEUE: reject: RCPT from c-24-118-254-66.hsd1.mn.comcast.net[24.118.254.66]: 450 4.1.8 <joe@AsusLaptop.hsd1.mn.comcast.net>: Sender address rejected: Domain not found; from=<joe@AsusLaptop.hsd1.mn.comcast.net> to=<joe@MYDOMAIN.COM> proto=ESMTP helo= Nov 6 04:21:26 mail postfix/smtpd[3302]: lost connection after RCPT from c-24-118-254-66.hsd1.mn.comcast.net[24.118.254.66]

Nov 6 04:21:26 mail postfix/smtpd[3302]: disconnect from c-24-118-254-66.hsd1.mn.comcast.net[24.118.254.66]

Nov 6 04:22:21 mail postfix/smtpd[3255]: timeout after END-OF-MESSAGE from localhost[127.0.0.1]

Nov 6 04:22:21 mail postfix/smtpd[3255]: disconnect from localhost[127.0.0.1]

What we want is for you to provide more information. Do you own 'MYDOMAIN.COM'?

OK, here it is. I hope nobody crashes it.

MYDOMAIN.COM is jhesse.com. I own it and it points to a Linode server.

I think the dns is ok.

Sounds like whatever email program you're using isn't setting a proper From: header.

I'm using "mutt". I don't think it has bugs.

You mean your e-mail address really is joe@AsusLaptop.hsd1.mn.comcast.net? Funny, a hostname lookup on "AsusLaptop.hsd1.mn.comcast.net" returns an invalid hostname for me (no IP address found for the hostname).

Your Linode server does these kinds of lookups to ensure a spammer doesn't use just any random, non-existent domain as the sender address (granted, you can configure your server to skip these checks, but I would recommend against that).

In essence you've configured your e-mail client (the one you're trying to send e-mail from) to use an invalid sender address, which is why the message is being rejected.

I happen to be using my Linux laptop where my user name is "joe", and the host name is "AsusLaptop" and my ISP info gets appended on.

I am only using my laptop for the email client software on the computer, mutt in this case. Think of running the Thunderbird email client on a laptop. You can send gmail from Thunderbird so it comes from the gmail SMTP server and goes to wherever you send it.

I want the same thing here with mutt as the email client. I want the email to come from my SMTP server and to go wherever I choose. I either am not using mutt properly or my SMTP is not configured properly.

~~[http://support.google.com/a/bin/answer.py?hl=en&answer=33786" target="_blank">](http://support.google.com/a/bin/answer. … swer=33786">http://support.google.com/a/bin/answer.py?hl=en&answer=33786](

> For example, suppose that your domain example.com uses Gmail. You create an SPF record that identifies the Google Apps mail servers as the authorized mail servers for your domain. When a recipient's mail server receives a message from user@example.com, it can check the SPF record for example.com to determine whether it is a valid message.

^There's a reason I suggested you try using the SPF checker…

If you're trying to test by sending an email to your gmail as a test, it's almost certainly guaranteed to bounce if your postfix server is sending out bogus email addresses without a valid SPF configuration.

Edited to add:

Technically, this text I'm quoting applies to google apps (email hosting using google as the provider) but my point was that the gmail / google mail servers will check SPF configuration when you send a mail to any google-hosted email address or domain.

@joe:

((…snip…))

I either am not using mutt properly or my SMTP is not configured properly.

Correct. You're not sending correctly (probably because mutt is configured wrong)

Would you mind posting the relevant section of your ~/.muttrc configuration file?

(minus the passwords, for obvious reasons.)

Edited again:

Actually, I think I already see your issue:

instead of:

set smtp_url="smtp://joe@MYDOMAIN.COM@mail.MYDOMAIN.COM"

try like this:

set smtp_pass=   your password goes here
set smtp_url = "smtp://mail.MYDOMAIN.COM"
set from="joe@MYDOMAIN.COM"
set realname="joe surname"

You can verify that Postfix is able to send outgoing mail with the following:

/usr/sbin/sendmail -t -i <

Use an e-mail address that you or a friend control in the To: line.

If this works, it's just a matter of getting your e-mail client to properly submit mail.

Still no luck. The only redacted item below is my smtp_pass.

Contents of .muttrc

set smtp_pass="redacted"

set smtp_url="smtp://mail.jhesse.com"

set from="joe@jhesse.com"

set realname="joe hesse"

=============================

Error message from mutt

SMTP session failed: 554 5.7.1 <joehesse@gmail.com>: Relay access denied

=============================

Tail of /var/log/maillog

Nov 7 07:11:27 mail postfix/anvil[3637]: statistics: max connection rate 1/60s for (smtp:24.118.254.66) at Nov 7 07:08:05

Nov 7 07:11:27 mail postfix/anvil[3637]: statistics: max connection count 1 for (smtp:24.118.254.66) at Nov 7 07:08:05

Nov 7 07:11:27 mail postfix/anvil[3637]: statistics: max cache size 1 at Nov 7 07:08:05

Nov 7 07:17:58 mail postfix/smtpd[3684]: warning: dictnisinit: NIS domain name not set - NIS lookups disabled

Nov 7 07:17:58 mail postfix/smtpd[3684]: connect from c-24-118-254-66.hsd1.mn.comcast.net[24.118.254.66]

Nov 7 07:18:00 mail postfix/smtpd[3684]: NOQUEUE: reject: RCPT from c-24-118-254-66.hsd1.mn.comcast.net[24.118.254.66]: 554 5.7.1 <joehesse@gmail.com>: Relay access denied; from=<joe@jhesse.com> to=<joehesse@gmail.com> proto=ESMTP helo= Nov 7 07:18:00 mail postfix/smtpd[3684]: lost connection after RCPT from c-24-118-254-66.hsd1.mn.comcast.net[24.118.254.66]

Nov 7 07:18:00 mail postfix/smtpd[3684]: disconnect from c-24-118-254-66.hsd1.mn.comcast.net[24.118.254.66]

Nov 7 07:21:20 mail postfix/anvil[3686]: statistics: max connection rate 1/60s for (smtp:24.118.254.66) at Nov 7 07:17:58

Nov 7 07:21:20 mail postfix/anvil[3686]: statistics: max connection count 1 for (smtp:24.118.254.66) at Nov 7 07:17:58

Nov 7 07:21:20 mail postfix/anvil[3686]: statistics: max cache size 1 at Nov 7 07:17:58

In order to relay with postfix you need to add the sending ipaddress into the /etc/postfix/mynetworks file.

-Nathan

Er, you need to add the ip address into 'mynetworks' in /etc/postfix/main.cf rather.

IMHO setting up and using SASL auth would be a better way to handle this than adding a presumably dynamic IP to mynetworks.

@Stever:

IMHO setting up and using SASL auth would be a better way to handle this than adding a presumably dynamic IP to mynetworks.

I agree. I started out doing just that..keeping up with my dynamic ip and updating it in mynetworks however, using sasl is much more secure.

It's pretty easy to do. There should be info in the linode library. If not post here and I will give you a quick howto.

Fred-

Yeah, I was just correcting the advice given. SASL is vastly superior.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct