LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-06-2022, 03:48 AM   #1
glennbtn
Member
 
Registered: Dec 2009
Posts: 154

Rep: Reputation: 19
Postfix Issue


Hoping someone can help me out here.

I have a server sending our reports with bash scripts. We changed mail server and now the emails are being rejected with the help command by the email server below (I have changed the domain and ip in the log)

Code:
NOQUEUE: reject: RCPT from server1.mydomain.co.uk[92.xxx.xxx.xx]: 450 4.7.1 <server1.localdomain>: Helo command rejected: Host not found; from=<root@server1.localdomain> to=<glenn@mydomain.co.uk> proto=ESMTP helo=<server1.localdomain>
if I run hostname it displays as server1
if I run hostname -f server1.mydomain.co.uk

In
/etc/postfix/main.cf
I have tried adding the line
Code:
mydomain = my domain.co.uk
Yes email still rejected with help saying it's server1.localdomain

And advise would be great thanks
 
Old 09-07-2022, 01:16 PM   #2
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by glennbtn View Post
In
/etc/postfix/main.cf
I have tried adding the line
Code:
mydomain = my domain.co.uk
Do you have myhostname set in main.cf? https://www.postfix.org/BASIC_CONFIGURATION_README.html
Also, I am sure you know this but just want to confirm, after making changes you restarted postfix right?
 
Old 09-08-2022, 02:30 AM   #3
glennbtn
Member
 
Registered: Dec 2009
Posts: 154

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by dc.901 View Post
Do you have myhostname set in main.cf? https://www.postfix.org/BASIC_CONFIGURATION_README.html
Also, I am sure you know this but just want to confirm, after making changes you restarted postfix right?
Thanks for coming back to me. Yes I have also tried setting myhostname and after did a postfix reload and also tried a restart of postfix just incase
 
Old 09-08-2022, 03:09 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Quote:
Originally Posted by glennbtn View Post
Thanks for coming back to me. Yes I have also tried setting myhostname and after did a postfix reload and also tried a restart of postfix just incase
You should use masquerading
 
Old 09-14-2022, 04:10 PM   #5
Ladowny
Member
 
Registered: Oct 2006
Distribution: Debian, OpenBSD, FreeBSD
Posts: 54

Rep: Reputation: 15
You need to change your HELO/EHLO from server1.localdomain to an existing DNS name eg. yourserver.yourdomain.co.uk. Make sure the DNS entry is there and is pointing to the public IP of your server. Also make sure the reverse DNS entry for your IP points to the same name to avoid other delivery problems.

Check your "myorigin" and "myhostname" setting in /etc/postfix/main.cf and/or content of /etc/mailname file. Your "server1.localdomain" value should be somewhere in you config. If you don't find it in main.cf try grepping your /etc for it.
 
Old 09-15-2022, 04:38 PM   #6
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 173

Rep: Reputation: 22
Have you checked in /etc/hostname?

Is your DNS resolving the FQDN correctly?

Is your MX record pointing to the FQDN?

What is postconf myhostname?

Is your PTR record correct?

What is Postconf mydomain

Does postconf my origin return $myhostname?

Have you done sudo postconf -e "mydestination = yourdomain.com, \$myhostname, localhost.\$mydomain, localhost"?

@Ladowny's suggestion to grep for server1.localdomain may give you the answer.

What's in /var/logs/maillog? If you could sanitize entries where the error is shown, it might help.

Try installing mailx and sending testmails and then check the /var/log/maillog and post the sanitized results.

Last edited by baldur2630; 09-15-2022 at 04:50 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix 2.6.6 postfix/cleanup and postfix/master errors Pummelmuffin Linux - Server 2 11-22-2020 12:50 PM
Bind issue? DNS issue? Domain provider issue? Cannot reach Apache virtual hosts internally. rnturn Linux - Networking 5 01-26-2020 10:35 AM
Postfix issue ; Must issue a STARTTLS command first after forcing TLS sarajevo Linux - Server 3 05-14-2009 08:28 AM
Postfix: postfix: fatal: chdir(/usr/libexec/postfix) Micro420 Ubuntu 2 07-13-2008 12:21 PM
move postfix mails from server to another postfix server onetwo Linux - Software 2 03-18-2003 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration