git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] send-email: Change from Mail::Sendmail to Net::SMTP

From
Martin Langhoff <martin.langhoff@gmail.com>
Date
Apr 26, 2006, 00:45 UTC
Message-ID
<46a038f90604251745u1b15ad99ka1aeff1cd8d8c344@mail.gmail.com>
In-Reply-To
<1143336048205-git-send-email-normalperson@yhbt.net>
On 3/26/06, Eric Wong <normalperson@yhbt.net> wrote:
> Net::SMTP is in the base Perl distribution, so users are more
> likely to have it.  Net::SMTP also allows reusing the SMTP
> connection, so sending multiple emails is faster.
This is causing problems for me on my Debian sarge dev box.
 * If I have to believe strace(), Net::SMTP is trying to look up
"localhost" via DNS. Sketchy workaround: use 127.0.0.1.
 * This box has nothing listening on port 25. It doesn't get email
from the net, being a LAN machine, so I've told the debian config
system that we don't need an smtp daemon. Net::SMTP doesn't know how
to use /usr/bin/sendmail
 * That nasty @@VERSION@@ thing isn't valid perl, so working on this
code is a pain. Something like this (warning! broken diff ahead!)
fixes it for me.
@@ -292,6 +292,11 @@ sub send_message
        @recipients = unique_email_list(@recipients,@cc);
        my $date = strftime('%a, %d %b %Y %H:%M:%S %z', localtime($time++));

+       my $gitversion = '@@GIT_VERSION@@';
+       if ($gitversion eq '@@'.'GIT_VERSION@@') {
+           $gitversion = `git --version`;
+       }
+
        my $header = "From: $from
 To: $to
 Cc: $cc
@@ -299,11 +304,11 @@ Subject: $subject
 Reply-To: $from
 Date: $date
 Message-Id: $message_id
-X-Mailer: git-send-email @@GIT_VERSION@@
+X-Mailer: git-send-email $gitversion
 ";
        $header .= "In-Reply-To: $reply_to\n" if $reply_to;

cheers,


martin
Previous: Eric WongNext: Junio C Hamano
Message 7 of 24 in “send-email: dependency removal, cleanup, + small feature”
  1. Eric WongMar 25, 2006
  2. 1/4 send-email: Change from Mail::Sendmail to Net::SMTPEric Wong, Mar 25, 2006
  3. Ryan AndersonMar 25, 2006
  4. Eric WongMar 26, 2006
  5. Junio C HamanoMar 26, 2006
  6. send-email: Change from Mail::Sendmail to Net::SMTPEric Wong, Mar 26, 2006
  7. Martin LanghoffApr 26, 2006
  8. Junio C HamanoApr 26, 2006
  9. Martin LanghoffApr 26, 2006
  10. Eric WongApr 28, 2006
  11. Martin LanghoffApr 28, 2006
  12. 4/4 send-email: add support for mutt aliases filesEric Wong, Mar 25, 2006
  13. Junio C HamanoMar 25, 2006
  14. Ryan AndersonMar 25, 2006
  15. send-email: address expansion for common mailersEric Wong, Mar 26, 2006
  16. Junio C HamanoMar 26, 2006
  17. Eric WongMar 26, 2006
  18. send-email: address expansion for common mailersEric Wong, May 15, 2006
  19. Ryan AndersonMay 15, 2006
  20. 3/4 send-email: lazy-load Email::Valid and make it optionalEric Wong, Mar 25, 2006
  21. Randal L. SchwartzMar 25, 2006
  22. Junio C HamanoMar 25, 2006
  23. send-email: lazy-load Email::Valid and make it optionalEric Wong, Mar 26, 2006
  24. 2/4 send-email: use built-in time() instead of /bin/date '+%s'Eric Wong, Mar 25, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.