Informing the IBM Community

What happened to my emails?

5
(1)

One of the questions I get asked often is “How can you track emails sent from IBM i?” Until 7.2 this was a near impossible task.  But since 7.2 WRKSMTPEMM was added to the operating system and I love it!

What does it look like?

If we start with a WRKSMTPEMM LISTBY(*RCP) QUEUE(*ALL) we get a list of all emails sorted by recipient email address.

Press F11 will give you a selection of different views, one of the more useful being the subject field:

But how do I know if the email was sent?

This is where option 8 to view the log comes in handy, the example below shows you the exact time and date it was handed on to the relaying server. Armed with this information you know that your email was sent and that any problem with it’s delivery was not one caused by your IBM i.

Can I view the contents of an email?

Yes, using Option 9 but you really are looking at the raw email so there are a lot of headers in the file and if the email has an attachment then you will see the base encoding of it (a lot of junk characters). Below is an example of option 9 Display Mime.

ProTip: If you want to read the email properly, take the .eml file shown at the top the Display MIME screen and open it with a standard email tool like Outlook.

Where are the email stored?

They are kept in a series of directories all starting /QTCPTMM/DATA, as emails below:

The .eml files are the emails themselves and the .env files the delivery logs.

What is the catch?

Well, IBM does not turn this logging on by default, you have to enable it with the CHGSMTPA command. I think they were worried that a busy system with a lot of email might fill the disk up a little too quickly.  So, I suggest that if you do enable this, keep an eye on disk ulilisation. Personally, I’ve not had a problem on any of the systems I look after.

Below is the command you would use to keep the maximum amount of email history, a rolling 1240000 seconds, roughly two weeks.  CHGSMTPA KEEPUNTIL(1240000)

Please note that even after you issue the CHGSMTPA, this does not take effect until you stop and restart the SMTP service.

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 1

No votes so far! Be the first to rate this post.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *