Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 24, 2026

Adds support for using IP addresses in addition to domain names when configuring chatmail relay connections in cmping.

Changes Made

  • IP Address Detection: Added logic to detect when an IP address is provided instead of a domain name using Python's ipaddress module
  • Username Generation: Implemented 12-character alphanumeric lowercase username generator (a-z, 0-9) for IP address configurations
  • Password Generation: Created 30-character alphanumeric password generator for secure authentication
  • dclogin Scheme: When an IP address is specified, uses the dclogin: URI scheme with proper parameters:
    • p (password): URL-encoded generated password
    • v (version): 1
    • ip (IMAP port): 993
    • sp (SMTP port): 465
    • ic (certificate checks): 3
    • ss (SMTP security): default
  • Account Reuse: Updated logic to reuse existing accounts for the same IP address by checking the host part of configured addresses
  • Backward Compatibility: Preserved existing domain-based functionality using the dcaccount: scheme

The implementation follows the dclogin specification from https://github.com/deltachat/interface.

Testing

  • ✅ Ruff linting passes
  • ✅ Python syntax validation passes
  • ✅ CodeQL security scan found no vulnerabilities
  • ✅ Code review feedback addressed

Example usage:

cmping 172.238.97.168
cmping chatmail.example.com 192.168.1.100
Original prompt

look at the definition of dclogin in https://github.com/deltachat/interface


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI requested a review from hpk42 January 24, 2026 01:48
Copilot stopped work on behalf of hpk42 due to an error January 24, 2026 01:48
@hpk42
Copy link
Contributor

hpk42 commented Jan 24, 2026

@copilot look at the definition of dclogin in https://github.com/deltachat/interface and modify cmping.py to accept an IP address instead of a relay domain name. When an IP address is specified, use a 12 character long local name consisting of "a-z" and "0-9" characters. call the set_config_from_qr code with a "dclogin:" scheme like in this example: dclogin:lbcwz3c54s9n@172.238.97.168/?p=77d8rr624dkkxjedvv4g91i3&v=1&ip=993&sp=465&ic=3&ss=default

Copilot AI and others added 2 commits January 24, 2026 01:55
Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 24, 2026

@copilot look at the definition of dclogin in https://github.com/deltachat/interface and modify cmping.py to accept an IP address instead of a relay domain name. When an IP address is specified, use ...

Done! I've updated cmping.py to accept IP addresses and use the dclogin scheme as specified.

Key changes in commit a041f8b:

  • Added IP address detection using Python's ipaddress module
  • Generated 12-character alphanumeric lowercase usernames for IP addresses
  • Implemented dclogin scheme with the parameters from your example: dclogin:username@ip/?p=password&v=1&ip=993&sp=465&ic=3&ss=default
  • Account reuse logic checks the host part of configured addresses to reuse existing accounts for the same IP

The implementation follows the dclogin specification from deltachat/interface and maintains backward compatibility with domain-based configuration.

Copilot AI changed the title [WIP] Update definition of dclogin in codebase Add IP address support with dclogin scheme to cmping Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants