LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-22-2016, 04:11 AM   #1
Amolp
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Rep: Reputation: Disabled
problem in sending and receiving mail between two different machines using postfix.


hello all,

I want to send mail from one machine to another machine and reply back.

but problem is that i am able to send mail from machine-1 to machine-2 but not from machine-2 to machine-1 it gives me error like this,

Mar 22 02:53:54 debian postfix/qmgr[4083]: 4120D4803B8: from=<amol@mymail.in>, size=314, nrcpt=1 (queue active)
Mar 22 02:53:54 debian postfix/qmgr[4083]: 1D336483646: from=<amol@mymail.in>, size=314, nrcpt=1 (queue active)
Mar 22 02:53:54 debian postfix/smtp[6390]: warning: smtp_sasl_auth_enable is true, but SASL support is not compiled in
Mar 22 02:53:54 debian postfix/smtp[6390]: warning: relayhost configuration problem
Mar 22 02:53:54 debian postfix/smtp[6391]: warning: smtp_sasl_auth_enable is true, but SASL support is not compiled in
Mar 22 02:53:54 debian postfix/smtp[6390]: 4120D4803B8: to=<amol@host1.myamil.in>, relay=none, delay=4781, delays=4781/0.01/0/0, dsn=4.3.5, status=deferred (Host or domain name not found. Name service error for name=mymail.in type=A: Host found but no data record of requested type)
Mar 22 02:53:54 debian postfix/smtp[6391]: 1D336483646: to=<amol@myahoo.mymail.in>, relay=myahoo.mymail.in[192.168.2.15]:25, delay=4600, delays=4600/0.01/0.02/0.08, dsn=4.7.1, status=deferred (host myahoo.mymail.in[192.168.2.15] said: 454 4.7.1 <amol@myahoo.mymail.in>: Relay access denied (in reply to RCPT TO command))

---------------------------------------------------------------------------

i am editing /etc/postfix/transport file for sending mail from one machine to another machine, my transport file is look looke this,

myahoo.mymail.in smtp:myahoo.mymail.in
host1.mymail.in smtp:host1.mymail.in

----------------------------------------------------------------------------

my main.cf file is look like this,


compatibility_level = 2
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = ns1.mymail.in
mydomain = mymail.in
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
local_recipient_maps =
unknown_local_recipient_reject_code = 550
mynetworks_style = subnet
mynetworks = 192.168.0.0/24, 127.0.0.0/8
relay_domains =
relayhost = $mydomain
home_mailbox = Maildir/
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/local/man
sample_directory = /etc/postfix
readme_directory = no
inet_protocols = ipv4
meta_directory = /etc/postfix
shlib_directory = no
transport_maps = hash:/etc/postfix/transport
smtputf8_enable = no
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/remote_passwords
smtp_sasl_security_options = noplaintext,noanonymous
smtp_sasl_tls_security_options = noanonymous

---------------------------------------------------------------------------
Thanks in advance..............
 
Old 03-24-2016, 11:44 AM   #2
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
Hi,

I do not quite understand what you are trying to achieve.
You said, you want to send an email from machine-1 to machine-2 and get a reply.

From what I know SMTP does not work like that. Basically is w way to relay mail from where it is towards its final destination.
There is no concept of machine-1 o machine-2 and backward.
Generally the mail origin is a mail client (yes, running on a machine that can be considered as your machine-1) having as recipient or destination the mail address you put in the to field.
And yes the recipient mail address as the format recipient.username@fullly.qualified.name.com.

The SMTP work starts when the mail client program gives its local SMTP (gateway) the mail for delivery. The local SMTP will interrogate its DNS in order to find out the MX record of fullly.qualified.name.com, giving the IP address of the final destination for the mail recipient. From that IP address the mail will be sent towards it through the various relays on Internet.
When the mail reaches it final destination (the IP address of the final recipient, not the inbox of the recipient), the process is complete. The mail retrieval is another process dealt by other protocols (IMAP for example).
Sorry, if that explanation was lengthy, and maybe useless, but I thought it was important so I clarify the context in which am I in.

So to clarify few things, it will be good if you confirm to us that your sending mail client is running on machine-1. Also machine-1 has an local SMTP gateway doing the job of accepting the local mails and try to deliver them to their final destinations. Please confirm, give the name and version of your mail client, the origin email address, the name and version of the SMTP gateway. Apparently it seems as if you are using postfix as SMTP.
Then for the recipient side, you will also so need to confirm that the final destination SMTP is also postfix, share with the DNS entry that maps to its IP address, confirm that the recipient mail address domain is among the domains the machine-2 considers itself as final destination, and the machine-2 delivery mechanism is able to finally deliver the mail in an inbox.

It is only when those roles will be understood, clarified and accepted that it will worth looking in their postfix configuration.
I am afraid that what you have shared so far, is speechless to us until you clarify which role is play by which part.

Regards,
 
1 members found this post helpful.
Old 03-25-2016, 01:30 AM   #3
Amolp
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hello tshikose,

Thanks for give me lots of information about SMTP. and sorry for i am not able to explain you proper problem statement.

my exact problem is i have to send mail from one domain to another. and i have solve this problem by using gateway.

STEPS:

1) i am edit /etc/postfix/transport file, i am put there my other hosts names.
my /etc/postfix/transport file look like this......

myahoo.mymail.in smtp:myahoo.mymail.in
host1.mymail.in smtp:host1.mymail.in

2) create transport.db file by using postmap command.
3) create /etc/postfix/remote_password file for gives permission to access users from one domain to another domain.
my remote_password file look like this ........

[smtp.host1.mymail.in]:587 amol@host1.mymail.in:amolp123

4) create remote_password.db file using posmap command.
5) reload postfix service

after this all steps i solve my problem and i am able to send mail from one domain to other.

Thanks.
 
Old 03-25-2016, 01:37 AM   #4
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
Hi,

I'm glad you solve your problem.
So marked the thread as SOLVED.

Besides, my knowledge of postfix prevents me at this stage to really understand what was your problem and how you solved it.
 
  


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 neither sending nor receiving mail cov Linux - Server 23 01-18-2016 12:28 AM
Problem receiving mail - postfix/dovecot Altiris Linux - Software 13 04-17-2014 08:22 AM
problem with sending mail in postfix sohailkmu Linux - Server 4 03-04-2011 05:55 AM
Mail size problem sending and receiving juan1987 Linux - Newbie 12 03-12-2009 01:47 AM
problem receiving pop3 mail from postfix mail server GEN_Electric Linux - Software 2 02-14-2005 02:43 PM

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

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