]>
git.ipfire.org Git - thirdparty/mlmmj.git/log
mmj [Mon, 7 Jun 2004 12:36:39 +0000 (22:36 +1000)]
New function to prepare a standard mail in an easy way, and make send_help
use it. More to follow :)
mmj [Mon, 7 Jun 2004 12:36:23 +0000 (22:36 +1000)]
New function to prepare a standard mail in an easy way.
mmj [Mon, 7 Jun 2004 12:35:58 +0000 (22:35 +1000)]
Comment out myfgetline since it's not used at all anymore
mortenp [Mon, 7 Jun 2004 11:24:32 +0000 (21:24 +1000)]
primitive implementation of probe (-p option)
mmj [Sun, 6 Jun 2004 21:57:40 +0000 (07:57 +1000)]
Prep for 0.6.0 and small debug info removal etc.
mmj [Sun, 6 Jun 2004 21:08:09 +0000 (07:08 +1000)]
Assorted bugfixes.
Addition of lots of unlink() in listcontrol.c
Make random-str return an even more random str, and hex format it
since it looks better :)
mmj [Sun, 6 Jun 2004 18:29:13 +0000 (04:29 +1000)]
getlistaddr was tought that listaddress moved to control/listaddress
mlmmj-maintd is no longer cleaning moderation/queue, now that dir is gone
mlmmj-make-ml.sh now doesn't make moderation/queue
mlmmj-process now uses queue for outgoing moderator mail, not modetaion/queue
mmj [Sun, 6 Jun 2004 18:27:25 +0000 (04:27 +1000)]
Some updates
mmj [Sun, 6 Jun 2004 16:52:23 +0000 (02:52 +1000)]
Cleanup printf()'s and errorhandling
mmj [Sun, 6 Jun 2004 16:42:34 +0000 (02:42 +1000)]
Remove fprintf(stderr, "%s", smtpreply) from checkwait_smtpreply. No need to
call fprintf for every reply from the mailserver.
mmj [Sun, 6 Jun 2004 16:38:14 +0000 (02:38 +1000)]
Last place to get rid of FILE* are now done.
mmj [Sun, 6 Jun 2004 15:02:28 +0000 (01:02 +1000)]
mlmmj-sub is now FILE* clean
mmj [Sat, 5 Jun 2004 20:27:14 +0000 (06:27 +1000)]
Use mmap to find the subscribers in the subscribers files
mmj [Sat, 5 Jun 2004 14:55:25 +0000 (00:55 +1000)]
Use MAP_FAILED to indicate failed mmap rather than (void \*)-1
mmj [Sat, 5 Jun 2004 13:49:27 +0000 (23:49 +1000)]
Latest mlmmj-send change ChangeLog entry
mmj [Sat, 5 Jun 2004 13:49:11 +0000 (23:49 +1000)]
Instead of reading 1 line at a time in mlmmj-send everytime we send the
mail, mmap it once, and pass the pointer to the send function which
writes one line at a time with proper \n -> \r\n and '.' -> '..'
conversion.
mmj [Sat, 5 Jun 2004 13:48:07 +0000 (23:48 +1000)]
New mlmmj-send takes a char * and the size of the mail to send instead
of the mail file descriptor.
mmj [Fri, 4 Jun 2004 10:46:33 +0000 (20:46 +1000)]
Another FILE* bites the dust
mmj [Fri, 4 Jun 2004 10:41:57 +0000 (20:41 +1000)]
Bye bye FILE*, welcome fd
mmj [Thu, 3 Jun 2004 16:58:22 +0000 (02:58 +1000)]
fileno(stdin) instead of FILENO_STDIN
mmj [Thu, 3 Jun 2004 16:57:14 +0000 (02:57 +1000)]
Bye bye FILE*
mmj [Thu, 3 Jun 2004 16:45:46 +0000 (02:45 +1000)]
Goodbye FILE*
mmj [Thu, 3 Jun 2004 15:11:00 +0000 (01:11 +1000)]
write_mailbody_from_file is now write_mailbody_from_fd
mmj [Thu, 3 Jun 2004 14:50:02 +0000 (00:50 +1000)]
header_token was not used anymore for a long time, so get rid of it
mmj [Thu, 3 Jun 2004 14:48:00 +0000 (00:48 +1000)]
-#include <stdio.h>
mmj [Thu, 3 Jun 2004 14:39:01 +0000 (00:39 +1000)]
-#include <stdio.h>
mmj [Thu, 3 Jun 2004 14:30:09 +0000 (00:30 +1000)]
Lets get rid of stdio shall we :-)
mmj [Thu, 3 Jun 2004 14:29:59 +0000 (00:29 +1000)]
Headerfile sync. I forgot some earlier, sorry :\
mmj [Thu, 3 Jun 2004 13:56:45 +0000 (23:56 +1000)]
Bye bye FILE * and welcome fd's
mmj [Thu, 3 Jun 2004 10:45:33 +0000 (20:45 +1000)]
FILE* is now fd
mmj [Thu, 3 Jun 2004 06:36:20 +0000 (16:36 +1000)]
Make listcontrol get the mailname for mlmmj-bounce
mmj [Thu, 3 Jun 2004 06:34:36 +0000 (16:34 +1000)]
3 things:
· Check that bouncefile is not a symlink (TODO)
· When everything went ok, return EXIT_SUCCES not EXIT_FAILURE
· If there's a bouncemail, save it as bfilename.lastmsg
And in more readable form:
--- mlmmj-bounce.c 26 May 2004 23:25:57 -0000 1.7
+++ mlmmj-bounce.c 3 Jun 2004 06:30:39 -0000
@@ -37,16 +37,16 @@
int main(int argc, char **argv)
{
- int opt;
+ int opt, fd;
char *listdir = NULL, *address = NULL, *number = NULL;
- char *bfilename, *a, *buf;
+ char *mailname = NULL, *savename, *bfilename, *a, *buf;
size_t len;
- int fd;
time_t t;
+ struct stat st;
log_set_name(argv[0]);
- while ((opt = getopt(argc, argv, "hVL:a:n:")) != -1) {
+ while ((opt = getopt(argc, argv, "hVL:a:n:m:")) != -1) {
switch(opt) {
case 'L':
listdir = optarg;
@@ -54,6 +54,9 @@
case 'a':
address = optarg;
break;
+ case 'm':
+ mailname = optarg;
+ break;
case 'n':
number = optarg;
break;
@@ -109,7 +112,14 @@
exit(EXIT_SUCCESS); /* Not subbed, so exit silently */
}
- /* TODO make sure the file we open below is not a symlink */
+ if(lstat(bfilename, &st) == 0) {
+ if((st.st_mode & S_IFLNK) == S_IFLNK) {
+ log_error(LOG_ARGS, "%s is a symbolic link",
+ bfilename);
+ exit(EXIT_FAILURE);
+ }
+ }
+
if ((fd = open(bfilename, O_WRONLY|O_APPEND|O_CREAT,
S_IRUSR|S_IWUSR)) < 0) {
log_error(LOG_ARGS, "Could not open '%s'", bfilename);
@@ -136,5 +146,11 @@
writen(fd, buf, strlen(buf));
close(fd);
- return EXIT_FAILURE;
+ if(mailname) {
+ savename = concatstr(2, bfilename, ".lastmsg");
+ rename(mailname, savename);
+ free(savename);
+ }
+
+ return EXIT_SUCCESS;
}
mmj [Wed, 2 Jun 2004 22:57:45 +0000 (08:57 +1000)]
mlmmj-recieve deFILEified
mmj [Wed, 2 Jun 2004 22:47:20 +0000 (08:47 +1000)]
dumpfd2fd
mortenp [Wed, 2 Jun 2004 21:57:30 +0000 (07:57 +1000)]
"Resolving" the conflict by committing my version anyway (it has a nice comment). That guy is fast.
mmj [Wed, 2 Jun 2004 21:52:48 +0000 (07:52 +1000)]
Simply close socket if error in transmission
mmj [Wed, 2 Jun 2004 21:50:40 +0000 (07:50 +1000)]
mygetline EINTR handling and errno = 0
mortenp [Wed, 2 Jun 2004 21:34:32 +0000 (07:34 +1000)]
fixed fgets() loop
mmj [Wed, 2 Jun 2004 19:27:20 +0000 (05:27 +1000)]
--- src/mlmmj-send.c 2 Jun 2004 19:10:11 -0000 1.31
+++ src/mlmmj-send.c 2 Jun 2004 19:19:48 -0000
@@ -35,8 +35,6 @@
#include "log_error.h"
#include "mygetline.h"
-static int conncount = 0; /* Connection count */
-
char *bounce_from_adr(const char *recipient, const char *listadr,
const char *mailfilename)
{
@@ -345,15 +343,6 @@
return 0;
}
-void sig_child(int sig)
-{
- pid_t pid;
- int stat;
-
- while((pid = waitpid(-1, &stat, WNOHANG) > 0))
- conncount--;
-}
-
static void print_help(const char *prg)
{
printf("Usage: %s [-L /path/to/list || -l listctrl] -m /path/to/mail "
@@ -380,7 +369,7 @@
{
size_t len = 0;
int sockfd = 0, opt, mindex;
- int deletewhensent = 1, *newsockfd, sendres, archive = 1;
+ int deletewhensent = 1, sendres, archive = 1;
char *listaddr, *mailfilename = NULL, *subfilename = NULL;
char *replyto = NULL, *bounceaddr = NULL, *to_addr = NULL;
char *relayhost = NULL, *archivefilename = NULL, *tmpstr;
@@ -389,8 +378,6 @@
DIR *subddir;
FILE *subfile = NULL, *mailfile = NULL, *tmpfile;
struct dirent *dp;
- pid_t childpid;
- struct sigaction sigact;
log_set_name(argv[0]);
@@ -564,11 +551,6 @@
}
free(subddirname);
- sigact.sa_handler = sig_child;
- sigemptyset(&sigact.sa_mask);
- sigact.sa_flags = SA_NOCLDSTOP;
- sigaction(SIGCHLD, &sigact, 0);
-
while((dp = readdir(subddir)) != NULL) {
if(!strcmp(dp->d_name, "."))
continue;
@@ -585,41 +567,19 @@
fprintf(stderr, "found subfile '%s'\n", subfilename);
free(subfilename);
- while((conncount >= MAX_CONNECTIONS))
- usleep(WAITSLEEP);
-
- childpid = fork();
- if(childpid < 0)
- log_error(LOG_ARGS, "Could not fork.");
- /* TODO: we have to keep track of unsent
- * files */
-
- conncount++;
-
- if(childpid == 0) {
- newsockfd = malloc(sizeof(int));
- initsmtp(newsockfd, relayhost);
- send_mail_many(*newsockfd, NULL, NULL,
- mailfile, subfile, listaddr,
- archivefilename, listdir,
- mlmmjbounce);
- endsmtp(newsockfd);
- free(newsockfd);
- fclose(subfile);
- exit(EXIT_SUCCESS);
- } else
- fclose(subfile);
+ initsmtp(&sockfd, relayhost);
+ send_mail_many(sockfd, NULL, NULL, mailfile, subfile,
+ listaddr, archivefilename, listdir,
+ mlmmjbounce);
+ endsmtp(&sockfd);
+ fclose(subfile);
}
closedir(subddir);
break;
}
- while(conncount > 0)
- usleep(WAITSLEEP);
-
if(archive) {
rename(mailfilename, archivefilename);
-
free(archivefilename);
} else if(deletewhensent)
unlink(mailfilename);
mmj [Wed, 2 Jun 2004 19:26:35 +0000 (05:26 +1000)]
No need for several connections tuning for mlmmj-send
mmj [Wed, 2 Jun 2004 19:26:19 +0000 (05:26 +1000)]
Changelog update
mmj [Wed, 2 Jun 2004 19:16:11 +0000 (05:16 +1000)]
ChangeLog update
mmj [Wed, 2 Jun 2004 19:10:11 +0000 (05:10 +1000)]
mlmmj-maintd now resends the ones that failed. Add listctrl switch to
do aid with it in mlmmj-send.
mortenp [Wed, 2 Jun 2004 15:26:25 +0000 (01:26 +1000)]
usleep(WAITSLEEP) while waiting for child processes to die
mortenp [Wed, 2 Jun 2004 12:34:07 +0000 (22:34 +1000)]
Fixed interrupted fgets() in write_mailbody_from_file()
mmj [Wed, 2 Jun 2004 06:26:57 +0000 (16:26 +1000)]
Set MAX_CONNECTIONS to 1
mmj [Wed, 2 Jun 2004 05:24:59 +0000 (15:24 +1000)]
Also remove leftover .{mailfrom,reciptto,reply-to} files without the
corresponding mail.
mmj [Tue, 1 Jun 2004 22:57:48 +0000 (08:57 +1000)]
Fix daemonizing
mmj [Tue, 1 Jun 2004 22:49:58 +0000 (08:49 +1000)]
mlmmj-maintd testet, and works
mmj [Tue, 1 Jun 2004 22:12:46 +0000 (08:12 +1000)]
mlmmj-maintd work (still in progress)
mmj [Tue, 1 Jun 2004 22:03:06 +0000 (08:03 +1000)]
append to subscribers file and not archive before last mlmmj-send is done.
mortenp [Tue, 1 Jun 2004 20:10:14 +0000 (06:10 +1000)]
Fixed leak of subfile in mlmmj-send
mmj [Tue, 1 Jun 2004 18:48:39 +0000 (04:48 +1000)]
Better do it like this. Not pretty thought, but I doubt it can be...
mmj [Mon, 31 May 2004 18:59:28 +0000 (04:59 +1000)]
Further work on mlmmj-maintd.
NEEDS TESTING!
mmj [Mon, 31 May 2004 18:58:43 +0000 (04:58 +1000)]
get Cc: header as well
mmj [Sat, 29 May 2004 16:57:59 +0000 (02:57 +1000)]
File for telling people the emailaddress have to be in To: or Cc:
mmj [Sat, 29 May 2004 14:41:36 +0000 (00:41 +1000)]
Make sure it compiles before releasing it :-)
mmj [Sat, 29 May 2004 14:40:40 +0000 (00:40 +1000)]
Move footer and customheader to control/. I've been meaning to do this
for a long time, that's where they belong.
mmj [Sat, 29 May 2004 14:40:21 +0000 (00:40 +1000)]
Update for 0.5.2
mmj [Sat, 29 May 2004 14:30:20 +0000 (00:30 +1000)]
it's +bounces-help not -bounces+help
mmj [Sat, 29 May 2004 14:27:53 +0000 (00:27 +1000)]
Further stuff in mlmmj-maintd
mmj [Sat, 29 May 2004 13:53:55 +0000 (23:53 +1000)]
Bad wording rectified
mmj [Sat, 29 May 2004 13:53:16 +0000 (23:53 +1000)]
Use listdir/moderation for the mails up for moderation and use
moderation/queue as temporary queue for the mails to the moderators.
Send the From: info to listcontrol.
Adapt to the fact that we now get info from all headers matching token.
Remove basename use, since mybasename does not modify variable.
mmj [Sat, 29 May 2004 13:48:09 +0000 (23:48 +1000)]
Create queue/discard directory
mmj [Sat, 29 May 2004 13:47:57 +0000 (23:47 +1000)]
Update
mmj [Sat, 29 May 2004 13:46:10 +0000 (23:46 +1000)]
Use the nice new mydirname and fix a bug with the archive variable.
mmj [Sat, 29 May 2004 13:42:14 +0000 (23:42 +1000)]
Small bugfix. Don't allocate sizeof(char **) * count but
sizeof(char *) * count when allocating room for a new entry in a char **
mmj [Sat, 29 May 2004 13:40:37 +0000 (23:40 +1000)]
It's not -L 1 but -l 1 for sending single mails
mmj [Sat, 29 May 2004 13:39:39 +0000 (23:39 +1000)]
Listcontrol shouldn't open the mailfile to retrieve info we've already
retrieved in mlmmj-process. Instead we parse it on to listcontrol from
mlmmj-process.
mmj [Sat, 29 May 2004 13:36:19 +0000 (23:36 +1000)]
When retrieving header info, make sure to get all headers since we might have
e.g. several To: headers.
mmj [Sat, 29 May 2004 10:44:21 +0000 (20:44 +1000)]
Make this change to mailhdr, since we can have e.g. several To:
headers.
struct mailhdr {
const char *token;
- char *value;
+ int valuecount;
+ char **values;
};
mortenp [Thu, 27 May 2004 13:13:48 +0000 (23:13 +1000)]
added comment about the fix i committed along with the mydirname()/mybasename() patch
mortenp [Thu, 27 May 2004 13:04:29 +0000 (23:04 +1000)]
added mydirname() and mybasename() which doesn't mess with their argument, and
returns newly allocated strings
mmj [Thu, 27 May 2004 07:16:50 +0000 (17:16 +1000)]
Add -a switch for archive [yes|no]
mmj [Thu, 27 May 2004 05:44:01 +0000 (15:44 +1000)]
Use strncpy instead of memcpy
Add some free()'s
Remove some cruft
mmj [Wed, 26 May 2004 23:34:41 +0000 (09:34 +1000)]
Update to reflect recent changes
mmj [Wed, 26 May 2004 23:34:04 +0000 (09:34 +1000)]
Header file changes
mmj [Wed, 26 May 2004 23:31:31 +0000 (09:31 +1000)]
Make mlmmj-send capable of handling a bounce from the relayhost and invoke
mlmmj-bounce to handle it like any other bounce.
This is (hopefully) the last SMTP functionality we have to implement.
mmj [Wed, 26 May 2004 23:29:48 +0000 (09:29 +1000)]
-#ifdef MLMMJ_DEBUG
+#if 0
mmj [Wed, 26 May 2004 23:29:09 +0000 (09:29 +1000)]
Make checkwait_smtpreply return the string that it gets from the mailserver
in case of error. That way we can check if the relayhost is bouncing local
addresses before accepting it.
mmj [Wed, 26 May 2004 23:27:32 +0000 (09:27 +1000)]
add: int is_subbed(const char *listdir, const char *address) for use
in mlmmj-bounce
mmj [Wed, 26 May 2004 23:25:57 +0000 (09:25 +1000)]
Handle sub/unsub confirm mail bounces, and use subscribers.d/ not
subscribers.
mmj [Mon, 24 May 2004 18:34:41 +0000 (04:34 +1000)]
Mr. Boole is easy to get the wrong way. Fix so it actually works.
mmj [Sun, 23 May 2004 22:07:35 +0000 (08:07 +1000)]
Dump needed data when failing in mlmmj-send.
Add mlmmj-maintd, the mlmmj maintenance daemon
mmj [Sun, 23 May 2004 22:06:58 +0000 (08:06 +1000)]
mlmmj-maintd header file. Note the tunables are in mlmmj.h
mmj [Sun, 23 May 2004 22:06:37 +0000 (08:06 +1000)]
Add entry about mlmmj-maintd
mmj [Sat, 22 May 2004 14:36:20 +0000 (00:36 +1000)]
Also dump MAIL FROM:, RCPT TO: and Reply To: variables in the case of an
error.
Make it known by the filename that's it's a moderaterequest. That way it's
a lot easier for the maintenance process to know how to react.
mmj [Sat, 22 May 2004 13:57:12 +0000 (23:57 +1000)]
Clean up and extend help everywhere.
Remove unused code from mlmmj-bounce.
mmj [Sat, 22 May 2004 13:56:44 +0000 (23:56 +1000)]
Makefile goes into .cvsignore and update ChangeLog
mortenp [Sat, 22 May 2004 10:47:18 +0000 (20:47 +1000)]
small fix for over-sized hostnames in hostnamestr()
mmj [Fri, 21 May 2004 08:46:00 +0000 (18:46 +1000)]
Send our hostname in HELO and change the mlmmj-send output from
Connected: ok
HELO: ok
MAIL FROM: ok
RCPT TO: ok
DATA: ok 35x
Mail queued: ok
Closed connection
To:
220 panther.mmj.dk ESMTP
250 panther.mmj.dk
250 Ok
250 Ok
354 End data with <CR><LF>.<CR><LF>
250 Ok: queued as
A8DA4F2FA4
221 Bye
mmj [Fri, 21 May 2004 08:43:58 +0000 (18:43 +1000)]
char *hostnamestr(void);
mmj [Fri, 21 May 2004 08:43:42 +0000 (18:43 +1000)]
ChangeLog and VERSION update
mmj [Wed, 19 May 2004 23:23:30 +0000 (09:23 +1000)]
Create and mention listdir/requeue
mmj [Wed, 19 May 2004 23:19:02 +0000 (09:19 +1000)]
Add requeueing
mmj [Wed, 19 May 2004 23:18:50 +0000 (09:18 +1000)]
Send listdir along
mmj [Wed, 19 May 2004 23:18:36 +0000 (09:18 +1000)]
ChangeLog has a requeuing mechanism entry and TODO has gotten smaller :)
mmj [Wed, 19 May 2004 23:15:46 +0000 (09:15 +1000)]
0.5.1 README
mmj [Wed, 19 May 2004 23:15:23 +0000 (09:15 +1000)]
.cvsignore updates
mortenp [Wed, 19 May 2004 13:23:17 +0000 (23:23 +1000)]
explained closedlist