All the subsequent e-mails appear as replies to the first e-mail sent
(either the preamble or the first patch). E-mails can be seen as
-replies to a different e-mail by using the '--refid' option.
+replies to a different e-mail by using the '--in-reply-to' option.
SMTP authentication is also possible with '--smtp-user' and
'--smtp-password' options, also available as configuration settings:
short = 'Add BCC to the Bcc: list'),
opt('--auto', action = 'store_true',
short = 'Automatically cc the patch signers'),
- opt('--noreply', action = 'store_true',
+ opt('--no-thread', action = 'store_true',
short = 'Do not send subsequent messages as replies'),
opt('--unrelated', action = 'store_true',
short = 'Send patches without sequence numbering'),
short = 'Edit each patch before sending'),
opt('-s', '--sleep', type = 'int', metavar = 'SECONDS',
short = 'Sleep for SECONDS between e-mails sending'),
- opt('--refid',
+ opt('--in-reply-to', metavar = 'REFID',
short = 'Use REFID as the reference id'),
opt('--smtp-server', metavar = 'HOST[:PORT] or "/path/to/sendmail -t -i"',
short = 'SMTP server or command to use for sending mail'),
cmd.append("--suppress-cc=self")
if not options.auto:
cmd.append("--suppress-cc=body")
+ if options.in_reply_to:
+ cmd.extend(["--in-reply-to", options.in_reply_to])
+ if options.no_thread:
+ cmd.append("--no-thread")
# We only support To/Cc/Bcc in git send-email for now.
for x in ['to', 'cc', 'bcc']:
if getattr(options, x):
cmd.extend('--%s=%s' % (x, a) for a in getattr(options, x))
- # XXX: hack for now so that we don't duplicate To/Cc/Bcc headers
- # in the mail, as git send-email inserts those for us.
- del msg['To']
- del msg['Cc']
- del msg['Bcc']
-
(fd, path) = mkstemp()
os.write(fd, msg.as_string(options.mbox))
os.close(fd)
msg_id = email.Utils.make_msgid('stgit')
msg = build(tmpl, msg_id, options, *args)
- from_addr, to_addrs = __parse_addresses(msg)
msg_str = msg.as_string(options.mbox)
if options.mbox:
out.stdout_raw(msg_str + '\n')
return msg_id
if not options.git:
+ from_addr, to_addrs = __parse_addresses(msg)
out.start('Sending ' + outstr)
smtpserver = options.smtp_server or config.get('stgit.smtpserver')
except Exception, ex:
raise CmdException, 'template parsing error: %s' % str(ex)
- __build_address_headers(msg, options)
- __build_extra_headers(msg, msg_id, options.refid)
+ if not options.git:
+ __build_address_headers(msg, options)
+ __build_extra_headers(msg, msg_id, options.in_reply_to)
__encode_message(msg)
return msg
else:
extra_cc = []
- __build_address_headers(msg, options, extra_cc)
+ if not options.git:
+ __build_address_headers(msg, options, extra_cc)
__build_extra_headers(msg, msg_id, ref_id)
__encode_message(msg)
if total_nr == 0:
raise CmdException, 'No patches to send'
- if options.refid:
- if options.noreply or options.unrelated:
+ if options.in_reply_to:
+ if options.no_thread or options.unrelated:
raise CmdException, \
- '--refid option not allowed with --noreply or --unrelated'
- ref_id = options.refid
+ '--in-reply-to option not allowed with --no-thread or --unrelated'
+ ref_id = options.in_reply_to
else:
ref_id = None
msg_id = __send_message('cover', tmpl, options, patches)
# subsequent e-mails are seen as replies to the first one
- if not options.noreply:
+ if not options.no_thread:
ref_id = msg_id
# send the patches
msg_id = __send_message('patch', tmpl, options, p, n, total_nr, ref_id)
# subsequent e-mails are seen as replies to the first one
- if not options.noreply and not options.unrelated and not ref_id:
+ if not options.no_thread and not options.unrelated and not ref_id:
ref_id = msg_id