我需要在mysql数据库中打开exim relay到ips列表。 我想如果我可以在电子邮件排队之前运行脚本,我可以这样做。有办法吗? Windows的Mail Enable有一个类似的解决方案叫做" SMTP Inbound Command Scripting"。
答案 0 :(得分:1)
# configure
. . . . .
hide mysql_servers = localhost/myoneandonlybase/login/pass
hostlist myfriends = ${lookup mysql{SELECT ipaddr FROM submitters}}
. . . . .
acl_smtp_connect = acl_conn
acl_smtp_rcpt = acl_rcpt
acl_smtp_data = acl_data
. . . . .
begin acl
acl_conn:
accept hosts = +myfriends
. . . . .
acl_rcpt:
accept hosts = +myfriends
. . . . .
acl_data:
accept hosts = +myfriends
. . . . .
答案 1 :(得分:0)
默认的exim配置文件已经有一个主机列表relay_from_hosts
,您可以使用SQL查找轻松填充该主机列表并获得所需的结果:
hide mysql_servers = localhost/myoneandonlybase/login/pass
hostlist relay_to_domains = ${lookup mysql{SELECT ipaddr FROM submitters}}
只需要这样做。