Skip to content
Permalink
Browse files

Fix for handling empty senders in forward mode

git-svn-id: svn://localhost/home/matthias/source/svn/matthias_wimmer@182 4ea7d500-c7de-0310-95d6-fef3d14ee6ae
  • Loading branch information
matthias
matthias committed Mar 21, 2008
1 parent fbeba69 commit 40ced4e1373e85456b1022ab536bf62c2f7c3787
Showing with 22 additions and 8 deletions.
  1. +3 −0 ChangeLog
  2. +6 −0 NEWS
  3. +1 −1 configure.ac
  4. +12 −7 couriersrs.cc
@@ -0,0 +1,3 @@
2007-03-26 Matthias Wimmer <m@tthias.eu>

* couriersrs.cc: Fixed handling for forward bounces
6 NEWS
@@ -0,0 +1,6 @@
couriersrs 0.1.1
================

Fixed handling of empty sender addresses in forward operation mode.
couriersrs did not accept such mails in version 0.1.0. They are now
forwarded by keeping the empty sender address.
@@ -1,7 +1,7 @@
AC_PREREQ(2.50)

AC_INIT(couriersrs.h)
AM_INIT_AUTOMAKE(couriersrs,0.1.0)
AM_INIT_AUTOMAKE(couriersrs,0.1.1)
AM_CONFIG_HEADER(config.h)
AC_LANG(C++)
AC_GNU_SOURCE
@@ -230,7 +230,7 @@ int main(int argc, char const** argv) {
// forward or reverse operation?
if (!reverse) {
// check addresses are present
if (!sender || !sender[0]) {
if (!sender) {
std::cout << N_("Sender address could not be determined.") << std::endl;
return 1;
}
@@ -247,12 +247,17 @@ int main(int argc, char const** argv) {
size_t buffer_size = std::string(sender).length()+std::string(srsdomain).length()+65;
char *buffer = new char[buffer_size];

// rewrite address
ret = srs_forward(srs, buffer, buffer_size, sender, srsdomain);
if (ret != SRS_SUCCESS) {
delete buffer;
std::cout << N_("Could not rewrite address in forward mode: ") << srs_strerror(ret) << std::endl;
return 1;
// empty sender address? (bounce mail)
if (!sender[0]) {
buffer[0] = 0;
} else {
// rewrite address
ret = srs_forward(srs, buffer, buffer_size, sender, srsdomain);
if (ret != SRS_SUCCESS) {
delete buffer;
std::cout << N_("Could not rewrite address in forward mode: ") << srs_strerror(ret) << std::endl;
return 1;
}
}

// Create 'Delivered-To' header

0 comments on commit 40ced4e

Please sign in to comment.
You can’t perform that action at this time.