0

The emails are not being sent to email addresses with domainname.co as domain name.

I have in Ubuntu system three users namely root, ubuntu & domainname.

The following is the log(tail /var/log/mail.log -n 20)

Feb 19 04:36:56 server postfix/pickup[22963]: 521A0106D3A: uid=1003 from=<domainname>
Feb 19 04:36:56 server postfix/cleanup[26043]: 521A0106D3A: message-id=<[email protected]>
Feb 19 04:36:56 server postfix/qmgr[14300]: 521A0106D3A: from=<[email protected]>, size=357, nrcpt=1 (queue active)
Feb 19 04:36:58 server postfix/smtp[26045]: 521A0106D3A: to=<[email protected]>, relay=in.hes.trendmicro.com[54.219.191.20]:25, delay=1.9, delays=0.01/0.01/1.6/0.21, dsn=5.7.1, status=bounced (host in.hedmicro.com[54.219.191.20] said: 550 5.7.1 <[email protected]>: Recipient address rejected: ERS-DUL. (in reply to RCPT TO command))
Feb 19 04:36:58 server postfix/cleanup[26043]: 732DD106D41: message-id=<[email protected]>
Feb 19 04:36:58 server postfix/bounce[26046]: 521A0106D3A: sender non-delivery notification: 732DD106D41
Feb 19 04:36:58 server postfix/qmgr[14300]: 732DD106D41: from=<>, size=2368, nrcpt=1 (queue active)
Feb 19 04:36:58 server postfix/qmgr[14300]: 521A0106D3A: removed
Feb 19 04:36:59 server postfix/smtp[26045]: 732DD106D41: to=<[email protected]>, relay=in.hes.trendmicro.com[54.219.191.21]:25, delay=1.5, delays=0/0/1.3/0.21, dsn=5.7.1, status=bounced (host in.hes.trendmicro.com[54.219.191.21] said: 550 5.7.1 <[email protected]>: Recipient address rejected: ERS-DUL. (in reply to RCPT TO command))
Feb 19 04:37:00 server postfix/qmgr[14300]: 732DD106D41: removed

The content of the /etc/postfix/main.cf

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

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = server.domainname.co
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
#myorigin = /etc/mailname
myorigin = $mydomain
mydestination = $myhostname, server, localhost.domainname.co, localhost
#smtp_generic_maps = texthash:/etc/postfix/generic
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtp_tls_security_level = may
allow_percent_hack = no

I am checking this with below script.

$sender = '[email protected]';
$recipient = '[email protected]';

$subject = "php mail test";
$message = "php test message";
$headers = 'From:' . $sender;

if (mail($recipient, $subject, $message, $headers)) {
        echo "Message accepted";
} else {
        echo "Error: Message not accepted";
}

UPDATE: The current answer will not help as the error code changed after some configuration changes in main.cf file.

3 Answers 3

4
+50

The message:

Feb 19 04:36:59 server postfix/smtp[26045]: 732DD106D41: to=<[email protected]>, relay=in.hes.trendmicro.com[54.219.191.21]:25, delay=1.5, delays=0/0/1.3/0.21, dsn=5.7.1, status=bounced (host in.hes.trendmicro.com[54.219.191.21] said: 550 5.7.1 <[email protected]>: Recipient address rejected: ERS-DUL. (in reply to RCPT TO command))

means that the SMTP server in.hes.trendmicro.com[54.219.191.21] is rejecting messages because they are coming from a source IP address listed in Dynamic/Dialup Users List. Most mail servers only accept messages coming from static IP addresses to reduce spam traffic.

According to instructions provided here, you may need to talk to your internet provider and ask them to remove your IP address from ERS-DUL blacklist:

Dynamic User List (DUL) Database This contains IP addresses or an IP block from ISPs for their dial-up users who have been spam sources.

To remove an IP from the database, users should do any of the following:

  • Contact the ISP, who will then make a request via:

    Provide the reason why you want to remove the IP address(es).

  • Configure the mail client on their own mail server to relay outbound mail through the ISP's designated mail relay.

3
  • Thank you. I think the issue should be this only. If this works I will accept the answer. Feb 19, 2020 at 10:48
  • 1
    Do keep in mind that some ISPs won't do this, as they report all their non-commercial IPs to these IP reputation lists, and will instead want you to buy a commercial subscription.
    – Stuggi
    Feb 19, 2020 at 11:36
  • Your internet service provider likely will not do this for you and you may have to pay an additional one-time or monthly fee for a static IP address from them. You may want to consider running Postfix in the cloud if this is problematic.
    – rhw5
    Feb 22, 2020 at 22:17
2

Error code 554 means IP-Blocking: A remote mail server is not currently accepting emails from a server IP address. This IP blocking may be due to a previously observed unusual volume of emails at the IP address concerned.

You will need to contact someone at Apple to resolve this or ask your ISP for a new IP. Please note that getting a New IP does not guarantee to solve your problem. Many times a company may block a range of IP's because an individual was abusing it. (sending SPAM, DDOS attacks, etc).

Contacting Apple is a bit tricky but you'll call their 800-275-2273 and ask for Enterprise support or Online Services. Someone maybe able to take your request and redirect it to the appropriate person. You may not hear back from them so you'll have to keep trying.

1

The best thing todo without to rewrite your script is to setup a mailbox on your local machine, best take dovecot that listens on 127.0.0.1

your public IP-Adress (Dial-IN), best you take a static one for your campaigns which you make use in your doman.

1) create an MX-Record and place there your public IP-Adress (should be at best static) 2) register at mandrill, mailjet.com and order a package and follow the steps.

3) create a file called: /etc/postfix/sasl_passwd with it's content:

[smtphost.provider.com]:port username:password

replace the content in the bracket with the smtp of your mail provider and port with the port number along with the Emailadress and password.

4) run /usr/sbin/postmap /etc/postfix/sasl_passwd

Add the content at the end of your main.cf:

relayhost=[in-v3.mailjet.com]:587
smtp_sasl_auth_enable=yes
smtp_sasl_security_options=noanonymous
smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
smtp_use_tls=yes

(i took that one from mailjet for an example)

then you can sendout your campaigns through this provider, and not that one from the dialup address and your mails should be delivered without any problems.

Be aware to keep the quality of mails to be delivered.

Sending SPAM can also easily blocked and is illegal...

But if you want to run from time to time your campaigns for your customers then this is the best way.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .