diff --git a/docs/changelog/v2.0.0.rst b/docs/changelog/v2.0.0.rst
index 15c78b248..ee46b8351 100644
--- a/docs/changelog/v2.0.0.rst
+++ b/docs/changelog/v2.0.0.rst
@@ -4,6 +4,12 @@
 =====
 
 
+Enhancements
+............
+
+* Added configuration option :attr:`_config.ALLOW_LONG_DIMSE_AET` to allow
+  bypassing the length check for elements with a VR of **AE** (:issue:`515`)
+
 Changes
 .......
 
diff --git a/docs/reference/config.rst b/docs/reference/config.rst
index d1676bd2b..fa9e28c0d 100644
--- a/docs/reference/config.rst
+++ b/docs/reference/config.rst
@@ -13,5 +13,6 @@ Configuration Options (:mod:`pynetdicom._config`)
    ENFORCE_UID_CONFORMANCE
    LOG_HANDLER_LEVEL
    USE_SHORT_DIMSE_AET
+   ALLOW_LONG_DIMSE_AET
    LOG_REQUEST_IDENTIFIERS
    LOG_RESPONSE_IDENTIFIERS
diff --git a/pynetdicom/_config.py b/pynetdicom/_config.py
index f8fc47958..f07625023 100644
--- a/pynetdicom/_config.py
+++ b/pynetdicom/_config.py
@@ -52,6 +52,23 @@ Examples
 """
 
 
+ALLOW_LONG_DIMSE_AET = False
+"""Allow the use of non-conformant AE titles.
+
+.. versionadded:: 2.0
+
+If ``False`` then elements with a VR of AE in DIMSE messages will have their
+length checked to ensure conformance, otherwise no length check will be
+performed.
+
+Examples
+--------
+
+>>> from pynetdicom import _config
+>>> _config.ALL_LONG_AET = True
+"""
+
+
 LOG_RESPONSE_IDENTIFIERS = True
 """Log incoming C-FIND, C-GET and C-MOVE response *Identifier* datasets.
 
diff --git a/pynetdicom/apps/qrscp/handlers.py b/pynetdicom/apps/qrscp/handlers.py
index 05d946d78..449314b39 100644
--- a/pynetdicom/apps/qrscp/handlers.py
+++ b/pynetdicom/apps/qrscp/handlers.py
@@ -172,7 +172,7 @@ def handle_get(event, db_path, cli_config, logger):
         try:
             ds = dcmread(match.filename)
         except Exception as exc:
-            logger.error(f"Error reading file: {fpath}")
+            logger.error(f"Error reading file: {match.filename}")
             logger.exception(exc)
             yield 0xC421, None
 
@@ -264,7 +264,7 @@ def handle_move(event, destinations, db_path, cli_config, logger):
         try:
             ds = dcmread(match.filename)
         except Exception as exc:
-            logger.error(f"Error reading file: {fpath}")
+            logger.error(f"Error reading file: {match.filename}")
             logger.exception(exc)
             yield 0xC521, None
 
diff --git a/pynetdicom/utils.py b/pynetdicom/utils.py
index c12df7fa5..239b3532f 100644
--- a/pynetdicom/utils.py
+++ b/pynetdicom/utils.py
@@ -127,8 +127,10 @@ def validate_ae_title(ae_title, use_short=False):
             "AE titles are not allowed to consist entirely of only spaces"
         )
 
-    # Truncate if longer than 16 characters
-    ae_title = ae_title[:16]
+    if not _config.ALLOW_LONG_DIMSE_AET:
+        # Truncate if longer than 16 characters
+        ae_title = ae_title[:16]
+
     if not use_short:
         # Pad out to 16 characters using spaces
         ae_title = ae_title.ljust(16)

Add switch for valieate_ae_title in C-MOVE request
**Is your feature request related to a problem? Please describe.**

I've met a custom DICOM server that allows me to send receiver AE title in C-MOVE request in format "ae_title@IP:port" where ae_title is regular title and IP and port is an address of receiver. It allows them to process C-MOVE requests without maintaining a table of AEs and their addresses.

Of course such AE title is longer than 16 bytes allowed by DICOM standard and I can't use this library without patching.

**Describe the solution you'd like**

I've already made a simplest patch that allows me to switch off the AE title length check in C-MOVE request. Now I'd like to merge it into the main repo to not to maintain a fork.

Now it works only for C-MOVE request so I probably need to make it more general.

**Describe alternatives you've considered**

Now I have to fork the project and maintain it.
I also considered monkey patching but it seems too weird.

**Additional context**

I understand that it's just a non-standard DICOM server and in general project doesn't have to support such things. That's why I ask you to add switch that will just allow users that have such problem to switch off this particular check.
diff --git a/pynetdicom/tests/test_utils.py b/pynetdicom/tests/test_utils.py
index da278865b..f697f1b0b 100644
--- a/pynetdicom/tests/test_utils.py
+++ b/pynetdicom/tests/test_utils.py
@@ -97,6 +97,15 @@ class TestValidateAETitle(object):
         with pytest.raises((TypeError, ValueError)):
             validate_ae_title(aet)
 
