"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/mail-functions.c" between
mlmmj-1.2.19.0.tar.gz and mlmmj-1.3.0.tar.bz2

About: mlmmj is a mailing list manager similar to ezmlm, but with a decent license and mail server independency.

mail-functions.c  (mlmmj-1.2.19.0):mail-functions.c  (mlmmj-1.3.0.tar.bz2)
skipping to change at line 88 skipping to change at line 88
#endif #endif
bytes_written = writen(sockfd, helo, len); bytes_written = writen(sockfd, helo, len);
if(bytes_written < 0) { if(bytes_written < 0) {
log_error(LOG_ARGS, "Could not write HELO"); log_error(LOG_ARGS, "Could not write HELO");
myfree(helo); myfree(helo);
return errno; return errno;
} }
myfree(helo); myfree(helo);
return 0; return 0;
} }
/* "MAIL FROM: <> \r\n" has length 16 */ /* "MAIL FROM:<> \r\n" has length 15 */
#define EXTRA_FROM_LEN 16 #define EXTRA_FROM_LEN 15
int write_mail_from(int sockfd, const char *from_addr, const char *extra) int write_mail_from(int sockfd, const char *from_addr, const char *extra)
{ {
size_t len = (size_t)(strlen(from_addr) + EXTRA_FROM_LEN + size_t len = (size_t)(strlen(from_addr) + EXTRA_FROM_LEN +
strlen(extra) + 1); strlen(extra) + 1);
char *mail_from; char *mail_from;
size_t bytes_written; size_t bytes_written;
mail_from = mymalloc(len); mail_from = mymalloc(len);
if(extra && extra[0] != '\0') { if(extra && extra[0] != '\0') {
if(extra[0] == ' ') extra++; if(extra[0] == ' ') extra++;
snprintf(mail_from, len, "MAIL FROM: <%s> %s\r\n", from_addr, snprintf(mail_from, len, "MAIL FROM:<%s> %s\r\n", from_addr,
extra); extra);
} else } else
snprintf(mail_from, len, "MAIL FROM: <%s>\r\n", from_addr); snprintf(mail_from, len, "MAIL FROM:<%s>\r\n", from_addr);
len = strlen(mail_from); len = strlen(mail_from);
#if 0 #if 0
fprintf(stderr, "%s", mail_from); fprintf(stderr, "%s", mail_from);
#endif #endif
bytes_written = writen(sockfd, mail_from, len); bytes_written = writen(sockfd, mail_from, len);
if(bytes_written < 0) { if(bytes_written < 0) {
log_error(LOG_ARGS, "Could not write FROM"); log_error(LOG_ARGS, "Could not write FROM");
myfree(mail_from); myfree(mail_from);
return errno; return errno;
} }
myfree(mail_from); myfree(mail_from);
return 0; return 0;
} }
/* "RCPT TO: <>\r\n" has length 13 */ /* "RCPT TO:<>\r\n" has length 12 */
#define EXTRA_RCPT_LEN 13 #define EXTRA_RCPT_LEN 12
int write_rcpt_to(int sockfd, const char *rcpt_addr) int write_rcpt_to(int sockfd, const char *rcpt_addr)
{ {
size_t len = (size_t)(strlen(rcpt_addr) + EXTRA_RCPT_LEN + 1); size_t len = (size_t)(strlen(rcpt_addr) + EXTRA_RCPT_LEN + 1);
char *rcpt_to; char *rcpt_to;
size_t bytes_written; size_t bytes_written;
if((rcpt_to = mymalloc(len)) == 0) if((rcpt_to = mymalloc(len)) == 0)
return errno; return errno;
snprintf(rcpt_to, len, "RCPT TO: <%s>\r\n", rcpt_addr); snprintf(rcpt_to, len, "RCPT TO:<%s>\r\n", rcpt_addr);
len = strlen(rcpt_to); len = strlen(rcpt_to);
#if 0 #if 0
log_error(LOG_ARGS, "%s", rcpt_to); log_error(LOG_ARGS, "%s", rcpt_to);
#endif #endif
bytes_written = writen(sockfd, rcpt_to, len); bytes_written = writen(sockfd, rcpt_to, len);
if(bytes_written < 0) { if(bytes_written < 0) {
log_error(LOG_ARGS, "Could not write TO"); log_error(LOG_ARGS, "Could not write TO");
myfree(rcpt_to); myfree(rcpt_to);
return errno; return errno;
} }
 End of changes. 5 change blocks. 
7 lines changed or deleted 7 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS