Quantcast
Channel: iRedMail
Viewing all articles
Browse latest Browse all 14130

Unable to send email via Perl script

$
0
0

==== Required information ====
- iRedMail version: 0.9.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):Apache
- Linux/BSD distribution name and version: CentOS
- Related log if you're reporting an issue:
====

Hi, I tried to send mail from webmail and it was success. However when I was trying to send email from Perl with MIME:Lite module and Net:SMTPS it fails. Script does not return an error code or raise error during authentication but was silently rejected by Postfix. Can anybody help me please? Thanks.

Perl Code:
my $username = 'support@mail.knowsg.com';
my $password = 'XXXX';
my $email = Net::SMTPS->new("localhost",
                                Port => 587,
                                doSSL =>'starttls');

if(!$email->auth($username, $password)) {
        errorReport($0, "Email SMTP authentication", "", "");
        die "Email SMTP authentication";
}
emailSend($email, 'loudking@gmail.com', 'Message expired at KnowSG.com', 'Test');

LOG file of /var/log/maillog
< May  5 13:24:00 knowsg postfix/smtpd[4904]: connect from localhost[::1]
< May  5 13:24:00 knowsg postfix/trivial-rewrite[4909]: warning: do not list domain mail.knowsg.com in BOTH virtual_mailbox_domains and relay_domains
< May  5 13:24:00 knowsg postfix/smtpd[4904]: NOQUEUE: reject: RCPT from localhost[::1]: 450 4.7.1 <loudking@gmail.com>: Recipient address rejected: Access denied; from=<support@mail.knowsg.com> to=<loudking@gmail.com> proto=ESMTP helo=<localhost.localdomain>
< May  5 13:24:00 knowsg postfix/smtpd[4904]: warning: non-SMTP command from localhost[::1]: MIME-Version: 1.0
< May  5 13:24:00 knowsg postfix/smtpd[4904]: disconnect from localhost[::1]

Then I changed hostname from localhost to 'knowsg.com' but script still fails.
LOG /var/log/maillog:

< May  5 13:27:20 knowsg postfix/anvil[4906]: statistics: max connection rate 1/60s for (submission:::1) at May  5 13:24:00
< May  5 13:27:20 knowsg postfix/anvil[4906]: statistics: max connection count 1 for (submission:::1) at May  5 13:24:00
< May  5 13:27:20 knowsg postfix/anvil[4906]: statistics: max cache size 1 at May  5 13:24:00
< May  5 13:27:39 knowsg postfix/smtpd[4923]: connect from localhost.localdomain[127.0.0.1]
< May  5 13:27:39 knowsg postfix/trivial-rewrite[4927]: warning: do not list domain mail.knowsg.com in BOTH virtual_mailbox_domains and relay_domains
< May  5 13:27:39 knowsg postfix/smtpd[4923]: 41B476B423A8: client=localhost.localdomain[127.0.0.1], sasl_method=PLAIN, sasl_username=support@mail.knowsg.com
< May  5 13:27:39 knowsg postfix/cleanup[4932]: 41B476B423A8: message-id=<20150505052739.41B476B423A8@knowsg.com>
< May  5 13:27:39 knowsg postfix/qmgr[1693]: 41B476B423A8: from=<support@mail.knowsg.com>, size=575, nrcpt=1 (queue active)
< May  5 13:27:39 knowsg postfix/smtpd[4923]: disconnect from localhost.localdomain[127.0.0.1]
< May  5 13:27:41 knowsg postfix/smtpd[4941]: connect from localhost.localdomain[127.0.0.1]
< May  5 13:27:41 knowsg postfix/trivial-rewrite[4927]: warning: do not list domain mail.knowsg.com in BOTH virtual_mailbox_domains and relay_domains
< May  5 13:27:41 knowsg postfix/smtpd[4941]: D88066B43F42: client=localhost.localdomain[127.0.0.1]
< May  5 13:27:41 knowsg postfix/cleanup[4932]: D88066B43F42: message-id=<20150505052739.41B476B423A8@knowsg.com>
< May  5 13:27:41 knowsg postfix/qmgr[1693]: D88066B43F42: from=<support@mail.knowsg.com>, size=1636, nrcpt=1 (queue active)
< May  5 13:27:41 knowsg postfix/smtpd[4941]: disconnect from localhost.localdomain[127.0.0.1]
< May  5 13:27:41 knowsg amavis[3825]: (03825-01) Passed CLEAN {RelayedInternal}, MYNETS/MYUSERS LOCAL [127.0.0.1]:50257 <support@mail.knowsg.com> -> <loudking@gmail.com>, Queue-ID: 41B476B423A8, Message-ID: <20150505052739.41B476B423A8@knowsg.com>, mail_id: MzOwOM7iraIV, Hits: 1.017, size: 575, queued_as: D88066B43F42, dkim_new=dkim:mail.knowsg.com, 2568 ms
< May  5 13:27:41 knowsg postfix/smtp[4938]: 41B476B423A8: to=<loudking@gmail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.7, delays=0.09/0.02/0.01/2.6, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as D88066B43F42)
< May  5 13:27:41 knowsg postfix/qmgr[1693]: 41B476B423A8: removed
< May  5 13:27:45 knowsg postfix/smtp[4942]: D88066B43F42: to=<loudking@gmail.com>, relay=gmail-smtp-in.l.google.com[74.125.130.27]:25, delay=3.8, delays=0.01/0.02/1.6/2.2, dsn=2.0.0, status=sent (250 2.0.0 OK 1430803665 x11si22626294pbt.40 - gsmtp)
< May  5 13:27:45 knowsg postfix/qmgr[1693]: D88066B43F42: removed


Viewing all articles
Browse latest Browse all 14130

Trending Articles