From: nothien <nothien@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] mgenmid: add option -d for custom domain
Date: Mon, 31 May 2021 09:46:22 +0200 [thread overview]
Message-ID: <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-209@inbox.vuxu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 527 bytes --]
There is a new pull request by nothien against master on the mblaze repository
https://github.com/nothien/mblaze master
https://github.com/leahneukirchen/mblaze/pull/209
mgenmid: add option -d for custom domain
In my setup, I use mblaze across multiple mailboxes, each with different addresses and domains, which they provide through mailbox-local configuration files. I needed this option in order to select the domain programmatically.
A patch file from https://github.com/leahneukirchen/mblaze/pull/209.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-209.patch --]
[-- Type: text/x-diff, Size: 1777 bytes --]
From 1fa062532f0e42bacdcb9d243295ab89609e0845 Mon Sep 17 00:00:00 2001
From: Arav K <nothien@uber.space>
Date: Mon, 31 May 2021 08:26:27 +0100
Subject: [PATCH 1/2] mgenmid: add option -d for custom domain
---
mgenmid.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/mgenmid.c b/mgenmid.c
index 56499c8..b31eddb 100644
--- a/mgenmid.c
+++ b/mgenmid.c
@@ -29,17 +29,26 @@ printb36(uint64_t x)
fputs(o, stdout);
}
-int main()
+int main(int argc, char *argv[])
{
char hostbuf[1024];
char *host = 0;
+ int c;
+ while ((c = getopt(argc, argv, "d:")) != -1)
+ switch (c) {
+ case 'd': host = optarg; break;
+ default:
+ fprintf(stderr, "Usage: mgenmid [-d domain]\n");
+ exit(1);
+ }
+
char *f = blaze822_home_file("profile");
struct message *config = blaze822(f);
xpledge("stdio rpath dns", "");
- if (config) // try FQDN: first
+ if (!host && config) // try FQDN:
host = blaze822_hdr(config, "fqdn");
if (!host && gethostname(hostbuf, sizeof hostbuf) == 0) {
From 25e04ed31801df5e9c74919918f3ece5775e34c8 Mon Sep 17 00:00:00 2001
From: Arav K <nothien@uber.space>
Date: Mon, 31 May 2021 08:39:57 +0100
Subject: [PATCH 2/2] mgenmid: document -d option on man page
---
man/mgenmid.1 | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/man/mgenmid.1 b/man/mgenmid.1
index ad1abc2..4aaa5d0 100644
--- a/man/mgenmid.1
+++ b/man/mgenmid.1
@@ -6,6 +6,7 @@
.Nd generate a Message-ID
.Sh SYNOPSIS
.Nm
+[-d domain]
.Sh DESCRIPTION
.Nm
generates and prints a unique Message-ID.
@@ -16,6 +17,10 @@ and a fully qualified domain name.
The fully qualified domain name is arrived at by:
.Bl -enum
.It
+Using the
+.Sq Li domain
+parameter provided on the command line.
+.It
Using
.Sq Li FQDN\&:
from
next reply other threads:[~2021-05-31 7:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-31 7:46 nothien [this message]
2021-06-02 21:01 ` leahneukirchen
2021-06-02 21:13 ` nothien
2021-06-04 15:04 ` leahneukirchen
2021-06-05 9:40 ` nothien
2022-04-22 7:13 ` Anachron
2022-04-22 18:17 ` [PR PATCH] [Closed]: " leahneukirchen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-209@inbox.vuxu.org \
--to=nothien@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).