# S/MIME signing

**URL:** <https://community.ciphermail.com/t/s-mime-signing/594>\
**Category:** Gateway\
**Created:** [January 11, 2018, 6:09pm UTC](https://community.ciphermail.com/t/s-mime-signing/594 "2018-01-11T18:09:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craig\_Andrews](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@Craig\_Andrews](https://community.ciphermail.com/u/Craig_Andrews)\
**Post date:** [January 11, 2018, 6:09pm UTC](https://community.ciphermail.com/t/s-mime-signing/594/1 "2018-01-11T18:09:30Z")

</div>

Hello,  
I have two test users, both with valid root, intermediate, and personal  
certs with the correct usage entitlements. Both certificates have a  
white, valid background,

For the two users, I have their S/MIME certificates selected in their  
profile for signing and encryption (though I'm only trying to get  
signing to work at the moment). I have both forced signing via header  
"X-Sign" and subject signing via the example in the documentation (  
(?i)\[\s\*sign\s\*\] ). I am using this script to test both the subject  
and header, and Thunderbird to test the subject by sending a mail via  
ciphercrypt.

#!/usr/bin/env python  
import smtplib  
from email.MIMEMultipart import MIMEMultipart  
from email.MIMEText import MIMEText

fromaddr = "user1(a)domain.tld"  
toaddr = "user2(a)domain.tld"  
msg = MIMEMultipart()  
msg['From'] = fromaddr  
msg['To'] = toaddr  
msg['Subject'] = "mail subject [sign]"  
msg['X-Sign'] = ""

body = "dummy body message"  
msg.attach(MIMEText(body, 'plain'))

server = smtplib.SMTP('ciphermail.domain.tld', 25)  
server.ehlo('ciphermail.domain.tld')  
text = msg.as\_string()  
server.sendmail(fromaddr, toaddr, text)  
server.quit()

I receive the email in the destination inbox, however, it is never  
signed. I can verify from the headers that the "X-Sign" header is  
present in the email. Currently the MTA/MPA isn't giving a lot of  
information to debug. I can see the mail passing through, but there is  
no mention of an attempt for any extra processing. I was wondering what  
options in logging I can turn on to help debug this issue.

Thanks,  
Craig

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [January 11, 2018, 6:15pm UTC](https://community.ciphermail.com/t/s-mime-signing/594/2 "2018-01-11T18:15:43Z")

</div>

Hi Craig,

Can you send the relevant lines from the MPA log? The easiest is to  
filter on the MailID value (which is shown as a green GUID, looking  
similar to MailID: 28dde42b-3de0-4d8e-bc99-e0b32c8a00b3). Every email  
gets an unique MailID value. This makes it easier to filter out the  
relevant lines for an email.

Kind regards,

Martijn Brinkers

> **···**
>
> On 11-01-18 19:09, Craig Andrews via Users wrote:
> 
> > Hello,  
> > I have two test users, both with valid root, intermediate, and personal  
> > certs with the correct usage entitlements. Both certificates have a  
> > white, valid background,
> > 
> > For the two users, I have their S/MIME certificates selected in their  
> > profile for signing and encryption (though I'm only trying to get  
> > signing to work at the moment). I have both forced signing via header  
> > "X-Sign" and subject signing via the example in the documentation (  
> > (?i)\[\s\*sign\s\*\] ). I am using this script to test both the subject  
> > and header, and Thunderbird to test the subject by sending a mail via  
> > ciphercrypt.
> > 
> > #!/usr/bin/env python  
> > import smtplib  
> > from email.MIMEMultipart import MIMEMultipart  
> > from email.MIMEText import MIMEText
> > 
> > fromaddr = "user1(a)domain.tld"  
> > toaddr = "user2(a)domain.tld"  
> > msg = MIMEMultipart()  
> > msg['From'] = fromaddr  
> > msg['To'] = toaddr  
> > msg['Subject'] = "mail subject [sign]"  
> > msg['X-Sign'] = ""
> > 
> > body = "dummy body message"  
> > msg.attach(MIMEText(body, 'plain'))
> > 
> > server = smtplib.SMTP('ciphermail.domain.tld', 25)  
> > server.ehlo('ciphermail.domain.tld')  
> > text = msg.as\_string()  
> > server.sendmail(fromaddr, toaddr, text)  
> > server.quit()
> > 
> > I receive the email in the destination inbox, however, it is never  
> > signed. I can verify from the headers that the "X-Sign" header is  
> > present in the email. Currently the MTA/MPA isn't giving a lot of  
> > information to debug. I can see the mail passing through, but there is  
> > no mention of an attempt for any extra processing. I was wondering what  
> > options in logging I can turn on to help debug this issue.
> 
> --  
> CipherMail email encryption
> 
> Email encryption with support for S/MIME, OpenPGP, PDF encryption and  
> secure webmail pull.
> 
> > **[CipherMail email encryption and digital signatures](https://www.ciphermail.com)**
> >
> > Easy to use server-side email encryption for automatic encryption and digital signing of email.
> 
> Twitter: [http://twitter.com/CipherMail](http://twitter.com/CipherMail)

---

<div class="post-metadata">

**Author:** ![Craig\_Andrews1](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@Craig\_Andrews1](https://community.ciphermail.com/u/Craig_Andrews1)\
**Post date:** [January 11, 2018, 9:25pm UTC](https://community.ciphermail.com/t/s-mime-signing/594/3 "2018-01-11T21:25:35Z")

</div>

Hi Martijn,

I just sent this test email via the ciphermail web ui

11 Jan 2018 21:18:08 | INFO incoming; MailID:  
acef2600-f6e3-4758-9d6e-b5c4e642c077;  
Recipients: [user2(a)domain.tld]; Originator: user1(a)domain.tld; Sender: \<\>;  
Remote address: 127.0.0.1; Subject: test mail [sign]; Message-ID:  
\<477865062.0.1515705488493.JavaMail.tomcat7(a)ciphermail.internal.tld\>;  
(mitm.application.djigzo.james.mailets.Log) [Spool Thread #0]  
11 Jan 2018 21:18:09 | INFO Subject filter is disabled for the sender;  
MailID: acef2600-f6e3-4758-9d6e-b5c4e642c077; Recipients: [user2(a)domain.tld]  
(mitm.application.djigzo.james.mailets.Default) [Spool Thread #0]  
11 Jan 2018 21:18:09 | INFO To internal recipient(s); MailID:  
acef2600-f6e3-4758-9d6e-b5c4e642c077; Recipients: [user2(a)domain.tld]  
(mitm.application.djigzo.james.mailets.Default) [Spool Thread #0]  
11 Jan 2018 21:18:09 | INFO Message handling is finished. Sending to final  
recipient(s); MailID: acef2600-f6e3-4758-9d6e-b5c4e642c077; Recipients:  
[user2(a)domain.tld]; Originator: user1(a)domain.tld; Sender: \<\>; Remote  
address: 127.0.0.1; Subject: test mail [sign]; Message-ID:  
\<477865062.0.1515705488493.JavaMail.tomcat7(a)ciphermail.internal.tld\>;  
(mitm.application.djigzo.james.mailets.Log) [Spool Thread #0]

-Craig

> **···**
>
> On Thu, Jan 11, 2018 at 6:15 PM, Martijn Brinkers via Users \< users(a)lists.djigzo.com\> wrote:
> 
> > On 11-01-18 19:09, Craig Andrews via Users wrote:  
> > \> Hello,  
> > \> I have two test users, both with valid root, intermediate, and personal  
> > \> certs with the correct usage entitlements. Both certificates have a  
> > \> white, valid background,  
> > \>  
> > \> For the two users, I have their S/MIME certificates selected in their  
> > \> profile for signing and encryption (though I'm only trying to get  
> > \> signing to work at the moment). I have both forced signing via header  
> > \> "X-Sign" and subject signing via the example in the documentation (  
> > \> (?i)\[\s\*sign\s\*\] ). I am using this script to test both the subject  
> > \> and header, and Thunderbird to test the subject by sending a mail via  
> > \> ciphercrypt.  
> > \>  
> > \> #!/usr/bin/env python  
> > \> import smtplib  
> > \> from email.MIMEMultipart import MIMEMultipart  
> > \> from email.MIMEText import MIMEText  
> > \>  
> > \>  
> > \> fromaddr = "user1(a)domain.tld"  
> > \> toaddr = "user2(a)domain.tld"  
> > \> msg = MIMEMultipart()  
> > \> msg['From'] = fromaddr  
> > \> msg['To'] = toaddr  
> > \> msg['Subject'] = "mail subject [sign]"  
> > \> msg['X-Sign'] = ""  
> > \>  
> > \> body = "dummy body message"  
> > \> msg.attach(MIMEText(body, 'plain'))  
> > \>  
> > \> server = smtplib.SMTP('ciphermail.domain.tld', 25)  
> > \> server.ehlo('ciphermail.domain.tld')  
> > \> text = msg.as\_string()  
> > \> server.sendmail(fromaddr, toaddr, text)  
> > \> server.quit()  
> > \>  
> > \>  
> > \> I receive the email in the destination inbox, however, it is never  
> > \> signed. I can verify from the headers that the "X-Sign" header is  
> > \> present in the email. Currently the MTA/MPA isn't giving a lot of  
> > \> information to debug. I can see the mail passing through, but there is  
> > \> no mention of an attempt for any extra processing. I was wondering what  
> > \> options in logging I can turn on to help debug this issue.
> > 
> > Hi Craig,
> > 
> > Can you send the relevant lines from the MPA log? The easiest is to  
> > filter on the MailID value (which is shown as a green GUID, looking  
> > similar to MailID: 28dde42b-3de0-4d8e-bc99-e0b32c8a00b3). Every email  
> > gets an unique MailID value. This makes it easier to filter out the  
> > relevant lines for an email.
> > 
> > Kind regards,
> > 
> > Martijn Brinkers
> > 
> > --  
> > CipherMail email encryption
> > 
> > Email encryption with support for S/MIME, OpenPGP, PDF encryption and  
> > secure webmail pull.
> > 
> > [https://www.ciphermail.com](https://www.ciphermail.com)
> > 
> > Twitter: [http://twitter.com/CipherMail](http://twitter.com/CipherMail)
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Users mailing list  
> > Users(a)lists.djigzo.com  
> > [https://lists.djigzo.com/lists/listinfo/users](https://lists.djigzo.com/lists/listinfo/users)

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [January 11, 2018, 9:38pm UTC](https://community.ciphermail.com/t/s-mime-signing/594/4 "2018-01-11T21:38:19Z")

</div>

> Hi Martijn,
> 
> I just sent this test email via the ciphermail web ui
> 
> 11 Jan 2018 21:18:08 | INFO incoming; MailID:  
> acef2600-f6e3-4758-9d6e-b5c4e642c077; Recipients: [user2(a)domain.tld];  
> Originator: user1(a)domain.tld; Sender: \<\>; Remote address: 127.0.0.1;  
> Subject: test mail [sign]; Message-ID:  
> \<477865062.0.1515705488493.JavaMail.tomcat7(a)ciphermail.internal.tld\>;  
> (mitm.application.djigzo.james.mailets.Log) [Spool Thread #0]  
> 11 Jan 2018 21:18:09 | INFO Subject filter is disabled for the sender;  
> MailID: acef2600-f6e3-4758-9d6e-b5c4e642c077; Recipients:  
> [user2(a)domain.tld] (mitm.application.djigzo.james.mailets.Default)  
> [Spool Thread #0]  
> 11 Jan 2018 21:18:09 | INFO To internal recipient(s); MailID:  
> acef2600-f6e3-4758-9d6e-b5c4e642c077; Recipients: [user2(a)domain.tld]  
> (mitm.application.djigzo.james.mailets.Default) [Spool Thread #0]  
> 11 Jan 2018 21:18:09 | INFO Message handling is finished. Sending to  
> final recipient(s); MailID: acef2600-f6e3-4758-9d6e-b5c4e642c077;  
> Recipients: [user2(a)domain.tld]; Originator: user1(a)domain.tld; Sender:  
> \<\>; Remote address: 127.0.0.1; Subject: test mail [sign]; Message-ID:  
> \<477865062.0.1515705488493.JavaMail.tomcat7(a)ciphermail.internal.tld\>;  
> (mitm.application.djigzo.james.mailets.Log) [Spool Thread #0]

The recipient is considered to be an internal user. Email sent to  
internal users follow the decryption pipeline and email sent to external  
recipient follow the encryption pipeline. You either configured the  
global settings, a domain or a user as being in internal users. This is  
normal for the domain you receive email for because those emails in  
typical setups need to be decrypted. All other user, the email addresses  
for which you want to sign and/or encrypt need to be external. So, you  
either sent a message to a valid internal recipient or you accidentally  
mis-configured the Locality of the global settings/domain or user.

Kind regards,

Martijn Brinkers

> **···**
>
> On 11-01-18 22:25, Craig Andrews wrote:
> 
> > On Thu, Jan 11, 2018 at 6:15 PM, Martijn Brinkers via Users \> \<users(a)lists.djigzo.com \<mailto:users(a)[lists.djigzo.com](http://lists.djigzo.com)\>\> wrote:
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;On 11-01-18 19:09, Craig Andrews via Users wrote:  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> Hello,  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> I have two test users, both with valid root, intermediate, and  
> > &nbsp;&nbsp;&nbsp;&nbsp;personal  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> certs with the correct usage entitlements. Both certificates have a  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> white, valid background,  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> For the two users, I have their S/MIME certificates selected in their  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> profile for signing and encryption (though I'm only trying to get  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> signing to work at the moment). I have both forced signing via header  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> "X-Sign" and subject signing via the example in the documentation (  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> (?i)\[\s\*sign\s\*\] ). I am using this script to test both the subject  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> and header, and Thunderbird to test the subject by sending a mail via  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> ciphercrypt.  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> #!/usr/bin/env python  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> import smtplib  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> from email.MIMEMultipart import MIMEMultipart  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> from email.MIMEText import MIMEText  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> fromaddr = "user1(a)domain.tld"  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> toaddr = "user2(a)domain.tld"  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> msg = MIMEMultipart()  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> msg['From'] = fromaddr  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> msg['To'] = toaddr  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> msg['Subject'] = "mail subject [sign]"  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> msg['X-Sign'] = ""  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> body = "dummy body message"  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> msg.attach(MIMEText(body, 'plain'))  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> server = smtplib.SMTP('ciphermail.domain.tld', 25)  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> server.ehlo('ciphermail.domain.tld')  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> text = msg.as\_string()  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> server.sendmail(fromaddr, toaddr, text)  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> server.quit()  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> I receive the email in the destination inbox, however, it is never  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> signed. I can verify from the headers that the "X-Sign" header is  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> present in the email. Currently the MTA/MPA isn't giving a lot of  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> information to debug. I can see the mail passing through, but there is  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> no mention of an attempt for any extra processing. I was wondering  
> > &nbsp;&nbsp;&nbsp;&nbsp;what  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> options in logging I can turn on to help debug this issue.
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Hi Craig,
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Can you send the relevant lines from the MPA log? The easiest is to  
> > &nbsp;&nbsp;&nbsp;&nbsp;filter on the MailID value (which is shown as a green GUID, looking  
> > &nbsp;&nbsp;&nbsp;&nbsp;similar to MailID: 28dde42b-3de0-4d8e-bc99-e0b32c8a00b3). Every email  
> > &nbsp;&nbsp;&nbsp;&nbsp;gets an unique MailID value. This makes it easier to filter out the  
> > &nbsp;&nbsp;&nbsp;&nbsp;relevant lines for an email.
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Kind regards,
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Martijn Brinkers
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;--  
> > &nbsp;&nbsp;&nbsp;&nbsp;CipherMail email encryption
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Email encryption with support for S/MIME, OpenPGP, PDF encryption and  
> > &nbsp;&nbsp;&nbsp;&nbsp;secure webmail pull.
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;[https://www.ciphermail.com](https://www.ciphermail.com)
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Twitter: [http://twitter.com/CipherMail](http://twitter.com/CipherMail)
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > &nbsp;&nbsp;&nbsp;&nbsp;Users mailing list  
> > &nbsp;&nbsp;&nbsp;&nbsp;Users(a)lists.djigzo.com \<mailto:Users(a)[lists.djigzo.com](http://lists.djigzo.com)\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;[https://lists.djigzo.com/lists/listinfo/users](https://lists.djigzo.com/lists/listinfo/users)  
> > &nbsp;&nbsp;&nbsp;&nbsp;\<[https://lists.djigzo.com/lists/listinfo/users&gt](https://lists.djigzo.com/lists/listinfo/users&gt);
> 
> --  
> CipherMail email encryption
> 
> Email encryption with support for S/MIME, OpenPGP, PDF encryption and  
> secure webmail pull.
> 
> > **[CipherMail email encryption and digital signatures](https://www.ciphermail.com)**
> >
> > Easy to use server-side email encryption for automatic encryption and digital signing of email.
> 
> Twitter: [http://twitter.com/CipherMail](http://twitter.com/CipherMail)

---

<div class="post-metadata">

**Author:** ![Craig\_Andrews1](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@Craig\_Andrews1](https://community.ciphermail.com/u/Craig_Andrews1)\
**Post date:** [January 11, 2018, 10:10pm UTC](https://community.ciphermail.com/t/s-mime-signing/594/5 "2018-01-11T22:10:56Z")

</div>

That did it. I had originally set up the domain as internal. Eventually I  
moved the Global settings to match in an attempt at troubleshooting. I  
moved them both to external and the mail is now signed.

Outlook is showing "This message has been tampered with" which is an issue  
I had when attempting to write a solution in Python, though I don't know  
that this is a ciphermail issue.

Thanks for the assistance Martijn

> **···**
>
> On Thu, Jan 11, 2018 at 9:38 PM, Martijn Brinkers \<martijn(a)ciphermail.com\> wrote:
> 
> > On 11-01-18 22:25, Craig Andrews wrote:  
> > \>  
> > \> Hi Martijn,  
> > \>  
> > \> I just sent this test email via the ciphermail web ui  
> > \>  
> > \> 11 Jan 2018 21:18:08 | INFO incoming; MailID:  
> > \> acef2600-f6e3-4758-9d6e-b5c4e642c077; Recipients: [user2(a)domain.tld];  
> > \> Originator: user1(a)domain.tld; Sender: \<\>; Remote address: 127.0.0.1;  
> > \> Subject: test mail [sign]; Message-ID:  
> > \> \<477865062.0.1515705488493.JavaMail.tomcat7(a)ciphermail.internal.tld\>;  
> > \> (mitm.application.djigzo.james.mailets.Log) [Spool Thread #0]  
> > \> 11 Jan 2018 21:18:09 | INFO Subject filter is disabled for the sender;  
> > \> MailID: acef2600-f6e3-4758-9d6e-b5c4e642c077; Recipients:  
> > \> [user2(a)domain.tld] (mitm.application.djigzo.james.mailets.Default)  
> > \> [Spool Thread #0]  
> > \> 11 Jan 2018 21:18:09 | INFO To internal recipient(s); MailID:  
> > \> acef2600-f6e3-4758-9d6e-b5c4e642c077; Recipients: [user2(a)domain.tld]  
> > \> (mitm.application.djigzo.james.mailets.Default) [Spool Thread #0]  
> > \> 11 Jan 2018 21:18:09 | INFO Message handling is finished. Sending to  
> > \> final recipient(s); MailID: acef2600-f6e3-4758-9d6e-b5c4e642c077;  
> > \> Recipients: [user2(a)domain.tld]; Originator: user1(a)domain.tld; Sender:  
> > \> \<\>; Remote address: 127.0.0.1; Subject: test mail [sign]; Message-ID:  
> > \> \<477865062.0.1515705488493.JavaMail.tomcat7(a)ciphermail.internal.tld\>;  
> > \> (mitm.application.djigzo.james.mailets.Log) [Spool Thread #0]
> > 
> > The recipient is considered to be an internal user. Email sent to  
> > internal users follow the decryption pipeline and email sent to external  
> > recipient follow the encryption pipeline. You either configured the  
> > global settings, a domain or a user as being in internal users. This is  
> > normal for the domain you receive email for because those emails in  
> > typical setups need to be decrypted. All other user, the email addresses  
> > for which you want to sign and/or encrypt need to be external. So, you  
> > either sent a message to a valid internal recipient or you accidentally  
> > mis-configured the Locality of the global settings/domain or user.
> > 
> > Kind regards,
> > 
> > Martijn Brinkers
> > 
> > \> On Thu, Jan 11, 2018 at 6:15 PM, Martijn Brinkers via Users \> \> \<users(a)lists.djigzo.com \<mailto:users(a)[lists.djigzo.com](http://lists.djigzo.com)\>\> wrote:  
> > \>  
> > \> On 11-01-18 19:09, Craig Andrews via Users wrote:  
> > \> \> Hello,  
> > \> \> I have two test users, both with valid root, intermediate, and  
> > \> personal  
> > \> \> certs with the correct usage entitlements. Both certificates have a  
> > \> \> white, valid background,  
> > \> \>  
> > \> \> For the two users, I have their S/MIME certificates selected in  
> > their  
> > \> \> profile for signing and encryption (though I'm only trying to get  
> > \> \> signing to work at the moment). I have both forced signing via  
> > header  
> > \> \> "X-Sign" and subject signing via the example in the documentation (  
> > \> \> (?i)\[\s\*sign\s\*\] ). I am using this script to test both the  
> > subject  
> > \> \> and header, and Thunderbird to test the subject by sending a mail  
> > via  
> > \> \> ciphercrypt.  
> > \> \>  
> > \> \> #!/usr/bin/env python  
> > \> \> import smtplib  
> > \> \> from email.MIMEMultipart import MIMEMultipart  
> > \> \> from email.MIMEText import MIMEText  
> > \> \>  
> > \> \>  
> > \> \> fromaddr = "user1(a)domain.tld"  
> > \> \> toaddr = "user2(a)domain.tld"  
> > \> \> msg = MIMEMultipart()  
> > \> \> msg['From'] = fromaddr  
> > \> \> msg['To'] = toaddr  
> > \> \> msg['Subject'] = "mail subject [sign]"  
> > \> \> msg['X-Sign'] = ""  
> > \> \>  
> > \> \> body = "dummy body message"  
> > \> \> msg.attach(MIMEText(body, 'plain'))  
> > \> \>  
> > \> \> server = smtplib.SMTP('ciphermail.domain.tld', 25)  
> > \> \> server.ehlo('ciphermail.domain.tld')  
> > \> \> text = msg.as\_string()  
> > \> \> server.sendmail(fromaddr, toaddr, text)  
> > \> \> server.quit()  
> > \> \>  
> > \> \>  
> > \> \> I receive the email in the destination inbox, however, it is never  
> > \> \> signed. I can verify from the headers that the "X-Sign" header is  
> > \> \> present in the email. Currently the MTA/MPA isn't giving a lot of  
> > \> \> information to debug. I can see the mail passing through, but  
> > there is  
> > \> \> no mention of an attempt for any extra processing. I was wondering  
> > \> what  
> > \> \> options in logging I can turn on to help debug this issue.  
> > \>  
> > \> Hi Craig,  
> > \>  
> > \> Can you send the relevant lines from the MPA log? The easiest is to  
> > \> filter on the MailID value (which is shown as a green GUID, looking  
> > \> similar to MailID: 28dde42b-3de0-4d8e-bc99-e0b32c8a00b3). Every  
> > email  
> > \> gets an unique MailID value. This makes it easier to filter out the  
> > \> relevant lines for an email.  
> > \>  
> > \> Kind regards,  
> > \>  
> > \> Martijn Brinkers  
> > \>  
> > \>  
> > \> --  
> > \> CipherMail email encryption  
> > \>  
> > \> Email encryption with support for S/MIME, OpenPGP, PDF encryption and  
> > \> secure webmail pull.  
> > \>  
> > \> [https://www.ciphermail.com](https://www.ciphermail.com)  
> > \>  
> > \> Twitter: [http://twitter.com/CipherMail](http://twitter.com/CipherMail)  
> > \>  
> > \> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > \> Users mailing list  
> > \> Users(a)lists.djigzo.com \<mailto:Users(a)[lists.djigzo.com](http://lists.djigzo.com)\>  
> > \> [https://lists.djigzo.com/lists/listinfo/users](https://lists.djigzo.com/lists/listinfo/users)  
> > \> \<[https://lists.djigzo.com/lists/listinfo/users&gt](https://lists.djigzo.com/lists/listinfo/users&gt);  
> > \>  
> > \>
> > 
> > --  
> > CipherMail email encryption
> > 
> > Email encryption with support for S/MIME, OpenPGP, PDF encryption and  
> > secure webmail pull.
> > 
> > [https://www.ciphermail.com](https://www.ciphermail.com)
> > 
> > Twitter: [http://twitter.com/CipherMail](http://twitter.com/CipherMail)

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [January 11, 2018, 10:16pm UTC](https://community.ciphermail.com/t/s-mime-signing/594/6 "2018-01-11T22:16:54Z")

</div>

> That did it. I had originally set up the domain as internal. Eventually  
> I moved the Global settings to match in an attempt at troubleshooting. I  
> moved them both to external and the mail is now signed.
> 
> Outlook is showing "This message has been tampered with" which is an  
> issue I had when attempting to write a solution in Python, though I  
> don't know that this is a ciphermail issue.

A messages signed by CipherMail should not result in a tampered email.  
Could it be that there is some SMTP service after signing that modifies  
the message? (like for example adding a banner)

Can you send me a signed email (off list) so I can check whether the  
signature is valid?

Kind regards,

Martijn Brinkers

> **···**
>
> On 11-01-18 23:10, Craig Andrews wrote:
> 
> > On Thu, Jan 11, 2018 at 9:38 PM, Martijn Brinkers \> \<martijn(a)ciphermail.com \<mailto:martijn(a)[ciphermail.com](http://ciphermail.com)\>\> wrote:
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;On 11-01-18 22:25, Craig Andrews wrote:  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> Hi Martijn,  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> I just sent this test email via the ciphermail web ui  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> 11 Jan 2018 21:18:08 | INFO incoming; MailID:  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> acef2600-f6e3-4758-9d6e-b5c4e642c077; Recipients: [user2(a)domain.tld];  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> Originator: user1(a)domain.tld; Sender: \<\>; Remote address: 127.0.0.1;  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> Subject: test mail [sign]; Message-ID:  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \<477865062.0.1515705488493.JavaMail.tomcat7(a)ciphermail.internal.tld\>;  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> (mitm.application.djigzo.james.mailets.Log) [Spool Thread #0]  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> 11 Jan 2018 21:18:09 | INFO Subject filter is disabled for the sender;  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> MailID: acef2600-f6e3-4758-9d6e-b5c4e642c077; Recipients:  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> [user2(a)domain.tld] (mitm.application.djigzo.james.mailets.Default)  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> [Spool Thread #0]  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> 11 Jan 2018 21:18:09 | INFO To internal recipient(s); MailID:  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> acef2600-f6e3-4758-9d6e-b5c4e642c077; Recipients: [user2(a)domain.tld]  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> (mitm.application.djigzo.james.mailets.Default) [Spool Thread #0]  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> 11 Jan 2018 21:18:09 | INFO Message handling is finished. Sending to  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> final recipient(s); MailID: acef2600-f6e3-4758-9d6e-b5c4e642c077;  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> Recipients: [user2(a)domain.tld]; Originator: user1(a)domain.tld; Sender:  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \<\>; Remote address: 127.0.0.1; Subject: test mail [sign]; Message-ID:  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \<477865062.0.1515705488493.JavaMail.tomcat7(a)ciphermail.internal.tld\>;  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> (mitm.application.djigzo.james.mailets.Log) [Spool Thread #0]
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;The recipient is considered to be an internal user. Email sent to  
> > &nbsp;&nbsp;&nbsp;&nbsp;internal users follow the decryption pipeline and email sent to external  
> > &nbsp;&nbsp;&nbsp;&nbsp;recipient follow the encryption pipeline. You either configured the  
> > &nbsp;&nbsp;&nbsp;&nbsp;global settings, a domain or a user as being in internal users. This is  
> > &nbsp;&nbsp;&nbsp;&nbsp;normal for the domain you receive email for because those emails in  
> > &nbsp;&nbsp;&nbsp;&nbsp;typical setups need to be decrypted. All other user, the email addresses  
> > &nbsp;&nbsp;&nbsp;&nbsp;for which you want to sign and/or encrypt need to be external. So, you  
> > &nbsp;&nbsp;&nbsp;&nbsp;either sent a message to a valid internal recipient or you accidentally  
> > &nbsp;&nbsp;&nbsp;&nbsp;mis-configured the Locality of the global settings/domain or user.
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Kind regards,
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Martijn Brinkers
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;\> On Thu, Jan 11, 2018 at 6:15 PM, Martijn Brinkers via Users \> \> \<users(a)lists.djigzo.com \<mailto:users(a)[lists.djigzo.com](http://lists.djigzo.com)\> \> \<mailto:users(a)[lists.djigzo.com](http://lists.djigzo.com)\>\> wrote:  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> On 11-01-18 19:09, Craig Andrews via Users wrote:  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> Hello,  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> I have two test users, both with valid root, intermediate, and  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> personal  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> certs with the correct usage entitlements. Both certificates  
> > &nbsp;&nbsp;&nbsp;&nbsp;have a  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> white, valid background,  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> For the two users, I have their S/MIME certificates selected  
> > &nbsp;&nbsp;&nbsp;&nbsp;in their  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> profile for signing and encryption (though I'm only trying  
> > &nbsp;&nbsp;&nbsp;&nbsp;to get  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> signing to work at the moment). I have both forced signing  
> > &nbsp;&nbsp;&nbsp;&nbsp;via header  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> "X-Sign" and subject signing via the example in the  
> > &nbsp;&nbsp;&nbsp;&nbsp;documentation (  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> (?i)\[\s\*sign\s\*\] ). I am using this script to test both  
> > &nbsp;&nbsp;&nbsp;&nbsp;the subject  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> and header, and Thunderbird to test the subject by sending a  
> > &nbsp;&nbsp;&nbsp;&nbsp;mail via  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> ciphercrypt.  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> #!/usr/bin/env python  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> import smtplib  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> from email.MIMEMultipart import MIMEMultipart  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> from email.MIMEText import MIMEText  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> fromaddr = "user1(a)domain.tld"  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> toaddr = "user2(a)domain.tld"  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> msg = MIMEMultipart()  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> msg['From'] = fromaddr  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> msg['To'] = toaddr  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> msg['Subject'] = "mail subject [sign]"  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> msg['X-Sign'] = ""  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> body = "dummy body message"  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> msg.attach(MIMEText(body, 'plain'))  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> server = smtplib.SMTP('ciphermail.domain.tld', 25)  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> server.ehlo('ciphermail.domain.tld')  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> text = msg.as\_string()  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> server.sendmail(fromaddr, toaddr, text)  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> server.quit()  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> I receive the email in the destination inbox, however, it is  
> > &nbsp;&nbsp;&nbsp;&nbsp;never  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> signed. I can verify from the headers that the "X-Sign"  
> > &nbsp;&nbsp;&nbsp;&nbsp;header is  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> present in the email. Currently the MTA/MPA isn't giving a  
> > &nbsp;&nbsp;&nbsp;&nbsp;lot of  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> information to debug. I can see the mail passing through,  
> > &nbsp;&nbsp;&nbsp;&nbsp;but there is  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> no mention of an attempt for any extra processing. I was  
> > &nbsp;&nbsp;&nbsp;&nbsp;wondering  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> what  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \> options in logging I can turn on to help debug this issue.  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> Hi Craig,  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> Can you send the relevant lines from the MPA log? The easiest  
> > &nbsp;&nbsp;&nbsp;&nbsp;is to  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> filter on the MailID value (which is shown as a green GUID,  
> > &nbsp;&nbsp;&nbsp;&nbsp;looking  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> similar to MailID: 28dde42b-3de0-4d8e-bc99-e0b32c8a00b3).  
> > &nbsp;&nbsp;&nbsp;&nbsp;Every email  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> gets an unique MailID value. This makes it easier to filter  
> > &nbsp;&nbsp;&nbsp;&nbsp;out the  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> relevant lines for an email.  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> Kind regards,  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> Martijn Brinkers  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> --  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> CipherMail email encryption  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> Email encryption with support for S/MIME, OpenPGP, PDF  
> > &nbsp;&nbsp;&nbsp;&nbsp;encryption and  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> secure webmail pull.  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> [https://www.ciphermail.com](https://www.ciphermail.com)  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> Twitter: [http://twitter.com/CipherMail](http://twitter.com/CipherMail)  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> Users mailing list  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> Users(a)lists.djigzo.com \<mailto:Users(a)[lists.djigzo.com](http://lists.djigzo.com)\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\<mailto:Users(a)[lists.djigzo.com](http://lists.djigzo.com)\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> [https://lists.djigzo.com/lists/listinfo/users](https://lists.djigzo.com/lists/listinfo/users)  
> > &nbsp;&nbsp;&nbsp;&nbsp;\<[https://lists.djigzo.com/lists/listinfo/users&gt](https://lists.djigzo.com/lists/listinfo/users&gt);  
> > &nbsp;&nbsp;&nbsp;&nbsp;\> \<[https://lists.djigzo.com/lists/listinfo/users](https://lists.djigzo.com/lists/listinfo/users)  
> > &nbsp;&nbsp;&nbsp;&nbsp;\<[https://lists.djigzo.com/lists/listinfo/users&gt;&gt](https://lists.djigzo.com/lists/listinfo/users&gt;&gt);  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\>
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;--  
> > &nbsp;&nbsp;&nbsp;&nbsp;CipherMail email encryption
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Email encryption with support for S/MIME, OpenPGP, PDF encryption and  
> > &nbsp;&nbsp;&nbsp;&nbsp;secure webmail pull.
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;[https://www.ciphermail.com](https://www.ciphermail.com)
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Twitter: [http://twitter.com/CipherMail](http://twitter.com/CipherMail)
> 
> --  
> CipherMail email encryption
> 
> Email encryption with support for S/MIME, OpenPGP, PDF encryption and  
> secure webmail pull.
> 
> > **[CipherMail email encryption and digital signatures](https://www.ciphermail.com)**
> >
> > Easy to use server-side email encryption for automatic encryption and digital signing of email.
> 
> Twitter: [http://twitter.com/CipherMail](http://twitter.com/CipherMail)
