mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-12 19:33:03 +00:00
Implemented SMTP port
This commit is contained in:
parent
ee7bc3873d
commit
4473be5eaf
@ -276,6 +276,11 @@ Welcome title = <img src="welcome.jpg"><p><font size=5 color=whit
|
|||||||
elogd -t <your password>
|
elogd -t <your password>
|
||||||
</pre>
|
</pre>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<b><code>SMTP port = <port></code></b><br>
|
||||||
|
This defines the port under which the SMTP server is listening. The
|
||||||
|
default is 25, but some newer servers use port 587.
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><code>Logfile = <file></code></b><br>
|
<b><code>Logfile = <file></code></b><br>
|
||||||
This option specifies a filename which logs all login/logout activities
|
This option specifies a filename which logs all login/logout activities
|
||||||
|
|||||||
18
src/elogd.c
18
src/elogd.c
@ -2173,10 +2173,17 @@ int sendmail(LOGBOOK * lbs, char *smtp_host, char *from, char *to, char *text, c
|
|||||||
if (s == -1)
|
if (s == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* connect to remote node port 25 */
|
strsize = MAX_CONTENT_LENGTH + 1000;
|
||||||
|
str = xmalloc(strsize);
|
||||||
|
|
||||||
|
/* connect to remote node port on SMTP port */
|
||||||
|
int smtp_port = 25;
|
||||||
|
if (getcfg(lbs->name, "SMTP port", str, strsize))
|
||||||
|
smtp_port = atoi(str);
|
||||||
|
|
||||||
memset(&bind_addr, 0, sizeof(bind_addr));
|
memset(&bind_addr, 0, sizeof(bind_addr));
|
||||||
bind_addr.sin_family = AF_INET;
|
bind_addr.sin_family = AF_INET;
|
||||||
bind_addr.sin_port = htons((short) 25);
|
bind_addr.sin_port = htons((short) smtp_port);
|
||||||
|
|
||||||
phe = gethostbyname(smtp_host);
|
phe = gethostbyname(smtp_host);
|
||||||
if (phe == NULL) {
|
if (phe == NULL) {
|
||||||
@ -2193,9 +2200,6 @@ int sendmail(LOGBOOK * lbs, char *smtp_host, char *from, char *to, char *text, c
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
strsize = MAX_CONTENT_LENGTH + 1000;
|
|
||||||
str = xmalloc(strsize);
|
|
||||||
|
|
||||||
recv_string(s, str, strsize, 10000);
|
recv_string(s, str, strsize, 10000);
|
||||||
if (get_verbose() >= VERBOSE_INFO)
|
if (get_verbose() >= VERBOSE_INFO)
|
||||||
efputs(str);
|
efputs(str);
|
||||||
@ -22671,7 +22675,7 @@ int compose_email(LOGBOOK * lbs, char *rcpt_to, char *mail_to, int message_id,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
sprintf(str, loc("Error sending Email via <i>\"%s\"</i>"), smtp_host);
|
sprintf(str, loc("Error sending Email via \"%s\""), smtp_host);
|
||||||
if (error[0]) {
|
if (error[0]) {
|
||||||
strlcat(str, ": ", sizeof(str));
|
strlcat(str, ": ", sizeof(str));
|
||||||
strlcat(str, error, sizeof(str));
|
strlcat(str, error, sizeof(str));
|
||||||
@ -22679,7 +22683,7 @@ int compose_email(LOGBOOK * lbs, char *rcpt_to, char *mail_to, int message_id,
|
|||||||
url_encode(str, sizeof(str));
|
url_encode(str, sizeof(str));
|
||||||
sprintf(mail_param, "?error=%s", str);
|
sprintf(mail_param, "?error=%s", str);
|
||||||
} else if (error[0]) {
|
} else if (error[0]) {
|
||||||
sprintf(str, loc("Error sending Email via <i>\"%s\"</i>"), smtp_host);
|
sprintf(str, loc("Error sending Email via \"%s\""), smtp_host);
|
||||||
strlcat(str, ": ", sizeof(str));
|
strlcat(str, ": ", sizeof(str));
|
||||||
strlcat(str, error, sizeof(str));
|
strlcat(str, error, sizeof(str));
|
||||||
url_encode(str, sizeof(str));
|
url_encode(str, sizeof(str));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user