masqmail

diff src/route.c @ 367:b27f66555ba8

Reformated multiline comments to have leading asterisks on each line Now we use: /* ** comment */ This makes the indent style simpler, too.
author markus schnalke <meillo@marmaro.de>
date Thu, 20 Oct 2011 10:20:59 +0200
parents 41958685480d
children 4cab237ce923
line diff
     1.1 --- a/src/route.c	Thu Sep 22 15:07:40 2011 +0200
     1.2 +++ b/src/route.c	Thu Oct 20 10:20:59 2011 +0200
     1.3 @@ -1,20 +1,21 @@
     1.4 -/*  MasqMail
     1.5 -    Copyright (C) 1999-2001 Oliver Kurth
     1.6 -    Copyright (C) 2010 markus schnalke <meillo@marmaro.de>
     1.7 -
     1.8 -    This program is free software; you can redistribute it and/or modify
     1.9 -    it under the terms of the GNU General Public License as published by
    1.10 -    the Free Software Foundation; either version 2 of the License, or
    1.11 -    (at your option) any later version.
    1.12 -
    1.13 -    This program is distributed in the hope that it will be useful,
    1.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.16 -    GNU General Public License for more details.
    1.17 -
    1.18 -    You should have received a copy of the GNU General Public License
    1.19 -    along with this program; if not, write to the Free Software
    1.20 -    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    1.21 +/*
    1.22 +**  MasqMail
    1.23 +**  Copyright (C) 1999-2001 Oliver Kurth
    1.24 +**  Copyright (C) 2010 markus schnalke <meillo@marmaro.de>
    1.25 +**
    1.26 +**  This program is free software; you can redistribute it and/or modify
    1.27 +**  it under the terms of the GNU General Public License as published by
    1.28 +**  the Free Software Foundation; either version 2 of the License, or
    1.29 +**  (at your option) any later version.
    1.30 +**
    1.31 +**  This program is distributed in the hope that it will be useful,
    1.32 +**  but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.33 +**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.34 +**  GNU General Public License for more details.
    1.35 +**
    1.36 +**  You should have received a copy of the GNU General Public License
    1.37 +**  along with this program; if not, write to the Free Software
    1.38 +**  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    1.39  */
    1.40  
    1.41  #include <fnmatch.h>
    1.42 @@ -50,9 +51,10 @@
    1.43  void
    1.44  rewrite_headers(msg_out *msgout, connect_route *route)
    1.45  {
    1.46 -	/* if set_h_from_domain is set, replace domain in all
    1.47 -	   From: headers.
    1.48 -	 */
    1.49 +	/*
    1.50 +	**  if set_h_from_domain is set, replace domain in all
    1.51 +	**  From: headers.
    1.52 +	*/
    1.53  	msgout->hdr_list = g_list_copy(msgout->msg->hdr_list);
    1.54  
    1.55  	/* map from addresses */
    1.56 @@ -191,14 +193,15 @@
    1.57  }
    1.58  
    1.59  /*
    1.60 -Split a recipient list into the three groups:
    1.61 -- local recipients
    1.62 -- those maching the patterns
    1.63 -- those not matching the patterns
    1.64 -If patterns is NULL: only splitting between local and others is done.
    1.65 +**  Split a recipient list into the three groups:
    1.66 +**  - local recipients
    1.67 +**  - those maching the patterns
    1.68 +**  - those not matching the patterns
    1.69 +**  If patterns is NULL: only splitting between local and others is done.
    1.70  */
    1.71  void
    1.72 -split_rcpts(GList *rcpt_list, GList *patterns, GList **rl_local, GList **rl_matching, GList **rl_others)
    1.73 +split_rcpts(GList *rcpt_list, GList *patterns, GList **rl_local,
    1.74 +		GList **rl_matching, GList **rl_others)
    1.75  {
    1.76  	GList *rcpt_node;
    1.77  	GList *host_node = NULL;
    1.78 @@ -215,8 +218,10 @@
    1.79  			if (rl_local)
    1.80  				*rl_local = g_list_append(*rl_local, rcpt);
    1.81  		} else {
    1.82 -			/* if patterns is NULL, host_node will be NULL,
    1.83 -			   hence all non-locals are put to others */
    1.84 +			/*
    1.85 +			**  if patterns is NULL, host_node will be NULL,
    1.86 +			**  hence all non-locals are put to others
    1.87 +			*/
    1.88  			foreach(patterns, host_node) {
    1.89  				gchar *host = (gchar *) (host_node->data);
    1.90  				if (fnmatch(host, rcpt->domain, FNM_CASEFOLD) == 0)
    1.91 @@ -234,8 +239,8 @@
    1.92  }
    1.93  
    1.94  /*
    1.95 -Return a new list of the local rcpts in the rcpt_list
    1.96 -TODO: This function is almost exactly the same as remote_rcpts(). Merge?
    1.97 +**  Return a new list of the local rcpts in the rcpt_list
    1.98 +**  TODO: This function is almost exactly the same as remote_rcpts(). Merge?
    1.99  */
   1.100  GList*
   1.101  local_rcpts(GList *rcpt_list)
   1.102 @@ -257,8 +262,8 @@
   1.103  }
   1.104  
   1.105  /*
   1.106 -Return a new list of non-local rcpts in the rcpt_list
   1.107 -TODO: This function is almost exactly the same as local_rcpts(). Merge?
   1.108 +**  Return a new list of non-local rcpts in the rcpt_list
   1.109 +**  TODO: This function is almost exactly the same as local_rcpts(). Merge?
   1.110  */
   1.111  GList*
   1.112  remote_rcpts(GList *rcpt_list)
   1.113 @@ -317,8 +322,8 @@
   1.114  }
   1.115  
   1.116  /*
   1.117 -   Make lists of matching/not matching rcpts.
   1.118 -   Local domains are NOT regared here, these should be sorted out previously
   1.119 +**  Make lists of matching/not matching rcpts.
   1.120 +**  Local domains are NOT regared here, these should be sorted out previously
   1.121  */
   1.122  void
   1.123  route_split_rcpts(connect_route *route, GList *rcpt_list, GList **p_rcpt_list, GList **p_non_rcpt_list)
   1.124 @@ -356,9 +361,10 @@
   1.125  			}
   1.126  		}
   1.127  
   1.128 -		/* rewrite return path if there is a table, use that
   1.129 -		   if an address is found and if it has a domain, use that
   1.130 -		 */
   1.131 +		/*
   1.132 +		**  rewrite return path if there is a table, use that
   1.133 +		**  if an address is found and if it has a domain, use that
   1.134 +		*/
   1.135  		if (route->map_return_path_addresses) {
   1.136  			address *ret_path = NULL;
   1.137  			DEBUG(5) debugf("looking up %s in map_return_path_addresses\n", msg->return_path->local_part);
   1.138 @@ -383,11 +389,11 @@
   1.139  	return NULL;
   1.140  }
   1.141  
   1.142 -/* put msgout's is msgout_list into bins (msgout_perhost structs) for each
   1.143 -   host. Used if there is no mail_host.
   1.144 -   route param is not used, we leave it here because that may change.
   1.145 - */
   1.146 -
   1.147 +/*
   1.148 +**  put msgout's is msgout_list into bins (msgout_perhost structs) for each
   1.149 +**  host. Used if there is no mail_host.
   1.150 +**  route param is not used, we leave it here because that may change.
   1.151 +*/
   1.152  GList*
   1.153  route_msgout_list(connect_route *route, GList *msgout_list)
   1.154  {
   1.155 @@ -415,8 +421,13 @@
   1.156  				/* there is already a rcpt for this host */
   1.157  				msg_out *msgout_last = (msg_out *) ((g_list_last(mo_ph->msgout_list))->data);
   1.158  				if (msgout_last->msg == msgout->msg) {
   1.159 -					/* if it is also the same message, it must be the last one appended
   1.160 -					   to mo_ph->msgout_list (since outer loop goes through msgout_list) */
   1.161 +					/*
   1.162 +					**  if it is also the same message,
   1.163 +					**  it must be the last one
   1.164 +					**  appended to mo_ph->msgout_list
   1.165 +					**  (since outer loop goes through
   1.166 +					**  msgout_list)
   1.167 +					*/
   1.168  					msgout_last->rcpt_list = g_list_append(msgout_last->rcpt_list, rcpt);
   1.169  				} else {
   1.170  					/* if not, we append a new msgout */