+    def test_length_check(self):
+        """Test validate_ae_title with no length check."""
+        assert _config.ALLOW_LONG_DIMSE_AET is False
+        aet = b"12345678901234567890"
+        assert 16 == len(validate_ae_title(aet))
+        _config.ALLOW_LONG_DIMSE_AET = True
+        assert 20 == len(validate_ae_title(aet))
+        _config.ALLOW_LONG_DIMSE_AET = False
+
 
 REFERENCE_UID = [
     # UID, (enforced, non-enforced conformance)

pip install -e .
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
coverage==7.8.0
exceptiongroup==1.2.2
execnet==2.1.1
iniconfig==2.1.0
packaging==24.2
pluggy==1.5.0
pydicom==2.4.4
-e git+https://github.com/pydicom/pynetdicom.git@674ec1f93cbbc07f181f42e216d9df9edf56dc3d#egg=pynetdicom
pytest==8.3.5
pytest-asyncio==0.26.0
pytest-cov==6.0.0
pytest-mock==3.14.0
pytest-xdist==3.6.1
tomli==2.2.1
typing_extensions==4.13.0

name: pynetdicom
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - coverage==7.8.0
      - exceptiongroup==1.2.2
      - execnet==2.1.1
      - iniconfig==2.1.0
      - packaging==24.2
      - pluggy==1.5.0
      - pydicom==2.4.4
      - pytest==8.3.5
      - pytest-asyncio==0.26.0
      - pytest-cov==6.0.0
      - pytest-mock==3.14.0
      - pytest-xdist==3.6.1
      - tomli==2.2.1
      - typing-extensions==4.13.0
prefix: /opt/conda/envs/pynetdicom

pynetdicom/tests/test_utils.py::TestValidateAETitle::test_length_check
pynetdicom/tests/test_utils.py::TestValidateAETitle::test_good_ae_str[a-a pynetdicom/tests/test_utils.py::TestValidateAETitle::test_good_ae_str[a pynetdicom/tests/test_utils.py::TestValidateAETitle::test_good_ae_str[ pynetdicom/tests/test_utils.py::TestValidateAETitle::test_good_ae_str[ABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEFGHIJKLMNOP] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_good_ae_bytes[a-a pynetdicom/tests/test_utils.py::TestValidateAETitle::test_good_ae_bytes[a pynetdicom/tests/test_utils.py::TestValidateAETitle::test_good_ae_bytes[ pynetdicom/tests/test_utils.py::TestValidateAETitle::test_good_ae_bytes[ABCDEFGHIJKLMNOPQRSTUVWXYZ-ABCDEFGHIJKLMNOP] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[ pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[AE\\TITLE] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[AE\tTITLE] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[AE\rTITLE] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[AE\nTITLE] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[\t] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[\n] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[\x0c] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[\r] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[\x1b] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[\] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[\x01] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[\x0e] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[1234] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_str[45.1] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[ pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[AE\TITLE] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[AE\tTITLE] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[AE\rTITLE] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[AE\nTITLE] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[\t] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[\n] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[\x0c] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[\r] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[\x1b] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[\] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[\x01] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[\x0e] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[1234] pynetdicom/tests/test_utils.py::TestValidateAETitle::test_bad_ae_bytes[45.1] pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_true[-is_valid0] pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_true[ pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_true[11111111111111111111111111111111111111111111111111111111111111111-is_valid2] pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_true[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-is_valid3] pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_true[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-is_valid4] pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_true[0.1.2.04-is_valid5] pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_true[some pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_true[1111111111111111111111111111111111111111111111111111111111111111-is_valid7] pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_true[0.1.2.4-is_valid8] pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_false[-is_valid0] pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_false[ pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_false[11111111111111111111111111111111111111111111111111111111111111111-is_valid2] pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_false[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-is_valid3] pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_false[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-is_valid4] pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_false[0.1.2.04-is_valid5] pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_false[some pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_false[1111111111111111111111111111111111111111111111111111111111111111-is_valid7] pynetdicom/tests/test_utils.py::TestValidateUID::test_validate_uid_conformance_false[0.1.2.4-is_valid8] pynetdicom/tests/test_utils.py::TestPrettyBytes::test_parameters pynetdicom/tests/test_utils.py::TestPrettyBytes::test_bytesio
docs/changelog/v2.0.0.rst pynetdicom/apps/qrscp/handlers.py pynetdicom/utils.py pynetdicom/_config.py docs/reference/config.rst
docs/changelog/v2.0.0.rst pynetdicom/apps/qrscp/handlers.py pynetdicom/utils.py pynetdicom/_config.py docs/reference/config.rst