I am trying to learn about mail servers and am quite daunted by all of the moving pieces in the setup..
Currently I am unable to send via from my smtp server. I can receive mails fine from various domains.
In my logs I see the below entries when trying to send mail..
Jul 31 11:59:15 mail postfix/submission/smtpd[1290]: connect from unknown[78.136.22.232]
Jul 31 12:01:03 mail postfix/postscreen[1294]: CONNECT from [209.85.214.179]:46881 to [45.77.139.149]:25
Jul 31 12:01:03 mail postfix/postscreen[1294]: PASS OLD [209.85.214.179]:46881
Jul 31 12:01:03 mail postfix/smtpd[1297]: connect from mail-pl1-f179.google.com[209.85.214.179]
Jul 31 12:01:05 mail postfix/smtpd[1297]: 03178A46: client=mail-pl1-f179.google.com[209.85.214.179]
Jul 31 12:01:05 mail postfix/cleanup[1299]: 03178A46: message-id=<CAMJ_LmbWv_5o7GZJx8RwqOqz52O_sWTrgX0_=mSi_Vt6+uz++Q@mail.gmail.com>
Jul 31 12:01:05 mail postfix/cleanup[1299]: 03178A46: milter-reject: END-OF-MESSAGE from mail-pl1-f179.google.com[209.85.214.179]: 5.7.1 Gtube pattern; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-pl1-f179.google.com>
Jul 31 12:01:05 mail postfix/smtpd[1297]: disconnect from mail-pl1-f179.google.com[209.85.214.179] ehlo=2 starttls=1 mail=1 rcpt=1 data=0/1 quit=1 commands=6/7
Jul 31 12:04:15 mail postfix/submission/smtpd[1290]: timeout after CONNECT from unknown[78.136.22.232]
Jul 31 12:04:15 mail postfix/submission/smtpd[1290]: disconnect from unknown[78.136.22.232] commands=0/0
root@mail:~#
My OS is Debian 9 and all iptables rules have been flushed while testing this.
Here are my master.cf and main.cf --> https://pastebin.com/9WUnzYZt
Thanks
EDIT1:
Something I forgot to mention. I did grep 'smtp.*restrict' from my main.cf. I noticed that the smtpd_recipient_restrictions is pointing to a a sql file. The sql file itself has the below query.. Can this be the reason for the outgoing mail to fail?
root@mail:~# grep smtp.*restrict /etc/postfix/main.cf
smtpd_relay_restrictions = reject_non_fqdn_recipient
smtpd_recipient_restrictions = check_recipient_access mysql:/etc/postfix/sql/recipient-access.cf
smtpd_client_restrictions = permit_mynetworks
smtpd_helo_restrictions = permit_mynetworks
smtpd_data_restrictions = reject_unauth_pipelining
root@mail:~# grep query /etc/postfix/sql/recipient-access.cf
query = select if(sendonly = true, 'REJECT', 'OK') AS access from accounts where username = '%u' and domain = '%d' and enabled = true LIMIT 1;
root@mail:~#
EDIT2: I configured mutt to rule out this being a client side issue but still I can't seem to get it working..
└─[$] <> cat muttrc
set folder = "imaps://[email protected]@imap.mydomain.abc:993"
set smtp_url = "smtp://[email protected]@smtp.mydomain.abc:587"
set from = "[email protected]"
set realname = "hostmaster"
set spoolfile = "+Inbox"
set record = "+Sent"
set trash = "+Trash"
set postponed = "+Drafts"
mailboxes =Inbox =Sent =Trash =Drafts =Junk =Other
however whenever I try to send mail, regardless if it's another domain or the same email address as the sender I see this error
SMTP session failed: 451 4.3.0 <[email protected]>: Temporary lookup failure