21 Sep
2022
21 Sep
'22
7 p.m.
On 9/21/22 10:39, Dan Caballero wrote:
I figured out the correct import based on what was done previously. It worked.
Why do you think you need to import anything?
">>> from mailman.app.moderator import handle_message
handle_message
is not referenced in the following and doesn't need to
be imported here.
>>>> requestdb = IListRequests(m)
>>>> for req in requestdb.held_requests:
> ... if req.request_type == RequestType.held_message:
> ... if not requestdb.get_request(req.id):
> ... print(f'Bad request id: {req.id}, deleting')
> ... requestdb.delete_request(req.id)
> ...
> Bad request id: 1694, deleting
> Bad request id: 2509, deleting
> Bad request id: 2727, deleting
> Bad request id: 3251, deleting
> Bad request id: 3265, deleting
> Bad request id: 3371, deleting
> Bad request id: 4844, deleting
> Bad request id: 6058, deleting
> Bad request id: 6201, deleting
> Bad request id: 6432, deleting
> Bad request id: 6502, deleting
>>>> commit ()"
I assume after doing this, you were able to access the held messages view for the list.
Note that the only names referenced in the above and not defined there
are IListRequests
and RequestType
, but these are among the many
names implicitly imported by mailman shell
in interactive mode.
$ mailman shell
Welcome to the GNU Mailman shell
Use commit() to commit changes.
Use abort() to discard changes since the last commit.
Exit with ctrl+D does an implicit commit() but exit() does not.
>>> for name in dir():
... print(name)
...
ALL_TEMPLATES
ALT_TEMPLATE_NAMES
ALWAYS_REPLY
AcceptEvent
AcceptOwnerEvent
Action
AddressAlreadyLinkedError
AddressError
AddressNotLinkedError
AddressVerificationEvent
AlreadySubscribedError
ArchivePolicy
ArchiveRenderingMode
BadDomainSpecificationError
BounceContext
ChainEvent
ClobberDate
ConfigurationUpdatedEvent
ContinueProcessing
DMARCMitigateAction
DatabaseError
DeliveryMode
DeliveryStatus
DigestFrequency
DiscardEvent
DiscardMessage
DomainCreatedEvent
DomainCreatingEvent
DomainDeletedEvent
DomainDeletingEvent
DuplicateStyleError
EmailError
ExistingAddressError
FilterAction
FilterType
HoldEvent
IAPI
IAcceptableAlias
IAcceptableAliasSet
IAddress
IArchiver
IAutoResponseRecord
IAutoResponseSet
IBan
IBanManager
IBounceEvent
IBounceProcessor
ICLISubCommand
ICacheManager
IChain
IChainIterator
IChainLink
IConfiguration
IContentFilter
IDatabase
IDatabaseFactory
IDomain
IDomainManager
IEmailCommand
IEmailResults
IEmailValidator
IHandler
IHeaderMatch
IHeaderMatchList
ILanguage
ILanguageManager
IListArchiver
IListArchiverSet
IListManager
IListRequests
IMailTransportAgentAliases
IMailTransportAgentDelivery
IMailTransportAgentLifecycle
IMailingList
IMember
IMembershipManager
IMessage
IMessageStore
IMutableChain
IOneLastDigest
IPendable
IPended
IPendedKeyValue
IPendings
IPipeline
IPlugin
IPreferences
IRoster
IRule
IRunner
IStyle
IStyleManager
ISubscriptionManager
ISubscriptionService
ISwitchboard
ITemplate
ITemplateLoader
ITemplateManager
IUser
IUserManager
IWorkflowState
IWorkflowStateManager
InvalidConfigurationError
InvalidEmailAddressError
InvalidListNameError
LinkAction
ListAlreadyExistsError
ListCreatedEvent
ListCreatingEvent
ListDeletedEvent
ListDeletingEvent
MailmanError
MemberRole
MembershipChangeEvent
MembershipError
MembershipIsBannedError
MissingConfigurationFileError
MissingPreferredAddressError
MissingUserError
NewsgroupModeration
NoSuchListError
NotAMemberError
PasswordChangeEvent
PendType
Personalization
RejectEvent
RejectMessage
ReplyToMunging
RequestRecord
RequestType
Response
ResponseAction
RunnerCrashEvent
RunnerInterrupt
SomeRecipientsFailed
SubscriptionConfirmationNeededEvent
SubscriptionEvent
SubscriptionInvitationNeededEvent
SubscriptionMode
SubscriptionPendingError
SubscriptionPolicy
TokenOwner
TooManyMembersError
UnrecognizedBounceDisposition
UnsubscriptionConfirmationNeededEvent
UnsubscriptionEvent
UnverifiedAddressError
__builtins__
abort
commit
config
getUtility
m
>>>
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan