LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-23-2022, 01:37 PM   #1
posfixnoob
LQ Newbie
 
Registered: Jun 2022
Posts: 2

Rep: Reputation: 0
Relaying email using Postfix


Hi there

hope someone can help me out here. I have a bunch of servers mailing to our postfix server to deliver mail to internet. now I want to relay email for a specific domain to an external smtp server. The rest of all domains delivered to this email server need to us MX. I want to use smtp port 25 unauthenticated.

I read few blogs specifying I have to set in Main.cf

transport_maps = hash:/etc/postfix/transport

but my main.cf uses

transport_maps = lmdb:/etc/postfix/transport

when using the command

postmap /etc/postfix/transport
the key value pair is added to this lmdb in plain text
not sure if it is meant to work this way.

anyway I cant get it to work and cant find how to do it. Hope its a easy question.
all other configuration I had to do on postfix was quite doable.


in the tranport file I tried to add:

exmaple.com smtp:[smtprelay.example.com]
and also tried
example.com smtp:smtprelay.example.com:25

after using postmap and reloading using hash I get the error: Temporary lookup failure
after using postmap and reloading using lmdb nothing is changed and email is sent normally without relay

Also I am not sure if trying it this way all other domain will still use MX.
I am not sure what to exactly post from my main.cf but below small part of it

mynetworks = 10.131.3.0/24, 127.0.0.0/8, 10.131.4.0/24
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
myhostname = m1.example.com
mynetworks_style = subnet
relayhost =
alias_maps = lmdb:/etc/aliases
canonical_maps = lmdb:/etc/postfix/canonical
relocated_maps = lmdb:/etc/postfix/relocated
sender_canonical_maps = lmdb:/etc/postfix/sender_canonical
transport_maps = lmdb:/etc/postfix/transport

Lots of questions appreciate the help

Last edited by posfixnoob; 06-23-2022 at 03:43 PM.
 
Old 08-03-2022, 06:06 AM   #2
posfixnoob
LQ Newbie
 
Registered: Jun 2022
Posts: 2

Original Poster
Rep: Reputation: 0
Talking solved

Hi Posfixnoob,

again you helped yourself. nice work man.


the postmap command adds the stuff needed to the lmdb.

so the answer is:

/etc/postfix/main.cf

sender_dependent_relayhost_maps = lmdb:/etc/postfix/relay_maps


/etc/postfix/main.cf

@example.com [email-smtp.example.com]:25


postmap lmdb:/etc/postfix/relay_maps

systemctl stop postfix
systemctl start postfix

Last edited by posfixnoob; 08-03-2022 at 07:29 AM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to send email from relaying yahoo email server with mutt? luofeiyu Linux - Server 2 10-07-2017 03:49 AM
postfix relaying email to multiple mailbox server inaki Linux - Server 5 04-06-2010 12:34 AM
what is a "relaying" email server unhappyStar Linux - Networking 1 08-15-2004 01:57 AM
DISCUSSION: HOWTO Setup a Secure Relaying Email Server DavidPhillips LinuxAnswers Discussion 20 07-30-2004 11:46 AM
relaying to email server depaul Linux - Software 3 07-18-2003 02:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:50 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