~ubuntu-branches/ubuntu/vivid/exim4/vivid

« back to all changes in this revision

Viewing changes to src/daemon.c

  • Committer: Package Import Robot
  • Author(s): Corey Bryant
  • Date: 2014-08-04 11:48:39 UTC
  • mfrom: (56.1.2 utopic)
  • Revision ID: package-import@ubuntu.com-20140804114839-xoulpcx9nxi5m72u
Tags: 4.84~RC1-3ubuntu1
* Merge from Debian unstable (LP: #1351470). Remaining changes:
  - Show Ubuntu distribution on smtp:
    + debian/patches/fix_smtp_banner.patch: updated SMTP banner
      with Ubuntu distribution
    + debian/control: added lsb-release build dependency
  - Don't provide default-mta; in Ubuntu, we want postfix to be the
    default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
*     Exim - an Internet mail transport agent    *
3
3
*************************************************/
4
4
 
5
 
/* Copyright (c) University of Cambridge 1995 - 2012 */
 
5
/* Copyright (c) University of Cambridge 1995 - 2014 */
6
6
/* See the file NOTICE for conditions of use and distribution. */
7
7
 
8
8
/* Functions concerned with running Exim as a daemon */
1127
1127
 
1128
1128
  list = daemon_smtp_port;
1129
1129
  sep = 0;
1130
 
  while ((s = string_nextinlist(&list,&sep,big_buffer,big_buffer_size)) != NULL)
 
1130
  while ((s = string_nextinlist(&list,&sep,big_buffer,big_buffer_size)))
1131
1131
    pct++;
1132
1132
  default_smtp_port = store_get((pct+1) * sizeof(int));
1133
1133
  list = daemon_smtp_port;
1134
1134
  sep = 0;
1135
1135
  for (pct = 0;
1136
 
       (s = string_nextinlist(&list,&sep,big_buffer,big_buffer_size)) != NULL;
 
1136
       (s = string_nextinlist(&list,&sep,big_buffer,big_buffer_size));
1137
1137
       pct++)
1138
1138
    {
1139
1139
    if (isdigit(*s))
1146
1146
    else
1147
1147
      {
1148
1148
      struct servent *smtp_service = getservbyname(CS s, "tcp");
1149
 
      if (smtp_service == NULL)
 
1149
      if (!smtp_service)
1150
1150
        log_write(0, LOG_PANIC_DIE|LOG_CONFIG, "TCP port \"%s\" not found", s);
1151
1151
      default_smtp_port[pct] = ntohs(smtp_service->s_port);
1152
1152
      }
1153
1153
    }
1154
1154
  default_smtp_port[pct] = 0;
1155
1155
 
 
1156
  /* Check the list of TLS-on-connect ports and do name lookups if needed */
 
1157
 
 
1158
  list = tls_in.on_connect_ports;
 
1159
  sep = 0;
 
1160
  while ((s = string_nextinlist(&list, &sep, big_buffer, big_buffer_size)))
 
1161
    if (!isdigit(*s))
 
1162
      {
 
1163
      list = tls_in.on_connect_ports;
 
1164
      tls_in.on_connect_ports = NULL;
 
1165
      sep = 0;
 
1166
      while ((s = string_nextinlist(&list, &sep, big_buffer, big_buffer_size)))
 
1167
        {
 
1168
        if (!isdigit(*s))
 
1169
          {
 
1170
          struct servent *smtp_service = getservbyname(CS s, "tcp");
 
1171
          if (!smtp_service)
 
1172
            log_write(0, LOG_PANIC_DIE|LOG_CONFIG, "TCP port \"%s\" not found", s);
 
1173
          s= string_sprintf("%d", (int)ntohs(smtp_service->s_port));
 
1174
          }
 
1175
        tls_in.on_connect_ports = string_append_listele(tls_in.on_connect_ports,
 
1176
            ':', s);
 
1177
        }
 
1178
      break;
 
1179
      }
 
1180
 
1156
1181
  /* Create the list of local interfaces, possibly with ports included. This
1157
1182
  list may contain references to 0.0.0.0 and ::0 as wildcards. These special
1158
1183
  values are converted below. */
2065
2090
/* Control never reaches here */
2066
2091
}
2067
2092
 
 
2093
/* vi: aw ai sw=2
 
2094
*/
2068
2095
/* End of exim_daemon.c */
2069