Permalink
Browse files

DELIVERY: fix check_destination during autoreply

  • Loading branch information...
1 parent 9bf5b72 commit 48625366eea0c87417a32b3063998c4dc0028759 @pjstevns committed Feb 26, 2012
Showing with 26 additions and 14 deletions.
  1. +12 −14 src/dbmail-message.c
  2. +14 −0 test-scripts/testautoreply.txt
View
@@ -2212,25 +2212,23 @@ static int check_destination(DbmailMessage *message, GList *aliases)
GList *to, *cc, *recipients = NULL;
to = dbmail_message_get_header_addresses(message, "To");
cc = dbmail_message_get_header_addresses(message, "Cc");
- if (to && cc)
- recipients = g_list_concat(to, cc);
- if (recipients == NULL) {
- TRACE(TRACE_DEBUG, "no recipients??");
- return FALSE;
- }
+ recipients = g_list_concat(to, cc);
while (recipients) {
char *addr = (char *)recipients->data;
- aliases = g_list_first(aliases);
- while (aliases) {
- char *alias = (char *)aliases->data;
- if (MATCH(alias, addr)) {
- TRACE(TRACE_DEBUG, "valid alias found as recipient [%s]", alias);
- return TRUE;
+
+ if (addr) {
+ aliases = g_list_first(aliases);
+ while (aliases) {
+ char *alias = (char *)aliases->data;
+ if (MATCH(alias, addr)) {
+ TRACE(TRACE_DEBUG, "valid alias found as recipient [%s]", alias);
+ return TRUE;
+ }
+ if (! g_list_next(aliases)) break;
+ aliases = g_list_next(aliases);
}
- if (! g_list_next(aliases)) break;
- aliases = g_list_next(aliases);
}
if (! g_list_next(recipients)) break;
recipients = g_list_next(recipients);
@@ -0,0 +1,14 @@
+LHLO host
+MAIL FROM: <>
+RCPT TO: <testuser1@localhost>
+DATA
+To:
+CC: testuser1@localhost
+Subject: test autoreply
+Reply-To: nobody@dbmail.eu
+From: nobody@dbmail.eu
+
+test
+
+.
+QUIT

0 comments on commit 4862536

Please sign in to comment.