summaryrefslogtreecommitdiffstats
path: root/util/outmail.c
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-09-18 18:51:17 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-09-18 18:51:17 +0800
commitaa4c377e6ef814a52c7f6b7ec559f1507dd550d5 (patch)
tree9d8be5c3e4bce0b79a54f1698ead6159cc7e0072 /util/outmail.c
parent63d1fd611bc531eeadb5fbd0dd18055c70b710c8 (diff)
downloadpttbbs-aa4c377e6ef814a52c7f6b7ec559f1507dd550d5.tar
pttbbs-aa4c377e6ef814a52c7f6b7ec559f1507dd550d5.tar.gz
pttbbs-aa4c377e6ef814a52c7f6b7ec559f1507dd550d5.tar.bz2
pttbbs-aa4c377e6ef814a52c7f6b7ec559f1507dd550d5.tar.lz
pttbbs-aa4c377e6ef814a52c7f6b7ec559f1507dd550d5.tar.xz
pttbbs-aa4c377e6ef814a52c7f6b7ec559f1507dd550d5.tar.zst
pttbbs-aa4c377e6ef814a52c7f6b7ec559f1507dd550d5.zip
remove unused option (-o)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3190 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/outmail.c')
-rw-r--r--util/outmail.c39
1 files changed, 8 insertions, 31 deletions
diff --git a/util/outmail.c b/util/outmail.c
index 7f036c4f..5d5c9d37 100644
--- a/util/outmail.c
+++ b/util/outmail.c
@@ -6,8 +6,8 @@
#define NEWINDEX SPOOL "/.DIR.sending"
#define FROM ".bbs@" MYHOSTNAME
#define SMTPPORT 25
-char *smtpname, *hiname;
-int smtpport, hiport;
+char *smtpname;
+int smtpport;
char disclaimer[1024];
/* qp_encode() modified from mutt-1.5.7/rfc2047.c q_encoder() */
@@ -151,7 +151,7 @@ void doSendMail(int sock, FILE *fp, char *from, char *to, char *subject) {
}
void sendMail() {
- int fd, smtpsock, hisock;
+ int fd, smtpsock;
MailQueue mq;
if(access(NEWINDEX, R_OK | W_OK)) {
@@ -161,13 +161,8 @@ void sendMail() {
}
smtpsock = connectMailServer(smtpname, smtpport);
- hisock = (hiname != NULL) ? connectMailServer(hiname, hiport) : -1;
- if( smtpsock < 0 && hisock >= 0 ){
- smtpsock = hisock;
- hisock = -1;
- }
- if( smtpsock < 0 && hisock < 0 ){
+ if( smtpsock < 0) {
fprintf(stderr, "connecting to relay server failure...\n");
return;
}
@@ -181,20 +176,8 @@ void sendMail() {
snprintf(buf, sizeof(buf), "%s%s", mq.sender, FROM);
if((fp = fopen(mq.filepath, "r"))) {
setproctitle("outmail: sending %s", mq.filepath);
- if( hisock >= 0 &&
- !strstr(mq.rcpt, ".edu.tw") &&
- !strstr(mq.rcpt, ".twbbs.org") &&
- !strstr(mq.rcpt, "ptt.cc") &&
- !strstr(mq.rcpt, "ptt2.cc") ){
- printf("mailto: %s, relay server: %s:%d\n",
- mq.rcpt, hiname, hiport);
- doSendMail(hisock, fp, buf, mq.rcpt, mq.subject);
- }
- else{
- printf("mailto: %s, relay server: %s:%d\n",
- mq.rcpt, smtpname, smtpport);
- doSendMail(smtpsock, fp, buf, mq.rcpt, mq.subject);
- }
+ printf("mailto: %s, relay server: %s:%d\n", mq.rcpt, smtpname, smtpport);
+ doSendMail(smtpsock, fp, buf, mq.rcpt, mq.subject);
fclose(fp);
unlink(mq.filepath);
} else {
@@ -206,8 +189,6 @@ void sendMail() {
unlink(NEWINDEX);
disconnectMailServer(smtpsock);
- if( hisock >= 0 )
- disconnectMailServer(hisock);
}
void listQueue() {
@@ -263,18 +244,14 @@ int main(int argc, char **argv, char **envp) {
case 's':
parseserver(optarg, &smtpname, &smtpport);
break;
- case 'o':
- parseserver(optarg, &hiname, &hiport);
- break;
case 'q':
listQueue();
return 0;
default:
- printf("usage:\toutmail [-qh] -s host[:port] [-o host[:port]]\n"
+ printf("usage:\toutmail [-qh] -s host[:port]\n"
"\t-q\tlistqueue\n"
"\t-h\thelp\n"
- "\t-s\tset default smtp server to host[:port]\n"
- "\t-o\tset non-Tanet smtp server to host[:port]\n");
+ "\t-s\tset default smtp server to host[:port]\n");
return 0;
}
}