0

I have do.ma.in with next DNS records:

do.ma.in      A   a.b.c.d
mail.do.ma.in A   a.b.c.d
do.ma.in      MX  mail.do.ma.in

I want to receive one mail from mail.google.com to my postfix to only one address postmaster@do.ma.in or at least to root@do.ma.in

So, I installed pure postfix to machine a.b.c.d and edited next options in /etc/postfix/main.cf:

myhostname = mail.do.ma.in
mydomain =do.ma.in
smtpd_recipient_restrictions = permit

The other settings are default. Then I fully restarted postfix daemon service postfix restart. But when I send mail to root@do.ma.in I can't see anything in maillog, only "started" messege which was generated on daemon restart:

Feb 11 19:20:29 CentOSPC postfix/master[16510]: daemon started -- version 2.6.6, configuration /etc/postfix

postqueue -p is also empty

But if I capture traffic to 25 port tcpdump -vv -x -X -s 1500 -i eth1 'port 25' I see something when I send mail from gmail (my host is 192.168.0.48 and 25 port is NAT-ed from host 192.168.0.49, which have interface with a.b.c.d):

   192.168.0.49.33301 > 192.168.0.48.smtp: Flags [S], cksum 0x179b (correct), seq 1811629667, win 42900, options [mss 1430,sackOK,TS val 822583720 ecr 0,nop,wscale 7], length 0
    0x0000:  4500 003c 107e 0000 2e06 fa8c c0a8 0031  E..<.~.........1
    0x0010:  c0a8 0030 8215 0019 6bfb 4663 0000 0000  ...0....k.Fc....
    0x0020:  a002 a794 179b 0000 0204 0596 0402 080a  ................
    0x0030:  3107 a1a8 0000 0000 0103 0307            1...........
19:23:20.492856 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 40) 
192.168.0.48.smtp > 192.168.0.49.33301: Flags [R.], cksum 0xf990 (correct), seq 0, ack 1811629668, win 0, length 0
    0x0000:  4500 0028 0000 4000 4006 b91e c0a8 0030  E..(..@.@......0
    0x0010:  c0a8 0031 0019 8215 0000 0000 6bfb 4664  ...1........k.Fd
    0x0020:  5014 0000 f990 0000                      P.......

So what I missed, what options need to be add to config?

Here is postconf -n

[root@CentOSPC]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, do.ma.in
mydomain = do.ma.in
myhostname = mail.do.ma.in
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions = permit
unknown_local_recipient_reject_code = 550
2

You need to assign domains for local delivery (do.ma.in in your case) to mydestination variable in main.cf

mydestination = $myhostname, localhost.$mydomain, localhost, do.ma.in
  • Thanks for answer! I added do.ma.in to the end of mydestination and updated postconf in question, but it still not works. – user3479125 Feb 11 '16 at 17:43
  • 1
    do you see attempts to deliver mail to root@do.ma.in in /var/log/maillog? Even better if you add tail -50 /var/log/maillog to your initial post – user1700494 Feb 11 '16 at 17:47
  • No, it is still empty, but tcpdump still shows one SMTP package when I send email to root@do.ma.in from gmail – user3479125 Feb 11 '16 at 17:49
  • join the chatroom with the same name – user1700494 Feb 11 '16 at 17:59
  • The reason was in some settings that prevented logging, so I removed /etc/postfix/ folder and reinstalled postfix, and now maillog shows delivers, and I able to read mail. – user3479125 Feb 11 '16 at 21:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.