Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
postkutsche
Advanced tools
Readme
yarn add postkutsche
or
npm i postkutsche
(async () => {
//import the process.env variables from the .env file in which you should store them
//you can install dotenv with `npm i dotenv --save-dev` or `yarn add dotenv --dev`
require('dotenv').config();
//import the Postkutsche class
const {
Postkutsche
} = require("./index.js");
//create a new instance of Postkutsche providing it with the necessary api keys
const pk = new Postkutsche({
mailcow: {
url: process.env.MAILCOW_API_URL,
apikey: process.env.MAILCOW_API_KEY
},
powerdns: {
url: process.env.PDNS_API_URL,
apikey: process.env.PDNS_API_KEY
}
});
const info={
nameserver: ['ns1.domain.tld', 'ns2.domain.tld', 'ns3.domain.tld'],
hostmasterEmail: 'hostmaster@domain.tld',
dmarcMail: 'postmaster@domain.tld',
mailDomain: 'domain.tld',
mailServerHostname: 'mail.domain.tld',
defaultMailbox: {
local_part: `max.mustermensch`,
name: `Max Mustermensch`
},
//NEEDED FOR MAILSERVER DOMAIN SETUP
mailServerIp: '2a00:1450:4016:801::2003', //Your IPv6 address WITHOUT brackets([])
mailServerLegacyIp: '127.0.0.1',//Your IPv4 address
addLetsEncryptCAA: true,
caaReportMail: 'caa.report@domain.tld' //can be set if you want to get reports on malicious cert issues
}
//use a function from the Postkutsche class
//adds the mail records for a domain and creates the domain on mailcow
await pk.addMailDomain(info);
})();
Feel free to contact me via xl9jthv_7bvgakv9o9wg0jabn2ylm91xxrzzgt0e@y.gy in english or german
Array
Array
Boolean
Boolean
OpenpgpRecord
Class representing the Postkutsche client
Kind: static class of postkutsche
Array
Array
Boolean
Boolean
OpenpgpRecord
Create a postkutsche client.
Param | Type | Description |
---|---|---|
info | ApiInfo | The provided ApiInfo object |
Example
(async () => {
//import the process.env variables from the .env file in which you should store them
//you can install dotenv with `npm i dotenv --save-dev` or `yarn add dotenv --dev`
require('dotenv').config();
//import the Postkutsche class
const {
Postkutsche
} = require("./index.js");
//create a new instance of Postkutsche providing it with the necessary api keys
const pk = new Postkutsche({
mailcow: {
url: process.env.MAILCOW_API_URL,
apikey: process.env.MAILCOW_API_KEY
},
powerdns: {
url: process.env.PDNS_API_URL,
apikey: process.env.PDNS_API_KEY
}
});
const info={
nameserver: ['ns1.domain.tld', 'ns2.domain.tld', 'ns3.domain.tld'],
hostmasterEmail: 'hostmaster@domain.tld',
dmarcMail: 'postmaster@domain.tld',
mailDomain: 'domain.tld',
mailServerHostname: 'mail.domain.tld',
defaultMailbox: {
local_part: `max.mustermensch`,
name: `Max Mustermensch`
},
//NEEDED FOR MAILSERVER DOMAIN SETUP
mailServerIp: '2a00:1450:4016:801::2003', //Your IPv6 address WITHOUT brackets([])
mailServerLegacyIp: '127.0.0.1',//Your IPv4 address
addLetsEncryptCAA: true,
caaReportMail: 'caa.report@domain.tld' //can be set if you want to get reports on malicious cert issues
}
//use a function from the Postkutsche class
//adds the mail records for a domain and creates the domain on mailcow
await pk.addMailDomain(info);
})();
Array
Kind: instance method of Postkutsche
Returns: Array
- with tlsa records ready to be inserted into powerdns
Param | Type | Description |
---|---|---|
info | Info | Info object with the necessary information to generate the tlsa records |
Example
await pk.getTLSA({
mailServerHostname: 'mail.domain.tld',
mailServerIp: '2a00:1450:4016:801::2003',
mailServerLegacyIp: '127.0.0.1'
});
Array
Kind: instance method of Postkutsche
Returns: Array
- with domain relevant mail records
Param | Type | Description |
---|---|---|
info | Info | Info object with the necessary information to generate the domain mail records |
Example
pk.genMailDomainRecords({
mailServerHostname: 'mail.domain.tld',
mailDomain: 'domain.tld',
dmarcMail: 'dmarc@domain.tld'
});
Boolean
This will add:
Kind: instance method of Postkutsche
Returns: Boolean
- true on success
Param | Type | Default | Description |
---|---|---|---|
info | Info | Info object with the necessary information to create a mail domain on mailcow and the necessary records on powerdns | |
[log] | Boolean | true | you can disable logging by setting this to false |
Example
await pk.addMailDomain({
nameserver: ['ns1.domain.tld', 'ns2.domain.tld', 'ns3.domain.tld'],
hostmasterEmail: 'hostmaster@domain.tld',
dmarcMail: 'postmaster@domain.tld',
mailDomain: 'domain.tld',
mailServerHostname: 'mail.domain.tld',
defaultMailbox: {
local_part: `max.mustermensch`,
name: `Max Mustermensch`,
password:`set some good password here` //can be omitted
}
});
Boolean
This will add:
Kind: instance method of Postkutsche
Returns: Boolean
- true on success
Param | Type | Default | Description |
---|---|---|---|
info | Info | Info object with the necessary information to create the relevant records for the mailserver | |
[log] | Boolean | true | you can disable logging by setting this to false |
Example
await pk.addMailServerDnsRecords({
nameserver: ['ns1.domain.tld', 'ns2.domain.tld', 'ns3.domain.tld'],
hostmasterEmail: 'hostmaster@domain.tld',
mailServerHostname: 'mail.domain.tld',
mailServerIp: '2a00:1450:4016:801::2003', //Your IPv6 address WITHOUT brackets([])
mailServerLegacyIp: '127.0.0.1',//Your IPv4 address
addLetsEncryptCAA: true,
caaReportMail: 'caa.report@domain.tld' //can be set if you want to get reports on malicious cert issues
});
Creates the front part of the openpgp dns record
Kind: instance method of Postkutsche
Param | Type | Description |
---|---|---|
localPart | String | local part of your email address (the part before the @ not including the @) |
Example
console.log(pk.openpgpHash('max.mustermensch'));
OpenpgpRecord
Creates an openpgp dns record
Kind: instance method of Postkutsche
Param | Type | Description |
---|---|---|
localPart | String | local part of your email address (the part before the @ not including the @) |
publicKeyB64 | String | your publickey in base64 (it should be correct if it includes -----BEGIN PGP PUBLICKEY BLOCK-----) or only contains these characters: A-Z a-z 0-9 + / |
Example
console.log(pk.openpgpRecord('max.mustermensch','-----BEGIN PGP (...)'));
Sets an openpgp record on your powerdns server Will overwrite key with the same local part
Kind: instance method of Postkutsche
Param | Type | Description |
---|---|---|
localPart | String | local part of your email address (the part before the @ not including the @) |
domain | String | the domain you want to add the key to |
publicKeyB64 | String | your publickey in base64 (it should be correct if it includes -----BEGIN PGP PUBLICKEY BLOCK-----) or only contains these characters: A-Z a-z 0-9 + / |
Example
await pk.setOpenpgpRecord('max.mustermensch','domain.tld','-----BEGIN PGP (...)');
Will delete the complete mailserver domain from powerdns
Kind: instance method of Postkutsche
Param | Type | Description |
---|---|---|
info | Info | Info object with the necessary information to delete the mailserver domain |
Example
pk.cleanupAddMailServer({mailServerHostname:'mail.domain.tld'});
Will delete a domain from powerdns and mailcow THIS WILL DELETE YOUR MAILBOX AND EVERYTHING ELSE CONCERNING THIS DOMAIN
Kind: instance method of Postkutsche
Param | Type | Description |
---|---|---|
info | Info | Info object with the necessary information to create a mail domain on mailcow and the necessary records on powerdns |
Example
await pk.cleanupAddMailDomain({
dmarcMail: 'postmaster@domain.tld',
mailDomain: 'domain.tld',
defaultMailbox: {
local_part: `max.mustermensch`,
name: `Max Mustermensch`
}
});
object
Kind: global typedef
Properties
Name | Type |
---|---|
mailcow | object |
mailcow.url | string |
mailcow.apikey | string |
powerdns | object |
powerdns.url | String |
powerdns.apikey | String |
Example
{
mailcow: {
url: process.env.MAILCOW_API_URL,
apikey: process.env.MAILCOW_API_KEY
},
powerdns: {
url: process.env.PDNS_API_URL,
apikey: process.env.PDNS_API_KEY
}
}
object
Kind: global typedef
Properties
Name | Type | Default | Description |
---|---|---|---|
nameserver | Array.<string> | array of nameservers for your domain, first ns in the list will be used as primary | |
hostmasterEmail | string | hostnmaster email address | |
[dmarcMail] | string | add mail if you want to get dmarc reports | |
mailDomain | string | the domain you may want to add mail for | |
mailServerHostname | String | the hostname of the mailserver | |
defaultMailbox | Object | ||
defaultMailbox.local_part | String | local part of you mailbox (the part before the @ not including the @) | |
defaultMailbox.name | String | the name of mailbox | |
[defaultMailbox.password] | String | RANDOM | will generate a random password for your mailbox if omitted |
mailServerIp | String | IPv6 address of your mailserver | |
mailServerLegacyIp | String | IPv4 address of your mailserver | |
[addLetsEncryptCAA] | Boolean | enable this option if you are ONLY using letsencrypt certs | |
[caaReportMail] | String | ||
[openssl_path] | String | 'openssl' | optional alternative path for openssl |
Example
{
nameserver: ['ns1.domain.tld', 'ns2.domain.tld', 'ns3.domain.tld'],
hostmasterEmail: 'hostmaster@domain.tld',
dmarcMail: 'postmaster@domain.tld',
mailDomain: 'domain.tld',
mailServerHostname: 'mail.domain.tld',
defaultMailbox: {
local_part: `max.mustermensch`,
name: `Max Mustermensch`
},
//NEEDED FOR MAILSERVER DOMAIN SETUP
mailServerIp: '2a00:1450:4016:801::2003', //Your IPv6 address WITHOUT brackets([])
mailServerLegacyIp: '127.0.0.1',//Your IPv4 address
addLetsEncryptCAA: true,
caaReportMail: 'caa.report@domain.tld' //can be set if you want to get reports on malicious cert issues
}
FAQs
Combines PowerDns and Mailcow to create a mail domain with all required entries on both services in a single command.
The npm package postkutsche receives a total of 0 weekly downloads. As such, postkutsche popularity was classified as not popular.
We found that postkutsche demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.