I am working on a project where I need to create a SMTP server to send and receive emails. I've configured a server on ubuntu using postfix. It's working completely fine. I can send email and also can receive emails. But the problem is when I try to send multiple emails(sending email from java code) at once then only 1-2 of emails delivers, rest of them goes in mail queue. and the response I got in log file is as below
mailto postfix/qmgr[24883]: 768DE26068: from=<ankit@myserver.com>, size=440, nrcpt=1 (queue active)
Sep 29 09:18:02 mailto postfix/smtpd[24956]: disconnect from unknown[220.227.69.18]
Sep 29 09:18:28 mailto postfix/smtp[24963]: connect to ASPMX.L.GOOGLE.com[74.125.129.26]:25: Connection timed out
I don't know why the emails going in queue? I have googled this problem and found that this problem is due to ipv6 configuration. But my configuration is ipv4. This should work.
Please look into this. And suggest me some useful solutions.
UPDATE
my postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
home_mailbox = Maildir/
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
inet_protocols = ipv4
mailbox_command =
mailbox_size_limit = 0
mydestination = myserver.com, localhost.localdomain, localhost
myhostname = mailto.myserver.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 54.191.22.0/24
myorigin = /etc/mailname
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix
recipient_delimiter = +
relayhost =
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks, reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/ssl/certs/server.crt
smtpd_tls_key_file = /etc/ssl/private/server.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = hash:/etc/postfix/transport
virtual_alias_maps = hash:/etc/postfix/virtual_aliases