PowerMTA allow an IP to sent email
To allow a web server to send email through PowerMTA with out autentication, you need to edit PowerMTA configuration file
1 |
vi /etc/pmta/config |
Add a source entry for the IP address that you need to allow relaying mails
1 2 3 4 |
<source IP_ADDRESS/32> always-allow-relaying yes smtp-service yes </source> |
Replace IP_ADDRESS with IP address of web server that you need to allow sending email with out autentication.
Restart PowerMTA
1 |
systemctl restart pmta |
With out source entry, if you try to sent email, you will be rejected with error “550 5.7.1 relaying denied for recipient”.
Example using swaks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
=== Trying smtp1.serverok.in:2525... === Connected to smtp1.serverok.in. <- 220 smtp1.serverok.in ESMTP service ready -> EHLO lab.serverok.in <- 250-smtp1.serverok.in says hello <- 250-ENHANCEDSTATUSCODES <- 250-PIPELINING <- 250-CHUNKING <- 250-8BITMIME <- 250-AUTH CRAM-MD5 <- 250-AUTH=CRAM-MD5 <- 250-XACK <- 250-SIZE 0 <- 250-VERP <- 250-SMTPUTF8 <- 250 DSN -> MAIL FROM:<root@lab.serverok.in> <- 250 2.1.0 MAIL ok -> RCPT TO:<admin@serverok.in> -> QUIT <- 221 2.0.0 smtp1.serverok.in says goodbye === Connection closed with remote host. root@lab:~# |
See PowerMTA