All pastes #482995 Raw Edit

centos 5 postfix dns

public text v1 · immutable
·published 2007-05-11 14:47 UTC
rendered paste body
/etc/postfix/main.cf

mydestination = $myhostname, domain.ro
smtpd_banner = mail.domain.ro Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830 ready
biff = no
append_dot_mydomain = no
mynetworks = 192.168.2.0/24,127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
mailbox_transport = procmail

alias_maps = hash:/etc/aliases hash:/etc/postfix/oldusers_alias
local_recipient_maps = $alias_maps hash:/etc/postfix/mailenable_hash

#RESTRICTII
#HELO/EHLO
disable_vrfy_command = yes
smtpd_helo_required = yes
smtpd_helo_restrictions =
    permit_mynetworks
    reject_invalid_helo_hostname
    reject_non_fqdn_helo_hostname
#    reject_unknown_hostname daca helo nu se rezolva in ip

#MAIL FROM:
smtpd_sender_restrictions =
    reject_non_fqdn_sender
    reject_unknown_sender_domain

#RCPT TO
smtpd_recipient_restrictions =
    permit_sasl_authenticated
    permit_mynetworks
    reject_non_fqdn_recipient
    check_recipient_access hash:/etc/postfix/check_recipient_access_hash
    check_sender_access hash:/etc/postfix/check_sender_access_hash
    check_helo_access hash:/etc/postfix/check_helo_access_hash
    check_helo_access pcre:/etc/postfix/check_helo_access_pcre
#spameri
    reject_rbl_client softcore.rbl.sns.ro
#TIMEOUT    reject_rbl_client relays.ordb.org
    reject_rbl_client bl.spamcop.net
    reject_rbl_client dnsbl.ahbl.org
    reject_rhsbl_sender rhsbl.ahbl.org
    reject_rbl_client list.dsbl.org
    reject_rbl_client sbl-xbl.spamhaus.org
    reject_rbl_client cbl.abuseat.org
    reject_rbl_client dul.dnsbl.sorbs.net
#       SA FIE ULTIMUL !!!
    reject_unauth_destination

#DATA
smtpd_data_restrictions =
    reject_unauth_pipelining
#    permit

#HEADERS
header_checks = pcre:/etc/postfix/header_checks_pcre
message_size_limit = 200000000

maximal_queue_lifetime = 3d
bounce_queue_lifetime = 3d
minimal_backoff_time = 300s
maximal_backoff_time = 10800s
anvil_rate_time_unit = 1s
smtpd_client_recipient_rate_limit = 5
smtpd_client_connection_rate_limit = 3
smtpd_client_message_rate_limit = 3
smtpd_client_connection_count_limit = 3

#content_filter = smtp-bitdefender:127.0.0.1:10025
#receive_override_options = no_address_mappings
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes


tcpdump -ni any port 53

17:10:27.254291 IP 127.0.0.1.32782 > 127.0.0.1.domain:  13818+ MX? gmail.com. (27)
17:10:27.254477 IP 127.0.0.1.32782 > 127.0.0.1.domain:  13818+ MX? gmail.com. (27)
17:10:27.254542 IP 127.0.0.1.32782 > 127.0.0.1.domain:  13818+ MX? gmail.com. (27)
17:10:27.254603 IP 127.0.0.1.32782 > 127.0.0.1.domain:  13818+ MX? gmail.com. (27)
17:10:27.254653 IP 127.0.0.1.32782 > 127.0.0.1.domain:  62845+ A? gmail.com. (27)
17:10:27.254756 IP 127.0.0.1.32782 > 127.0.0.1.domain:  62845+ A? gmail.com. (27)
17:10:27.254817 IP 127.0.0.1.32782 > 127.0.0.1.domain:  62845+ A? gmail.com. (27)
17:10:27.254892 IP 127.0.0.1.32782 > 127.0.0.1.domain:  62845+ A? gmail.com. (27)
17:10:27.254964 IP 127.0.0.1.32782 > 127.0.0.1.domain:  15853+ AAAA? gmail.com. (27)
17:10:27.255027 IP 127.0.0.1.32782 > 127.0.0.1.domain:  15853+ AAAA? gmail.com. (27)
17:10:27.255098 IP 127.0.0.1.32782 > 127.0.0.1.domain:  15853+ AAAA? gmail.com. (27)
17:10:27.255167 IP 127.0.0.1.32782 > 127.0.0.1.domain:  15853+ AAAA? gmail.com. (27)

syslog

May 11 17:10:27 mail50-out postfix/smtpd[12061]: connect from unknown[192.168.2.93]
May 11 14:10:27 mail50-out postfix/smtpd[12061]: NOQUEUE: reject: RCPT from unknown[192.168.2.93]: 450 4.1.8 <costinel@gmail.com>: Sender address rejected: Domain not found; from=<costinel@gmail.com> to=<cgusa@domain.ro> proto=ESMTP helo=<cgusa>
May 11 14:10:27 mail50-out postfix/smtpd[12061]: disconnect from unknown[192.168.2.93]

strace -fp 12061

Process 12061 attached - interrupt to quit
select(23, [5 6 22], [], [5 6 22], {17, 483000}) = 1 (in [6], left {12, 716000})
time(NULL)                              = 1178892714
fstat64(15, {st_mode=S_IFREG|0644, st_size=12288, ...}) = 0
fstat64(21, {st_mode=S_IFREG|0644, st_size=12288, ...}) = 0
fstat64(17, {st_mode=S_IFREG|0644, st_size=12288, ...}) = 0
fstat64(11, {st_mode=S_IFREG|0644, st_size=12288, ...}) = 0
fstat64(19, {st_mode=S_IFREG|0644, st_size=12288, ...}) = 0
fstat64(13, {st_mode=S_IFREG|0644, st_size=12288, ...}) = 0
accept(6, {sa_family=AF_INET, sin_port=htons(1176), sin_addr=inet_addr("192.168.2.93")}, [16]) = 9
flock(8, LOCK_UN)                       = 0
fcntl64(9, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(9, F_SETFL, O_RDWR)             = 0
fcntl64(9, F_GETFD)                     = 0
fcntl64(9, F_SETFD, FD_CLOEXEC)         = 0
gettimeofday({1178892714, 535905}, NULL) = 0
write(5, "\35/\0\0\5\0\0\0\0\0\0\0", 12) = 12
getpeername(9, {sa_family=AF_INET, sin_port=htons(1176), sin_addr=inet_addr("192.168.2.93")}, [16]) = 0
geteuid32()                             = 89
getuid32()                              = 89
time(NULL)                              = 1178892714
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
send(7, "<22>May 11 14:11:54 postfix/smtp"..., 76, MSG_NOSIGNAL) = 76
time(NULL)                              = 1178892714
select(10, NULL, [9], [9], {300, 0})    = 1 (out [9], left {300, 0})
write(9, "220 mail.domain.ro Microsoft "..., 82) = 82
gettimeofday({1178892714, 538297}, NULL) = 0
select(10, [9], NULL, [9], {300, 0})    = 1 (in [9], left {299, 999000})
read(9, "EHLO cgusa\r\n", 4096)         = 12
gettimeofday({1178892714, 540531}, NULL) = 0
time(NULL)                              = 1178892714
time(NULL)                              = 1178892714
time(NULL)                              = 1178892714
time(NULL)                              = 1178892714
time(NULL)                              = 1178892714
time(NULL)                              = 1178892714
time(NULL)                              = 1178892714
time(NULL)                              = 1178892714
time(NULL)                              = 1178892714
select(10, NULL, [9], [9], {300, 0})    = 1 (out [9], left {300, 0})
write(9, "250-mail50-out.domain.ro\r\n250"..., 207) = 207
gettimeofday({1178892714, 542188}, NULL) = 0
select(10, [9], NULL, [9], {300, 0})    = 1 (in [9], left {300, 0})
read(9, "AUTH LOGIN\r\n", 4096)         = 12
gettimeofday({1178892714, 542788}, NULL) = 0
time(NULL)                              = 1178892714
select(10, NULL, [9], [9], {300, 0})    = 1 (out [9], left {300, 0})
write(9, "334 VXNlcm5hbWU6\r\n", 18)    = 18
gettimeofday({1178892714, 543393}, NULL) = 0
select(10, [9], NULL, [9], {300, 0})    = 1 (in [9], left {300, 0})
read(9, "Y2d1c2E=\r\n", 4096)           = 10
gettimeofday({1178892714, 543834}, NULL) = 0
time(NULL)                              = 1178892714
select(10, NULL, [9], [9], {300, 0})    = 1 (out [9], left {300, 0})
write(9, "334 UGFzc3dvcmQ6\r\n", 18)    = 18
gettimeofday({1178892714, 544415}, NULL) = 0
select(10, [9], NULL, [9], {300, 0})    = 1 (in [9], left {300, 0})
read(9, "Y29zdGlubWtqdg==\r\n", 4096)   = 18
gettimeofday({1178892714, 544857}, NULL) = 0
socket(PF_FILE, SOCK_STREAM, 0)         = 23
connect(23, {sa_family=AF_FILE, path="/var/run/saslauthd/mux"}, 110) = 0
writev(23, [{"\0\5cgusa\0\ntestpassword\0\4smtp\0\0", 27}], 1) = 27
read(23, "\0\2", 2)                     = 2
read(23, "OK", 2)                       = 2
close(23)                               = 0
time(NULL)                              = 1178892714
select(10, NULL, [9], [9], {300, 0})    = 1 (out [9], left {300, 0})
write(9, "235 2.0.0 Authentication success"..., 37) = 37
gettimeofday({1178892714, 548022}, NULL) = 0
select(10, [9], NULL, [9], {300, 0})    = 1 (in [9], left {299, 999000})
read(9, "MAIL FROM: <costinel@gmail.com>\r"..., 4096) = 33
gettimeofday({1178892714, 549013}, NULL) = 0
gettimeofday({1178892714, 549184}, NULL) = 0
time(NULL)                              = 1178892714
select(10, NULL, [9], [9], {300, 0})    = 1 (out [9], left {300, 0})
write(9, "250 2.1.0 Ok\r\n", 14)        = 14
gettimeofday({1178892714, 549786}, NULL) = 0
select(10, [9], NULL, [9], {300, 0})    = 1 (in [9], left {300, 0})
read(9, "RCPT TO: <cgusa@domain.ro>\r\n", 4096) = 31
gettimeofday({1178892714, 550229}, NULL) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 23
connect(23, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
fcntl64(23, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(23, F_SETFL, O_RDWR|O_NONBLOCK) = 0
gettimeofday({1178892714, 551180}, NULL) = 0
poll([{fd=23, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(23, "5\0\1\0\0\1\0\0\0\0\0\0\5gmail\3com\0\0\17\0\1", 27, MSG_NOSIGNAL) = 27
poll([{fd=23, events=POLLIN, revents=POLLERR}], 1, 5000) = 1
close(23)                               = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 23
connect(23, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
fcntl64(23, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(23, F_SETFL, O_RDWR|O_NONBLOCK) = 0
gettimeofday({1178892714, 552602}, NULL) = 0
poll([{fd=23, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(23, "5\0\1\0\0\1\0\0\0\0\0\0\5gmail\3com\0\0\17\0\1", 27, MSG_NOSIGNAL) = 27
poll([{fd=23, events=POLLIN, revents=POLLERR}], 1, 5000) = 1
close(23)                               = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 23
connect(23, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
fcntl64(23, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(23, F_SETFL, O_RDWR|O_NONBLOCK) = 0
gettimeofday({1178892714, 553912}, NULL) = 0
poll([{fd=23, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(23, "5\0\1\0\0\1\0\0\0\0\0\0\5gmail\3com\0\0\17\0\1", 27, MSG_NOSIGNAL) = 27
poll([{fd=23, events=POLLIN, revents=POLLERR}], 1, 5000) = 1
close(23)                               = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 23
connect(23, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
fcntl64(23, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(23, F_SETFL, O_RDWR|O_NONBLOCK) = 0
gettimeofday({1178892714, 555217}, NULL) = 0
poll([{fd=23, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(23, "5\0\1\0\0\1\0\0\0\0\0\0\5gmail\3com\0\0\17\0\1", 27, MSG_NOSIGNAL) = 27
poll([{fd=23, events=POLLIN, revents=POLLERR}], 1, 5000) = 1
close(23)                               = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 23
connect(23, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
fcntl64(23, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(23, F_SETFL, O_RDWR|O_NONBLOCK) = 0
gettimeofday({1178892714, 556648}, NULL) = 0
poll([{fd=23, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(23, "e\275\1\0\0\1\0\0\0\0\0\0\5gmail\3com\0\0\1\0\1", 27, MSG_NOSIGNAL) = 27
poll([{fd=23, events=POLLIN, revents=POLLERR}], 1, 5000) = 1
close(23)                               = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 23
connect(23, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
fcntl64(23, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(23, F_SETFL, O_RDWR|O_NONBLOCK) = 0
gettimeofday({1178892714, 557961}, NULL) = 0
poll([{fd=23, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(23, "e\275\1\0\0\1\0\0\0\0\0\0\5gmail\3com\0\0\1\0\1", 27, MSG_NOSIGNAL) = 27
poll([{fd=23, events=POLLIN, revents=POLLERR}], 1, 5000) = 1
close(23)                               = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 23
connect(23, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
fcntl64(23, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(23, F_SETFL, O_RDWR|O_NONBLOCK) = 0
gettimeofday({1178892714, 559246}, NULL) = 0
poll([{fd=23, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(23, "e\275\1\0\0\1\0\0\0\0\0\0\5gmail\3com\0\0\1\0\1", 27, MSG_NOSIGNAL) = 27
poll([{fd=23, events=POLLIN, revents=POLLERR}], 1, 5000) = 1
close(23)                               = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 23
connect(23, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
fcntl64(23, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(23, F_SETFL, O_RDWR|O_NONBLOCK) = 0
gettimeofday({1178892714, 560578}, NULL) = 0
poll([{fd=23, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(23, "e\275\1\0\0\1\0\0\0\0\0\0\5gmail\3com\0\0\1\0\1", 27, MSG_NOSIGNAL) = 27
poll([{fd=23, events=POLLIN, revents=POLLERR}], 1, 5000) = 1
close(23)                               = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 23
connect(23, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
fcntl64(23, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(23, F_SETFL, O_RDWR|O_NONBLOCK) = 0
gettimeofday({1178892714, 561891}, NULL) = 0
poll([{fd=23, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(23, "\205\35\1\0\0\1\0\0\0\0\0\0\5gmail\3com\0\0\34\0\1", 27, MSG_NOSIGNAL) = 27
poll([{fd=23, events=POLLIN, revents=POLLERR}], 1, 5000) = 1
close(23)                               = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 23
connect(23, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
fcntl64(23, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(23, F_SETFL, O_RDWR|O_NONBLOCK) = 0
gettimeofday({1178892714, 563192}, NULL) = 0
poll([{fd=23, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(23, "\205\35\1\0\0\1\0\0\0\0\0\0\5gmail\3com\0\0\34\0\1", 27, MSG_NOSIGNAL) = 27
poll([{fd=23, events=POLLIN, revents=POLLERR}], 1, 5000) = 1
close(23)                               = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 23
connect(23, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
fcntl64(23, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(23, F_SETFL, O_RDWR|O_NONBLOCK) = 0
gettimeofday({1178892714, 564500}, NULL) = 0
poll([{fd=23, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(23, "\205\35\1\0\0\1\0\0\0\0\0\0\5gmail\3com\0\0\34\0\1", 27, MSG_NOSIGNAL) = 27
poll([{fd=23, events=POLLIN, revents=POLLERR}], 1, 5000) = 1
close(23)                               = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 23
connect(23, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
fcntl64(23, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(23, F_SETFL, O_RDWR|O_NONBLOCK) = 0
gettimeofday({1178892714, 565804}, NULL) = 0
poll([{fd=23, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(23, "\205\35\1\0\0\1\0\0\0\0\0\0\5gmail\3com\0\0\34\0\1", 27, MSG_NOSIGNAL) = 27
poll([{fd=23, events=POLLIN, revents=POLLERR}], 1, 5000) = 1
close(23)                               = 0
time(NULL)                              = 1178892714
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
send(7, "<22>May 11 14:11:54 postfix/smtp"..., 241, MSG_NOSIGNAL) = 241
time(NULL)                              = 1178892714
select(10, NULL, [9], [9], {300, 0})    = 1 (out [9], left {300, 0})
write(9, "450 4.1.8 <costinel@gmail.com>: "..., 75) = 75
gettimeofday({1178892714, 567878}, NULL) = 0
select(10, [9], NULL, [9], {300, 0})    = 1 (in [9], left {299, 996000})
read(9, "QUIT\r\n", 4096)               = 6
gettimeofday({1178892714, 571880}, NULL) = 0
time(NULL)                              = 1178892714
select(10, NULL, [9], [9], {300, 0})    = 1 (out [9], left {300, 0})
write(9, "221 2.0.0 Bye\r\n", 15)       = 15
gettimeofday({1178892714, 572480}, NULL) = 0
time(NULL)                              = 1178892714
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("/etc/localtime", O_RDONLY)        = -1 ENOENT (No such file or directory)
send(7, "<22>May 11 14:11:54 postfix/smtp"..., 79, MSG_NOSIGNAL) = 79
close(9)                                = 0
write(5, "\35/\0\0\5\0\0\0\1\0\0\0", 12) = 12
time(NULL)                              = 1178892714
alarm(0)                                = 5913
flock(8, LOCK_EX)                       = 0
alarm(6000)                             = 0
time(NULL)                              = 1178892714
select(23, [5 6 22], [], [5 6 22], {13, 0} <unfinished ...>
Process 12061 detached


/etc/nsswitch.conf
hosts:      files dns

cat /etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver 192.168.2.101


cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   localhost
::1     localhost6.localdomain6 localhost6
192.168.2.61    mail50-out.domain.ro mail50-out