--- afd-1.3.5/src/fd/sf_smtp.c 2007-07-19 13:42:19.000000000 +0200 +++ afd-1.3.6pre1/src/fd/sf_smtp.c 2007-07-26 07:22:07.000000000 +0200 @@ -312,6 +312,27 @@ { (void)strcpy(db.smtp_server, SMTP_HOST_NAME); } + else + { + if (db.special_flag & SMTP_SERVER_NAME_IN_MESSAGE) + { + if (db.toggle_host == YES) + { + if (fsa->host_toggle == HOST_ONE) + { + (void)strcpy(db.smtp_server, fsa->real_hostname[HOST_TWO - 1]); + } + else + { + (void)strcpy(db.smtp_server, fsa->real_hostname[HOST_ONE - 1]); + } + } + else + { + (void)strcpy(db.smtp_server, fsa->real_hostname[(int)(fsa->host_toggle - 1)]); + } + } + } /* Connect to remote SMTP-server. */ if ((status = smtp_connect(db.smtp_server, db.port)) != SUCCESS)