LinuxQuestions.org
Visit Jeremy's Blog.
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 02-26-2020, 04:15 AM   #1
maipo
LQ Newbie
 
Registered: Feb 2020
Posts: 6

Rep: Reputation: Disabled
SMTP Relay for specific ip


In my server have multiple ips , if i try to send mail via relayhost all ips taken same relay only, but i need first ips taken relay other ips wont allow relay , how can i do that , any one know the answer help me
 
Old 02-26-2020, 07:11 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by maipo View Post
In my server have multiple ips , if i try to send mail via relayhost all ips taken same relay only, but i need first ips taken relay other ips wont allow relay , how can i do that , any one know the answer help me
Read the "Question Guidelines" link in my posting signature. You provide no details about your system, tell us what mail system you're using on what version/distro of Linux. We can't guess. And please do basic research before posting.

There are abundant how-to guides you can find with a brief Google search; either "postfix single ip address outgoing" or "sendmail single ip address outgoing".
 
Old 02-26-2020, 07:48 AM   #3
maipo
LQ Newbie
 
Registered: Feb 2020
Posts: 6

Original Poster
Rep: Reputation: Disabled
os: centos, am using postfix-2.10.1 application

am trying to configure relay on my server this is my configiration file entry
vim /etc/postfix/main.cf

inet_interfaces=all
relayhost = [smtp.example.com]:25
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CApath = /etc/ssl/certs
smtp_use_tls = yes

after am trying to send mail first ip via this relay its properly working . and am trying second ip to snd mail. this ip also taken same relay.. but my need first ip wants to take relay. not a second ip..
 
Old 02-26-2020, 08:44 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by maipo View Post
os: centos, am using postfix-2.10.1 application

am trying to configure relay on my server this is my configiration file entry
Code:
vim /etc/postfix/main.cf

inet_interfaces=all
relayhost = [smtp.example.com]:25
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CApath = /etc/ssl/certs
smtp_use_tls = yes
after am trying to send mail first ip via this relay its properly working . and am trying second ip to snd mail. this ip also taken same relay.. but my need first ip wants to take relay. not a second ip..
Use CODE tags when posting configs/code, please. And your question is now vague...are you saying you want to use your CentOS system AS a relay host, or you want it to send all its mail to ANOTHER relay host, via one address???

If it's the latter, you can again use the search term provided for ample how-to guides on how to set this up, such as:
https://www.faqforge.com/linux/send-...ss-in-postfix/
 
Old 02-26-2020, 11:15 PM   #5
maipo
LQ Newbie
 
Registered: Feb 2020
Posts: 6

Original Poster
Rep: Reputation: Disabled
centos is not relay host here, i mention centos is my server os . am buy a relay from ISP. now my doubt is

for example ) i have a 2 IPS 2 relays . if i want to send mail via first ip . it need to be take first relay
if i want to send mail via second ip . it needs to take second relay.
 
Old 02-27-2020, 07:08 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by maipo View Post
centos is not relay host here, i mention centos is my server os . am buy a relay from ISP. now my doubt is

for example ) i have a 2 IPS 2 relays . if i want to send mail via first ip . it need to be take first relay if i want to send mail via second ip . it needs to take second relay.
Ok; again, read the previous posts that **TELL YOU** what to do.
 
Old 02-29-2020, 03:59 AM   #7
maipo
LQ Newbie
 
Registered: Feb 2020
Posts: 6

Original Poster
Rep: Reputation: Disabled
i have tried this all the ways but i couldn't reach my required output.

i have a two ips like 172.25.0.1,172.25.0.2 and i have a only one relayhost [smtp.example.com]. now i try to send mail via ip

172.25.0.1 its taken [smtp.example.com] relay . its working fine . no issues on that. After i try to send mail via ip

172.25.0.2 its also taken same relay only. but i need to configure relay for only one ip .

if i send mail via second ip its need to through error .
 
Old 02-29-2020, 10:09 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by maipo View Post
i have tried this all the ways but i couldn't reach my required output.

i have a two ips like 172.25.0.1,172.25.0.2 and i have a only one relayhost [smtp.example.com]. now i try to send mail via ip 172.25.0.1 its taken [smtp.example.com] relay . its working fine . no issues on that. After i try to send mail via ip 172.25.0.2 its also taken same relay only. but i need to configure relay for only one ip . if i send mail via second ip its need to through error .
Right; again, you either have not read or understood what you were told. You were given search terms, and handed a link that explains, in detail, what to do, what directives to use, and in what config files.

Re-stating your problem (again), does nothing to solve it. Either read and follow the instructions, or there isn't much we can help you with, and you should hire someone to do this job for you.
 
1 members found this post helpful.
  


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
SMTP newbie queries: #< #5.3.5 SMTP; 553 5.3.5 system config error> #SMTP# LYC Linux - Newbie 0 12-04-2014 12:45 AM
SMTP "open relay" and SMTP AUTH aikempshall Linux - Security 3 10-11-2006 08:19 AM
Postfix as a mail relay (getting relay access denied) hypexr Linux - Software 3 09-13-2005 07:15 PM
relay mail to sendmail relay server??? lemay_jeff Linux - Newbie 0 07-06-2004 04:54 PM
Relay or not to relay? Manuel-H Linux - General 2 04-20-2003 03:25 PM

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

All times are GMT -5. The time now is 10:47 AM.

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