| | @@ -20,21 +20,20 @@ |
| 20 | 20 | */ |
| 21 | 21 | #include "config.h" |
| 22 | 22 | #include "smtp.h" |
| 23 | 23 | #include <assert.h> |
| 24 | 24 | |
| 25 | +#ifdef __linux__ |
| 26 | +# define FOSSIL_ENABLE_DNS_LOOKUP |
| 27 | +#endif |
| 25 | 28 | |
| 26 | | -#if !defined(FOSSIL_OMIT_SMTP) |
| 27 | | -#if defined(_WIN32) |
| 28 | | - /* Don't yet know how to do this on windows */ |
| 29 | | -#else |
| 29 | +#if defined(FOSSIL_ENABLE_DNS_LOOKUP) |
| 30 | 30 | # include <sys/types.h> |
| 31 | 31 | # include <netinet/in.h> |
| 32 | 32 | # include <arpa/nameser.h> |
| 33 | 33 | # include <resolv.h> |
| 34 | | -#endif |
| 35 | | -#endif /* !defined(FOSSIL_OMIT_SMTP) */ |
| 34 | +#endif /* defined(FOSSIL_ENABLE_DNS_LOOKUP) */ |
| 36 | 35 | |
| 37 | 36 | |
| 38 | 37 | /* |
| 39 | 38 | ** Find the hostname for receiving email for the domain given |
| 40 | 39 | ** in zDomain. Return NULL if not found or not implemented. |
| | @@ -43,11 +42,11 @@ |
| 43 | 42 | ** |
| 44 | 43 | ** The returned string is obtained from fossil_malloc() |
| 45 | 44 | ** and should be released using fossil_free(). |
| 46 | 45 | */ |
| 47 | 46 | char *smtp_mx_host(const char *zDomain){ |
| 48 | | -#if !defined(_WIN32) && !defined(FOSSIL_OMIT_SMTP) |
| 47 | +#if defined(FOSSIL_ENABLE_DNS_LOOKUP) |
| 49 | 48 | int nDns; /* Length of the DNS reply */ |
| 50 | 49 | int rc; /* Return code from various APIs */ |
| 51 | 50 | int i; /* Loop counter */ |
| 52 | 51 | int iBestPriority = 9999999; /* Best priority */ |
| 53 | 52 | int nRec; /* Number of answers */ |
| | @@ -81,11 +80,11 @@ |
| 81 | 80 | if( pBest ){ |
| 82 | 81 | ns_name_uncompress(aDns, aDns+nDns, pBest+2, |
| 83 | 82 | zHostname, sizeof(zHostname)); |
| 84 | 83 | return fossil_strdup(zHostname); |
| 85 | 84 | } |
| 86 | | -#endif /* not windows */ |
| 85 | +#endif /* defined(FOSSIL_ENABLE_DNS_LOOKUP) */ |
| 87 | 86 | return 0; |
| 88 | 87 | } |
| 89 | 88 | |
| 90 | 89 | /* |
| 91 | 90 | ** COMMAND: test-find-mx |
| | @@ -670,10 +669,29 @@ |
| 670 | 669 | } |
| 671 | 670 | if( eForce==1 || !db_table_exists("repository","emailblob") ){ |
| 672 | 671 | db_multi_exec(zEmailSchema/*works-like:""*/); |
| 673 | 672 | } |
| 674 | 673 | } |
| 674 | + |
| 675 | +/* |
| 676 | +** WEBPAGE: setup_smtp |
| 677 | +** |
| 678 | +** Administrative page for configuring and controlling inbound email and |
| 679 | +** output email queuing. This page is available to administrators |
| 680 | +** only via the /Admin/EmailServer menu. |
| 681 | +*/ |
| 682 | +void setup_smtp(void){ |
| 683 | + login_check_credentials(); |
| 684 | + if( !g.perm.Setup ){ |
| 685 | + login_needed(0); |
| 686 | + return; |
| 687 | + } |
| 688 | + style_header("Email Server Setup"); |
| 689 | + @ <i>Pending...</i> |
| 690 | + style_footer(); |
| 691 | +} |
| 692 | + |
| 675 | 693 | |
| 676 | 694 | #if LOCAL_INTERFACE |
| 677 | 695 | /* |
| 678 | 696 | ** State information for the server |
| 679 | 697 | */ |
| 680 | 698 | |