1 (edited by alessice 2017-05-02 21:08:12)

Topic: How to check if iRedAPD is alive and working?

==== Required information ====
- iRedMail version (check /etc/iredmail-release):  iRedMail-0.9.6
- Linux/BSD distribution name and version: Debian 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====

Hi, I'm running iRedMail with iRedAPD-2.0 and only the throttle module enabled. Today postfix stop to receive emails with this error:

May  2 10:51:41 smtp postfix/smtp/smtpd[24524]: warning: connect to 10.0.0.1:7777: Connection refused
  2 10:51:41 smtp postfix/smtp/smtpd[24524]: warning: problem talking to server 10.0.0.1:7777: Connection refused
May  2 10:51:41 smtp postfix/smtp/smtpd[24524]: NOQUEUE: reject: RCPT from unknown[191.87.19.206]: 451 4.3.5 Server configuration problem; from=<servi@xxxxx.it> to=<roba@xxxxx.it> proto=ESMTP helo=<[192.168.1.3]>

only after a restart of iredapd the problem was solved. But iredapd daemon was running and in the log there was no error:

2017-05-02 11:02:26 INFO 188.47.2.9 RCPT, info@xxxx.com => paola@xxxx.com, DUNNO [0.0062s]
2017-05-02 11:02:26 INFO 188.47.2.9 END-OF-MESSAGE, info@xxxxx.com => paola@xxxx.com, DUNNO [0.0053s]
2017-05-02 11:09:58 INFO Starting iRedAPD (version: 2.0, backend: mysql), listening on 0.0.0.0:7777.
2017-05-02 11:09:58 INFO Log rotate type: time, interval: W6, backup copies: 12.
2017-05-02 11:09:58 INFO Loading plugin (priority: 60): throttle
2017-05-02 11:09:58 INFO [188.155.22.4] sender throttle, in@xxxxx.it -> max_msgs (36/400, period: 14400 seconds, time left: 1 hours, 42 minutes, 20 seconds)

So I woulk like to create a script (in python) to check if iredapd is alive and working. Once connect to 7777 port how can we interrogate the daemon to undestand if it works?

Thanks

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: How to check if iRedAPD is alive and working?

Usually if port is open, it's alive. if you want to do some testing, try to send sample smtp session data to iRedAPD and get a returned action (text).

Sample code could be found in recently committed unit tests:
https://bitbucket.org/zhb/iredapd/src/e … ew-default

functions: set_smtp_session, send_policy.