configurationsendmail克隆所有外发电子邮件

有没有办法configurationsendmail类似于postfix '

[email protected] 

看看这个milter: http : //www.five-ten-sg.com/sm-archive/

你可以使用MIMEDefang,find:add_recipient

MIMEDefang在http://www.mimedefang.org/

我希望find一个不需要更多的解决scheme,但似乎这是不可能的。 为了将电子邮件克隆到特定的邮箱(可能是远程的),您可以使用这里其他人build议的小米; 我需要实际创build到另一个MTA的SMTPstream的克隆。 我发现的最好的解决scheme是邮件转发器 。 不幸的是,它似乎并没有在我们的Sendmail环境中工作(可能与重名列表有关?)

在milter.org上有更完整的可能的解决scheme,其中包括商业(90美元)的milter-bcc,但是由于milter API提供了一个机制来添加信封收件人(没有对信息作任何其他更改),所以我能够只需编写一个非常小的milter,将固定的收件人添加到所有消息中,然后接受它们:

 /* * Sendmail milter to add an additional (bcc) envelope recipient */ #include <stdio.h> #include <stdlib.h> #include <sysexits.h> #include <unistd.h> #include <sys/stat.h> #include "libmilter/mfapi.h" #ifndef bool # define bool int # define TRUE 1 # define FALSE 0 #endif /* ! bool */ char *connsock; char *bcc; sfsistat bccfi_eom(ctx) SMFICTX *ctx; { if (smfi_addrcpt(ctx, bcc) != MI_SUCCESS) fprintf(stderr, "smfi_addrcpt failed\n"); return SMFIS_ACCEPT; } struct smfiDesc bccfilter = { "add_bcc", /* filter name */ SMFI_VERSION, /* version code -- do not change */ SMFIF_ADDRCPT, /* flags */ NULL, /* connection info filter */ NULL, /* SMTP HELO command filter */ NULL, /* envelope sender filter */ NULL, /* envelope recipient filter */ NULL, /* header filter */ NULL, /* end of header */ NULL, /* body block filter */ bccfi_eom, /* end of message */ NULL, /* message aborted */ NULL, /* connection cleanup */ #if SMFI_VERSION > 2 NULL, /* unknown SMTP commands */ #endif /* SMFI_VERSION > 2 */ #if SMFI_VERSION > 3 NULL, /* DATA command */ #endif /* SMFI_VERSION > 3 */ #if SMFI_VERSION > 4 NULL /* Negotiate, at the start of each SMTP connection */ #endif /* SMFI_VERSION > 4 */ }; static void usage(prog) char *prog; { fprintf(stderr, "Usage: %s SOCKET_PATH BCC_ADDR\n", prog); } int main(argc, argv) int argc; char **argv; { char *socket; bool rmsocket = FALSE; struct stat status; if (argc != 3) { usage(argv[0]); exit(EX_USAGE); } socket = argv[1]; bcc = argv[2]; if (smfi_setconn(socket) == MI_FAILURE) { (void) fprintf(stderr, "smfi_setconn failed\n"); exit(EX_SOFTWARE); } /* attempt to remove existing socket, if possible */ if (stat(socket, &status) == 0 && S_ISSOCK(status.st_mode)) { unlink(socket); } if (smfi_register(bccfilter) == MI_FAILURE) { fprintf(stderr, "smfi_register failed\n"); exit(EX_UNAVAILABLE); } return smfi_main(); } 

你仍然需要编译和安装这个(和initscript或systemd单元在重启之后在Sendmail之前启动它)并且configurationSendmail来使用这个milter,所以和postfix(或者“unseen”路由器中的等效add_bcc相比,它仍然是相当痛苦的在Exim中configuration),但这是Sendmail的。