Skip to content
Snippets Groups Projects
Commit 7ece5c1d authored by rswindell's avatar rswindell
Browse files

New feature: mail_startup_t.relay_port = configurable TCP port for SMTP relay...

New feature: mail_startup_t.relay_port = configurable TCP port for SMTP relay server (previously hard-coded to 25).
parent a71d6c39
No related branches found
No related tags found
No related merge requests found
......@@ -2099,9 +2099,13 @@ static void sendmail_thread(void* arg)
memset(&server_addr,0,sizeof(server_addr));
server_addr.sin_addr.s_addr = ip_addr;
server_addr.sin_family = AF_INET;
server_addr.sin_port = htons(IPPORT_SMTP);
if(startup->options&MAIL_OPT_RELAY_TX)
server_addr.sin_port = htons(startup->relay_port);
else
server_addr.sin_port = htons(IPPORT_SMTP);
lprintf("SendMail: connecting to %s [%s]"
lprintf("SendMail: connecting to port %u on %s [%s]"
,ntohs(server_addr.sin_port)
,server,inet_ntoa(server_addr.sin_addr));
if((i=connect(sock, (struct sockaddr *)&server_addr, sizeof(server_addr)))!=0) {
lprintf("!SendMail: ERROR %d (%d) connecting to SMTP server: %s"
......@@ -2301,6 +2305,9 @@ void mail_server(void* arg)
return;
}
if(startup->relay_port==0)
startup->relay_port=IPPORT_SMTP;
thread_up();
status("Initializing");
......@@ -2438,13 +2445,13 @@ void mail_server(void* arg)
,sizeof (server_addr));
if (result != 0) {
lprintf("!ERROR %d (%d) binding SMTP socket to port %d"
lprintf("!ERROR %d (%d) binding SMTP socket to port %u"
,result, ERROR_VALUE, startup->smtp_port);
cleanup(1);
return;
}
lprintf("SMTP socket bound to port %d",startup->smtp_port);
lprintf("SMTP socket bound to port %u",startup->smtp_port);
result = listen (server_socket, 1);
......
......@@ -46,7 +46,7 @@ typedef struct {
WORD max_inactivity;
WORD max_delivery_attempts;
WORD rescan_frequency; /* In seconds */
WORD reserved_word3;
WORD relay_port;
WORD reserved_word2;
WORD reserved_word1;
DWORD interface_addr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment