> The right answer is to firewall all incoming and outgoing mail from
> Hotmail, until they fix their mail server to comply with RFC 821.
Unfortunately, it's not my local server, it's a client's.
Is this too insane? I liked it better than some RELAYCLIENT =
"@hotmail-fixup" in tcprules as that causes every message to be handled,
logged twice, etc.
Here's my end run of qmail and hotmail to handle this:
control/virtualdomains:
hotmail.com:alias-hotmail
alias/.qmail-hotmail-default:
# this bounces messages that are too big for buggy hotmail servers
|/var/qmail/bin/bounceonfilesize
# slight-of-hand to name service hotmail.com looks up to hotmail.com.
# but apparently not in virtual domains, which actually is cool for us
# doesn't affect incoming smtp stuff, only local outgoing, which is
# perfect
|/var/qmail/bin/forward "$DEFAULT"@hotmail.com.
bounceonfilesize.c:
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#define die(str,code) { puts( str ) ; exit( code ) ; }
#define HOTMAILSIZELIMIT 1048576
extern int errno;
int main(void) {
struct stat sb ;
if ( fstat( 0, &sb ) != 0 )
die( strerror(errno), 111 ) ;
if ( ! (sb.st_mode & S_IFREG) )
die( "stdin is not attached to a regular file", 111 ) ;
if ( sb.st_size >= HOTMAILSIZELIMIT )
die( "This message exceeds hotmail.com limits.", 100 ) ;
exit( 0 ) ;
}