diff options
Diffstat (limited to 'qmail-remote.c')
| -rw-r--r-- | qmail-remote.c | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/qmail-remote.c b/qmail-remote.c index 49bd5c4..be997f0 100644 --- a/qmail-remote.c +++ b/qmail-remote.c | |||
| @@ -798,19 +798,14 @@ void qmtp() | |||
| 798 | zerodie(); | 798 | zerodie(); |
| 799 | } | 799 | } |
| 800 | 800 | ||
| 801 | stralloc canonhost = {0}; | ||
| 802 | stralloc canonbox = {0}; | 801 | stralloc canonbox = {0}; |
| 803 | 802 | ||
| 804 | void addrmangle(saout,s,flagalias,flagcname) | 803 | void addrmangle(saout,s) |
| 805 | stralloc *saout; /* host has to be canonical, box has to be quoted */ | 804 | stralloc *saout; /* host has to be canonical, box has to be quoted */ |
| 806 | char *s; | 805 | char *s; |
| 807 | int *flagalias; | ||
| 808 | int flagcname; | ||
| 809 | { | 806 | { |
| 810 | int j; | 807 | int j; |
| 811 | 808 | ||
| 812 | *flagalias = flagcname; | ||
| 813 | |||
| 814 | j = str_rchr(s,'@'); | 809 | j = str_rchr(s,'@'); |
| 815 | if (!s[j]) { | 810 | if (!s[j]) { |
| 816 | if (!stralloc_copys(saout,s)) temp_nomem(); | 811 | if (!stralloc_copys(saout,s)) temp_nomem(); |
| @@ -820,17 +815,7 @@ int flagcname; | |||
| 820 | canonbox.len = j; | 815 | canonbox.len = j; |
| 821 | if (!quote(saout,&canonbox)) temp_nomem(); | 816 | if (!quote(saout,&canonbox)) temp_nomem(); |
| 822 | if (!stralloc_cats(saout,"@")) temp_nomem(); | 817 | if (!stralloc_cats(saout,"@")) temp_nomem(); |
| 823 | 818 | if (!stralloc_cats(saout,s + j + 1)) temp_nomem(); | |
| 824 | if (!stralloc_copys(&canonhost,s + j + 1)) temp_nomem(); | ||
| 825 | if (flagcname) | ||
| 826 | switch(dns_cname(&canonhost)) { | ||
| 827 | case 0: *flagalias = 0; break; | ||
| 828 | case DNS_MEM: temp_nomem(); | ||
| 829 | case DNS_SOFT: temp_dnscanon(); | ||
| 830 | case DNS_HARD: ; /* alias loop, not our problem */ | ||
| 831 | } | ||
| 832 | |||
| 833 | if (!stralloc_cat(saout,&canonhost)) temp_nomem(); | ||
| 834 | } | 819 | } |
| 835 | 820 | ||
| 836 | void getcontrols() | 821 | void getcontrols() |
| @@ -860,8 +845,6 @@ char **argv; | |||
| 860 | unsigned long random; | 845 | unsigned long random; |
| 861 | char **recips; | 846 | char **recips; |
| 862 | unsigned long prefme; | 847 | unsigned long prefme; |
| 863 | int flagallaliases; | ||
| 864 | int flagalias; | ||
| 865 | char *relayhost; | 848 | char *relayhost; |
| 866 | 849 | ||
| 867 | sig_pipeignore(); | 850 | sig_pipeignore(); |
| @@ -902,18 +885,16 @@ char **argv; | |||
| 902 | } | 885 | } |
| 903 | 886 | ||
| 904 | 887 | ||
| 905 | addrmangle(&sender,argv[2],&flagalias,0); | 888 | addrmangle(&sender,argv[2]); |
| 906 | 889 | ||
| 907 | if (!saa_readyplus(&reciplist,0)) temp_nomem(); | 890 | if (!saa_readyplus(&reciplist,0)) temp_nomem(); |
| 908 | if (ipme_init() != 1) temp_oserr(); | 891 | if (ipme_init() != 1) temp_oserr(); |
| 909 | 892 | ||
| 910 | flagallaliases = 1; | ||
| 911 | recips = argv + 3; | 893 | recips = argv + 3; |
| 912 | while (*recips) { | 894 | while (*recips) { |
| 913 | if (!saa_readyplus(&reciplist,1)) temp_nomem(); | 895 | if (!saa_readyplus(&reciplist,1)) temp_nomem(); |
| 914 | reciplist.sa[reciplist.len] = sauninit; | 896 | reciplist.sa[reciplist.len] = sauninit; |
| 915 | addrmangle(reciplist.sa + reciplist.len,*recips,&flagalias,!relayhost); | 897 | addrmangle(reciplist.sa + reciplist.len,*recips); |
| 916 | if (!flagalias) flagallaliases = 0; | ||
| 917 | ++reciplist.len; | 898 | ++reciplist.len; |
| 918 | ++recips; | 899 | ++recips; |
| 919 | } | 900 | } |
| @@ -937,7 +918,6 @@ char **argv; | |||
| 937 | prefme = ip.ix[i].pref; | 918 | prefme = ip.ix[i].pref; |
| 938 | 919 | ||
| 939 | if (relayhost) prefme = 300000; | 920 | if (relayhost) prefme = 300000; |
| 940 | if (flagallaliases) prefme = 500000; | ||
| 941 | 921 | ||
| 942 | for (i = 0;i < ip.len;++i) | 922 | for (i = 0;i < ip.len;++i) |
| 943 | if (ip.ix[i].pref < prefme) | 923 | if (ip.ix[i].pref < prefme) |
