Feeds:
Posts
Comments

Posts Tagged ‘access’

Host Details

smtp-host: 10.0.0.100 [ubuntu 14.04]
client-host: 10.0.0.50 [ubuntu 14.04]
relayhost: Pub IP address [Your/ISP relay host IP]
Error: Relay access denied @client-host

1st Try: Send Email from Command Line Telnet

ubuntu@client-host:~$ telnet stmp-host 25
Trying 10.0.0.50…
Connected to stmp-host.
Escape character is ‘^]’.
220 stmp-host ESMTP Postfix (Ubuntu)
MAIL FROM: sender@myemaildomain.com.jp
250 2.1.0 Ok
RCPT TO: receiver@myemaildomain.com.jp
454 4.7.1 <receiver@myemaildomain.com.jp>: Relay access denied

Error @ SMTP Server: /var/log/mail.log

Dec  7 12:50:33 smtp-host postfix/smtpd[26446]: connect from client-host[10.0.0.50]
Dec  7 12:51:40 smtp-host postfix/smtpd[26446]: NOQUEUE: reject: RCPT from client-host[10.0.0.50]: 454 4.7.1 <receiver@myemaildomain.com.jp>: Relay access denied; from=<sender@myemaildomain.com.jp> to=<receiver@myemaildomain.com.jp> proto=SMTP helo=<myemaildomain.com.jp>
Dec  7 12:51:58 smtp-host postfix/smtpd[26446]: disconnect from client-host[10.0.0.50]

 

Current /etc/postfix/main.cf config @ smtp-host:

# This file is managed by salt – do not edit localy, changes will be overwritten.
#
# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA’s job.
append_dot_mydomain = no

# Uncomment the next line to generate “delayed mail” warnings
#delay_warning_time = 4h

readme_directory = no

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = client-host
myorigin = client-host
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

mydestination = mail.1nc, localhost.localdomain, localhost, client-host
relayhost = relayhost-ip-address
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128  192.168.1.0/24
mailbox_size_limit = 0
recipient_delimiter = +

Soultion:

Allow Client network 10.0.0.0/24 in smtp-hos: /etc/postfix/main.cf

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128  192.168.1.0/24

To

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128  192.168.1.0/24 10.0.0.0/24

sudo service postfix restart

2nd Try: Send Email from Command Line Telnet

ubuntu@client-host:~$ telnet smtp-host 25
Trying 10.0.0.100…
Connected to smtp-host.
Escape character is ‘^]’.
220 smtp-host ESMTP Postfix (Ubuntu)
HELO myemaildomain.com.jp
250 smtp-host
MAIL FROM: sender@myemaildomain.com.jp
250 2.1.0 Ok
RCPT TO: receiver@myemaildomain.com.jp
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
Subject: Test Email
Please Confirm..Testing
Bye from e-mail client host
Thanks
.
250 2.0.0 Ok: queued as 0B81B46041
QUIT
221 2.0.0 Bye
Connection closed by foreign host.

E-mail Sent – Successfully

Dec  7 13:42:08 smtp-host postfix/smtpd[26971]: connect from client-host[10.0.0.50]
Dec  7 13:42:08 smtp-host postfix/smtpd[26971]: 0B81B46041: client=client-host[10.0.0.50]
Dec  7 13:42:08 smtp-host postfix/cleanup[26976]: 0B81B46041: message-id=<642190740.2.1481089328039.JavaMail.root@client-host>
Dec  7 13:42:08 smtp-host postfix/qmgr[26941]: 0B81B46041: from=<sender@myemaildomain.com.jp>, size=666, nrcpt=1 (queue active)
Dec  7 13:42:08 smtp-host postfix/smtpd[26971]: disconnect from client-host[10.0.0.50]
Dec  7 13:42:08 smtp-host postfix/smtp[26978]: 0B81B46041: to=<receiver@myemaildomain.com.jp>, relay=relayhost-ip-address[relayhost-ip-address]:25, delay=0.19, delays=0.01/0/0.01/0.17, dsn=2.6.0, status=sent (250 2.6.0 <642190740.2.1481089328039.JavaMail.root@client-host> [InternalId=720659] Queued mail for delivery)
Dec  7 13:42:08 smtp-host postfix/qmgr[26941]: 0B81B46041: removed

 

Thats all, the above setup was tested using LXC containers on Ubuntu 14.04 LTS.

Advertisements

Read Full Post »