[CentOS] Setting up postfix under CentOS-6

natxo asenjo natxo.asenjo at gmail.com
Fri Sep 13 12:25:50 UTC 2013


On 09/13/2013 12:56 PM, Timothy Murphy wrote:

> If you upgrade from CentOS-5 to CentOS-6,
> which I imagine the vast majority of people did,
> then sendmail remains the current MTA.

that's a lot to assume. Most people I know professionally do not upgrade 
their rhel/centos servers. The debian crowd does, but they do have much 
shorter release cycles :-)

> However, this is only a tiny point,
> since the document mentions "yum remove sendmail" as an alternative.
>
>>> Firstly, after following the instructions meticulously,
>>> I found that I could not send out mail
>>> because (according to /var/log/maillog)
>>> the From address was
>>> tim at localhost.localdomain , and this was
>>> rejected by the recipient host or rather his ISP.
>>> -------------------------------
>>> <tim at localhost.localdomain>  MAIL FROM domain
>>> does not exist
>>>     (in reply to MAIL FROM command)
>>> -------------------------------
>>> I cured this by adding
>>>     tim tim at gayleard.eu
>>> to /etc/hosts .
>>> I don't know if this is the best way to go about it?

That is a very odd hosts file entry :-). From man 5 hosts, section EXAMPLES:

        127.0.0.1       localhost
        192.168.1.10    foo.mydomain.org       foo
        192.168.1.13    bar.mydomain.org       bar

>> This is typically caused by having your hostname set to localhost (or
>> loaclhost.localdomain). Your hostname should reflect your fqdn.
>
> If you mean $myhostname in /etc/postfix/main.cf then that is not the cause;
> it was set to my fqdn.
> Also it is set in /etc/sysconfig/network.
> And it is the name given by "uname -a".
> I'm not sure where else it can be given?

unless your fqdn is in DNS or in your hosts file, postfix does not know 
about that:

http://www.postfix.org/postconf.5.html#myhostname

So in order to find out what postfix thinks $myhostname is in its 
default settings, try this:

# postconf -d | grep myhostname

If you set a fqdn in myhostname, then you will not have that problem.

>>> After correcting this, I found my email was still rejected,
>>> with the message "Blacklisted by Spamhaus"!
>>> I read in <http://www.spamhaus.org/pbl/query/PBL814205>
>>> that 'the reason is simply that you need to turn on "SMTP
>>> Authentication"'
>
>> The bit at the top of the Spamhaus link says it all really - as a matter
>> of *policy*, Spamhaus and/or your ISP has decided that you shouldn't be
>> sending email direct from that IP address as it's residential / dynamic
>> / whatever. Either way, as a result 90% of the internet is going to
>> reject your mail. You will need to relay all outbound email through your
>> ISPs smarthost to achieve any sort of deliverability.
>
> Exactly.
> So perhaps this should be mentioned in the CentOS document
> <http://wiki.centos.org/HowTos/postfix>?
>

that is nothing postfix/centos specific, IMO. Trying to run an MTA on a 
dial-up host is an exercise in futility. You may agree of disagree 
whether this is fair, but it is a fact. So if someone adds a warning in 
the wiki about that, fine, but it has nothing to do with centos or postfix.

If you want to have a test postfix server with an acceptable IP address, 
get yourself a vm on any cloud provider. Then you will not be blocked 
unless you start spamming :-) . Those vm's are very affordable (from 
5$/month on).

-- 
groet,
natxo



More information about the CentOS mailing list